|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.modeshape.repository.ModeShapeEngine
@Immutable public class ModeShapeEngine
A single instance of the ModeShape services, which is obtained after setting up the configuration
.
ModeShapeConfiguration
Nested Class Summary | |
---|---|
protected class |
ModeShapeEngine.ConfigurationScanner
The component responsible for reading the configuration repository and (eventually) for propagating changes in the configuration repository into the services. |
Field Summary | |
---|---|
protected ModeShapeConfiguration.ConfigurationDefinition |
configuration
|
static String |
CONFIGURATION_REPOSITORY_NAME
|
protected ExecutionContext |
context
|
static int |
DEFAULT_GARBAGE_COLLECTION_INTERVAL_IN_SECONDS
The default interval (in seconds) for running the garbage collection sweeps, if there are sources require it. |
protected Problems |
problems
|
protected ModeShapeEngine.ConfigurationScanner |
scanner
|
Constructor Summary | |
---|---|
protected |
ModeShapeEngine(ExecutionContext context,
ModeShapeConfiguration.ConfigurationDefinition configuration)
|
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 void |
checkProblemsOnStartup()
Check whether there are any problems that would prevent startup. |
protected boolean |
checkRunning()
|
protected Graph |
getConfigurationGraph()
|
protected Subgraph |
getConfigurationSubgraph(boolean refresh)
Get a subgraph containing the configuration content. |
ExecutionContext |
getExecutionContext()
Get the context in which this engine is executing. |
Graph |
getGraph(ExecutionContext context,
String sourceName)
Get a graph to the underlying source, using the supplied context. |
Graph |
getGraph(String sourceName)
Get a graph to the underlying source. |
protected MimeTypeDetector |
getMimeTypeDetector()
Return the component that is able to detect MIME types given the name of a stream and a stream. |
Problems |
getProblems()
Get the problems that were encountered when setting up this engine from the configuration. |
RepositoryConnectionFactory |
getRepositoryConnectionFactory()
Get a factory of connections, backed by the RepositorySor |
RepositoryService |
getRepositoryService()
Get the repository service. |
RepositorySource |
getRepositorySource(String repositoryName)
Get the RepositorySource instance used by this engine. |
org.modeshape.repository.sequencer.SequencingService |
getSequencingService()
Get the sequencing service. |
protected TextExtractor |
getTextExtractor()
Return the component that is able to extract text given content and its MIME type. |
protected Logger |
logger()
|
protected ModeShapeConfigurationException |
newConfigurationException(String msg)
Construct a new ModeShapeConfigurationException. |
protected ModeShapeEngine.ConfigurationScanner |
newConfigurationScanner(Problems problems,
ExecutionContext context,
ModeShapeConfiguration.ConfigurationDefinition configuration)
|
protected void |
postShutdown()
|
protected void |
preShutdown()
|
void |
shutdown()
Shutdown this engine to close all connections, terminate any ongoing background operations (such as sequencing), and reclaim any resources that were acquired by this engine. |
void |
start()
Start this engine to make it available for use. |
protected void |
startGcService()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_GARBAGE_COLLECTION_INTERVAL_IN_SECONDS
public static final String CONFIGURATION_REPOSITORY_NAME
protected final ModeShapeConfiguration.ConfigurationDefinition configuration
protected final ModeShapeEngine.ConfigurationScanner scanner
protected final Problems problems
protected final ExecutionContext context
Constructor Detail |
---|
protected ModeShapeEngine(ExecutionContext context, ModeShapeConfiguration.ConfigurationDefinition configuration)
Method Detail |
---|
protected ModeShapeEngine.ConfigurationScanner newConfigurationScanner(Problems problems, ExecutionContext context, ModeShapeConfiguration.ConfigurationDefinition configuration)
protected Logger logger()
public Problems getProblems()
public final ExecutionContext getExecutionContext()
public final RepositorySource getRepositorySource(String repositoryName)
RepositorySource
instance used by this engine.
repositoryName
- the name of the repository source
IllegalStateException
- if this engine was not started
public final RepositoryConnectionFactory getRepositoryConnectionFactory()
IllegalStateException
- if this engine was not started
public final RepositoryService getRepositoryService()
IllegalStateException
- if this engine was not started
public final Graph getGraph(String sourceName)
sourceName
- the name of the source
IllegalArgumentException
- if the source name is null
RepositorySourceException
- if a source with the supplied name does not exist
IllegalStateException
- if this engine was not started
public final Graph getGraph(ExecutionContext context, String sourceName)
context
.
context
- the context of execution for this graph; may not be nullsourceName
- the name of the source
IllegalArgumentException
- if the context or source name are null
RepositorySourceException
- if a source with the supplied name does not exist
IllegalStateException
- if this engine was not started
public final org.modeshape.repository.sequencer.SequencingService getSequencingService()
IllegalStateException
- if this engine was not started
protected final MimeTypeDetector getMimeTypeDetector()
IllegalStateException
- if this engine was not started
protected final TextExtractor getTextExtractor()
IllegalStateException
- if this engine was not started
protected final boolean checkRunning()
protected void checkProblemsOnStartup() throws ModeShapeConfigurationException
ModeShapeConfigurationException
if there is at least one error.
ModeShapeConfigurationException
- if there is at least one errorprotected ModeShapeConfigurationException newConfigurationException(String msg)
ModeShapeConfigurationException
is to be thrown from start()
.
msg
- the message
protected void checkConfiguration(Subgraph configuration)
configuration
- the configuration subgraphpublic void start()
IllegalStateException
- if this method is called when already shut down.
ModeShapeConfigurationException
- if there is an error in the configuration or any of the services that prevents
proper startupshutdown()
protected void startGcService()
public void shutdown()
start()
protected void preShutdown()
protected void postShutdown()
public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException
timeout
- the maximum time to wait for each component in this engineunit
- the time unit of the timeout argument
InterruptedException
- if interrupted while waitingprotected Graph getConfigurationGraph()
protected Subgraph getConfigurationSubgraph(boolean refresh)
refresh
- true if the subgraph should be re-read, or false if the last cached version can be used
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |