|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.modeshape.repository.RepositoryService
@ThreadSafe public class RepositoryService
A service that manages the RepositorySource
es defined within a configuration repository.
Nested Class Summary | |
---|---|
protected class |
RepositoryService.Administrator
The administrative component for this service. |
protected class |
RepositoryService.ConfigurationChangeObserver
|
protected static class |
RepositoryService.GarbageCollectedSource
|
Field Summary | |
---|---|
static int |
MAXIMUM_NUMBER_OF_PASSES_PER_GC_RUN
|
Constructor Summary | |
---|---|
RepositoryService(RepositorySource configurationSource,
String configurationWorkspaceName,
Path pathToConfigurationRoot,
ExecutionContext context,
ObservationBus observationBus,
Problems problems)
Create a service instance, reading the configuration describing new RepositorySource instances from the supplied
configuration repository. |
Method Summary | |
---|---|
protected Object |
createInstanceFromProperties(Subgraph subgraph,
Location location,
Problems problems,
boolean mustHaveClassName)
Instantiate the Object described by the supplied properties. |
protected RepositorySource |
createRepositorySource(Subgraph subgraph,
Location location,
Problems problems)
Instantiate the RepositorySource described by the supplied properties. |
boolean |
equals(Object obj)
|
org.modeshape.repository.service.ServiceAdministrator |
getAdministrator()
|
String |
getConfigurationSourceName()
|
String |
getConfigurationWorkspaceName()
|
ExecutionContext |
getExecutionEnvironment()
|
String |
getJndiName()
|
protected Path |
getPathToConfigurationRoot()
|
protected Path |
getPathToSources()
|
RepositoryLibrary |
getRepositoryLibrary()
Get the library of RepositorySource instances used by this service. |
void |
notify(Changes changes)
Method that is called for each set of changes from the Observable instance(s) with which this
observer is registered. |
boolean |
requiresGarbageCollection()
Determine if at least one source requires periodic garbage collection. |
void |
runGarbageCollection(Problems problems)
This method goes through all RepositorySource instances in the library , and for
each of them that don't support automatic garbage
collection will submit a CollectGarbageRequest . |
protected boolean |
setBeanPropertyIfExistsAndNotSet(Object target,
String propertyName,
Object value)
|
protected void |
shutdownService()
|
protected void |
startService()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MAXIMUM_NUMBER_OF_PASSES_PER_GC_RUN
Constructor Detail |
---|
public RepositoryService(RepositorySource configurationSource, String configurationWorkspaceName, Path pathToConfigurationRoot, ExecutionContext context, ObservationBus observationBus, Problems problems)
RepositorySource
instances from the supplied
configuration repository.
configurationSource
- the RepositorySource
that is the configuration repositoryconfigurationWorkspaceName
- the name of the workspace in the RepositorySource
that is the configuration
repository, or null if the default workspace of the source should be used (if there is one)pathToConfigurationRoot
- the path of the node in the configuration source repository that should be treated by this
service as the root of the service's configuration; if null, then "/dna:system" is usedcontext
- the execution context in which this service should runobservationBus
- the ObservationBus
instance that should be used for changes in the sourcesproblems
- the Problems
instance that this service should use to report problems starting repositories
IllegalArgumentException
- if the bootstrap source is null or the execution context is nullMethod Detail |
---|
public final org.modeshape.repository.service.ServiceAdministrator getAdministrator()
getAdministrator
in interface org.modeshape.repository.service.AdministeredService
public final String getConfigurationSourceName()
public final String getConfigurationWorkspaceName()
public final RepositoryLibrary getRepositoryLibrary()
RepositorySource
instances used by this service.
protected final Path getPathToConfigurationRoot()
protected Path getPathToSources()
public final ExecutionContext getExecutionEnvironment()
public String getJndiName()
protected void startService()
protected void shutdownService()
protected RepositorySource createRepositorySource(Subgraph subgraph, Location location, Problems problems)
RepositorySource
described by the supplied properties.
subgraph
- the subgraph containing the configuration information for this RepositorySource
location
- the location of the properties to apply to the new RepositorySource
problems
- the problems container in which any problems should be reported; never null
protected Object createInstanceFromProperties(Subgraph subgraph, Location location, Problems problems, boolean mustHaveClassName)
Object
described by the supplied properties.
subgraph
- the subgraph containing the configuration information for this instancelocation
- the location of the properties to apply to the new instanceproblems
- the problems container in which any problems should be reported; never nullmustHaveClassName
- indicates that the properties must include a class name; if true a problem will be added for
instances that do not have a class name specified
protected boolean setBeanPropertyIfExistsAndNotSet(Object target, String propertyName, Object value)
public boolean equals(Object obj)
equals
in class Object
public void notify(Changes changes)
set of changes
from the Observable
instance(s) with which this
observer is registered.
notify
in interface Observer
changes
- the changes that are being publishedObserver.notify(org.modeshape.graph.observe.Changes)
public boolean requiresGarbageCollection()
runGarbageCollection(Problems)
should be called periodically, or false otherwisepublic void runGarbageCollection(Problems problems)
RepositorySource
instances in the library
, and for
each of them that don't support automatic garbage
collection
will submit a CollectGarbageRequest
.
This method does all this work in the calling thread, blocking until all such requests have been issued and completed. It
actually uses a queue, first enqueuing all RepositorySource instances that don't
support automatic garbage collection
. It then
pulls the first source from the queue, obtains a connection, submits a single CollectGarbageRequest
, and
re-enqueues the source if required
. However, this method never
requests a source collect garbage more than MAXIMUM_NUMBER_OF_PASSES_PER_GC_RUN
times.
Thus a source can implement a garbage collection sweep in a manner that does not require excess amount of time so as to not block other requests. After that pass is completed, the source can simply denote in the CollectGarbageRequest whether at least one additional GC pass should be performed.
problems
- the problems container in which any errors should be reported; if null, then any problems will be logged
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |