org.jboss.dna.jcr
Class JcrEngine

java.lang.Object
  extended by org.jboss.dna.repository.DnaEngine
      extended by org.jboss.dna.jcr.JcrEngine

@ThreadSafe
public class JcrEngine
extends DnaEngine

The basic component that encapsulates the JBoss DNA services, including the Repository instances.


Field Summary
 
Fields inherited from class org.jboss.dna.repository.DnaEngine
CONFIGURATION_REPOSITORY_NAME
 
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.
 JcrRepository getRepository(String repositoryName)
          Get the Repository implementation for the named repository.
 Set<String> getRepositoryNames()
          Get the names of each of the JCR repositories.
 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.
 
Methods inherited from class org.jboss.dna.repository.DnaEngine
getExecutionContext, getGraph, getGraph, getProblems, getRepositoryConnectionFactory, getRepositoryService, getRepositorySource, getSequencingService
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

shutdown

public void shutdown()
Description copied from class: DnaEngine
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. This method may be called multiple times, but only the first time has an effect.

Overrides:
shutdown in class DnaEngine
See Also:
DnaEngine.start()

awaitTermination

public boolean awaitTermination(long timeout,
                                TimeUnit unit)
                         throws InterruptedException
Description copied from class: DnaEngine
Blocks until the shutdown has completed, or the timeout occurs, or the current thread is interrupted, whichever happens first.

Overrides:
awaitTermination in class DnaEngine
Parameters:
timeout - the maximum time to wait for each component in this engine
unit - the time unit of the timeout argument
Returns:
true if this service complete shut down and false if the timeout elapsed before it was shut down completely
Throws:
InterruptedException - if interrupted while waiting

start

public void start()
Description copied from class: DnaEngine
Start this engine to make it available for use.

Overrides:
start in class DnaEngine
See Also:
DnaEngine.shutdown()

getRepository

public final JcrRepository getRepository(String repositoryName)
                                  throws javax.jcr.RepositoryException
Get the Repository implementation for the named repository.

Parameters:
repositoryName - the name of the repository, which corresponds to the name of a configured RepositorySource
Returns:
the named repository instance
Throws:
IllegalArgumentException - if the repository name is null, blank or invalid
javax.jcr.RepositoryException - if there is no repository with the specified name
IllegalStateException - if this engine was not started

getRepositoryNames

public Set<String> getRepositoryNames()
Get the names of each of the JCR repositories.

Returns:
the immutable names of the repositories that exist at the time this method is called


Copyright © 2008-2010 JBoss, a division of Red Hat. All Rights Reserved.