|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.modeshape.repository.ModeShapeEngine
org.modeshape.jcr.JcrEngine
@ThreadSafe public class JcrEngine
The basic component that encapsulates the ModeShape services, including the Repository
instances.
Nested Class Summary | |
---|---|
protected class |
JcrEngine.JcrRepositoryHolder
|
protected class |
JcrEngine.RepositoryInitializer
|
Nested classes/interfaces inherited from class org.modeshape.repository.ModeShapeEngine |
---|
ModeShapeEngine.ConfigurationScanner |
Field Summary |
---|
Fields inherited from class org.modeshape.repository.ModeShapeEngine |
---|
configuration, CONFIGURATION_REPOSITORY_NAME, context, DEFAULT_GARBAGE_COLLECTION_INTERVAL_IN_SECONDS, problems, scanner |
Method Summary | |
---|---|
boolean |
awaitTermination(long timeout,
TimeUnit unit)
Blocks until the shutdown has completed, or the timeout occurs, or the current thread is interrupted, whichever happens first. |
protected void |
checkConfiguration(Subgraph configuration)
Check the configuration given by the supplied graph. |
protected JcrRepository |
doCreateJcrRepository(String repositoryName)
|
String |
getEngineVersion()
Get the version of this engine. |
protected Logger |
getLogger()
|
JcrRepository |
getRepository(String repositoryName)
Get the Repository implementation for the named repository. |
Set<String> |
getRepositoryNames()
Get the names of each of the JCR repositories. |
Map<String,Object> |
initDescriptors()
|
protected boolean |
isTrue(Object value)
|
protected ModeShapeConfigurationException |
newConfigurationException(String msg)
Construct a new ModeShapeConfigurationException. |
protected void |
preShutdown()
|
protected Problems |
problems()
|
protected String |
readable(Location location)
|
protected String |
readable(Name name)
|
protected String |
readable(Path path)
|
void |
shutdownAndAwaitTermination(long timeout,
TimeUnit unit)
This method is equivalent to calling ModeShapeEngine.shutdown() followed by awaitTermination(long, TimeUnit) , except that
after those methods are called any remaining JCR sessions are terminated automatically. |
void |
start()
Start this engine to make it available for use. |
void |
start(boolean validateRepositoryConfigs)
Start this engine to make it available for use, and optionally start each of the repositories in the configuration. |
void |
start(boolean validateRepositoryConfigs,
long timeout,
TimeUnit timeoutUnit)
Start this engine to make it available for use, and optionally start each of the repositories in the configuration. |
protected String |
string(Object value)
|
Methods inherited from class org.modeshape.repository.ModeShapeEngine |
---|
checkProblemsOnStartup, checkRunning, getConfigurationGraph, getConfigurationSubgraph, getExecutionContext, getGraph, getGraph, getMimeTypeDetector, getProblems, getRepositoryConnectionFactory, getRepositoryService, getRepositorySource, getSequencingService, getTextExtractor, logger, newConfigurationScanner, postShutdown, shutdown, startGcService |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
protected void preShutdown()
preShutdown
in class ModeShapeEngine
public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException
awaitTermination
in class ModeShapeEngine
timeout
- the maximum time to wait for each component in this engineunit
- the time unit of the timeout argument
InterruptedException
- if interrupted while waitingprotected void checkConfiguration(Subgraph configuration)
checkConfiguration
in class ModeShapeEngine
configuration
- the configuration subgraphModeShapeEngine.checkConfiguration(org.modeshape.graph.Subgraph)
public void start()
start
in class ModeShapeEngine
IllegalStateException
- if this method is called when already shut down.
JcrConfigurationException
- if there is an error in the configuration or any of the services that prevents proper
startupstart(boolean)
,
ModeShapeEngine.shutdown()
public void start(boolean validateRepositoryConfigs)
This method starts each repository in parallel, and returns only after all repositories have been started (or failed startup).
validateRepositoryConfigs
- true if the configurations of each repository should be validated and each repository
started/initialized, or false otherwise
IllegalStateException
- if this method is called when already shut down.
JcrConfigurationException
- if there is an error in the configuration or any of the services that prevents proper
startupstart()
,
ModeShapeEngine.shutdown()
public void start(boolean validateRepositoryConfigs, long timeout, TimeUnit timeoutUnit)
This method starts each repository in parallel, and returns after the supplied timeout or after all repositories have been started (or failed startup), whichever comes first.
validateRepositoryConfigs
- true if the configurations of each repository should be validated and each repository
started/initialized, or false otherwisetimeout
- the maximum time to wait; can be 0 or a positive number, but use a negative number to wait indefinitely
until all repositories are started (or failed)timeoutUnit
- the time unit of the timeout
argument; may not be null, but ignored if timeout
is
negative
IllegalStateException
- if this method is called when already shut down.
JcrConfigurationException
- if there is an error in the configuration or any of the services that prevents proper
startupstart()
,
ModeShapeEngine.shutdown()
protected ModeShapeConfigurationException newConfigurationException(String msg)
ModeShapeConfigurationException
is to be thrown from ModeShapeEngine.start()
.
newConfigurationException
in class ModeShapeEngine
msg
- the message
ModeShapeEngine.newConfigurationException(java.lang.String)
public String getEngineVersion()
public final JcrRepository getRepository(String repositoryName) throws RepositoryException
Repository
implementation for the named repository.
getRepository
in interface Repositories
repositoryName
- the name of the repository, which corresponds to the name of a configured RepositorySource
IllegalArgumentException
- if the repository name is null, blank or invalid
RepositoryException
- if there is no repository with the specified name
IllegalStateException
- if this engine was not started
public Set<String> getRepositoryNames()
getRepositoryNames
in interface Repositories
protected JcrRepository doCreateJcrRepository(String repositoryName) throws RepositoryException, PathNotFoundException
RepositoryException
PathNotFoundException
protected final String readable(Name name)
protected final String readable(Path path)
protected final String readable(Location location)
protected final String string(Object value)
protected final boolean isTrue(Object value)
public Map<String,Object> initDescriptors()
public void shutdownAndAwaitTermination(long timeout, TimeUnit unit) throws InterruptedException
ModeShapeEngine.shutdown()
followed by awaitTermination(long, TimeUnit)
, except that
after those methods are called any remaining JCR sessions are terminated automatically. This is useful when shutting down
while there are long-running JCR sessions (such as for event listeners).
timeout
- the maximum time to wait for each component in this engineunit
- the time unit of the timeout argument
InterruptedException
- if interrupted while waitingprotected Logger getLogger()
protected Problems problems()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |