|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jboss.dna.repository.RepositoryLibrary
@ThreadSafe public class RepositoryLibrary
A library of RepositorySource instances and the RepositoryConnectionPool used to manage the connections for
each.
| Nested Class Summary | |
|---|---|
protected class |
RepositoryLibrary.Administrator
The administrative component for this service. |
| Constructor Summary | |
|---|---|
RepositoryLibrary()
Create a new manager instance. |
|
RepositoryLibrary(org.jboss.dna.graph.ExecutionContextFactory executionContextFactory)
Create a new manager instance. |
|
RepositoryLibrary(org.jboss.dna.graph.ExecutionContextFactory executionContextFactory,
org.jboss.dna.graph.connectors.RepositoryConnectionFactory delegate)
Create a new manager instance. |
|
RepositoryLibrary(org.jboss.dna.graph.connectors.RepositoryConnectionFactory delegate)
Create a new manager instance. |
|
| Method Summary | |
|---|---|
boolean |
addSource(org.jboss.dna.graph.connectors.RepositorySource source)
Add the supplied federated source. |
protected boolean |
awaitTermination(long timeout,
TimeUnit unit)
Utility method called by the administrator. |
org.jboss.dna.graph.connectors.RepositoryConnection |
createConnection(String sourceName)
|
ServiceAdministrator |
getAdministrator()
|
org.jboss.dna.graph.connectors.RepositoryConnectionPool |
getConnectionPool(String sourceName)
Get the connection pool managing the RepositorySource with the specified name managed by this instance. |
org.jboss.dna.graph.connectors.RepositoryConnectionFactory |
getDelegate()
Get the delegate connection factory. |
org.jboss.dna.graph.ExecutionContextFactory |
getExecutionContextFactory()
|
org.jboss.dna.graph.connectors.RepositorySource |
getSource(String sourceName)
Get the RepositorySource with the specified name managed by this instance. |
Collection<String> |
getSourceNames()
Get an unmodifiable collection of RepositorySource names. |
Collection<org.jboss.dna.graph.connectors.RepositorySource> |
getSources()
Get an unmodifiable collection of RepositorySource instances managed by this instance. |
boolean |
isTerminated()
Return true if this federated repository has completed its termination and no longer has any open connections. |
boolean |
isTerminating()
Returns true if this federated repository is in the process of terminating after ServiceAdministrator.shutdown()
has been called on the administrator, but the federated repository has connections that have
not yet normally been closed. |
boolean |
removeSource(org.jboss.dna.graph.connectors.RepositorySource source,
long timeToAwait,
TimeUnit unit)
Remove from this federated repository the supplied source (or a source with the same name as that supplied). |
org.jboss.dna.graph.connectors.RepositorySource |
removeSource(String name,
long timeToAwait,
TimeUnit unit)
Remove from this federated repository the source with the supplied name. |
void |
setDelegate(org.jboss.dna.graph.connectors.RepositoryConnectionFactory delegate)
Set the delegate connection factory. |
protected void |
shutdown()
Utility method called by the administrator. |
protected void |
start()
Utility method called by the administrator. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RepositoryLibrary()
public RepositoryLibrary(org.jboss.dna.graph.connectors.RepositoryConnectionFactory delegate)
delegate - the connection factory to which this instance should delegate in the event that a source is not found in
this manager; may be null if there is no delegatepublic RepositoryLibrary(org.jboss.dna.graph.ExecutionContextFactory executionContextFactory)
executionContextFactory - the execution context factory, used by sources to create ExecutionContext instances
IllegalArgumentException - if the executionContextFactory reference is null
public RepositoryLibrary(org.jboss.dna.graph.ExecutionContextFactory executionContextFactory,
org.jboss.dna.graph.connectors.RepositoryConnectionFactory delegate)
executionContextFactory - the execution context factory, used by sources to create ExecutionContext instancesdelegate - the connection factory to which this instance should delegate in the event that a source is not found in
this manager; may be null if there is no delegate
IllegalArgumentException - if the executionContextFactory reference is null| Method Detail |
|---|
public org.jboss.dna.graph.ExecutionContextFactory getExecutionContextFactory()
public org.jboss.dna.graph.connectors.RepositoryConnectionFactory getDelegate()
public void setDelegate(org.jboss.dna.graph.connectors.RepositoryConnectionFactory delegate)
delegate - the connection factory to which this instance should delegate in the event that a source is not found in
this manager; may be null if there is no delegatepublic ServiceAdministrator getAdministrator()
protected void start()
protected void shutdown()
protected boolean awaitTermination(long timeout,
TimeUnit unit)
throws InterruptedException
timeout - unit -
InterruptedExceptionpublic boolean isTerminating()
ServiceAdministrator.shutdown()
has been called on the administrator, but the federated repository has connections that have
not yet normally been closed. This method may be useful for debugging. A return of
true reported a sufficient period after shutdown may indicate that connection users have ignored or suppressed
interruption, causing this repository not to properly terminate.
isTerminated()public boolean isTerminated()
isTerminating()public Collection<String> getSourceNames()
RepositorySource names.
public Collection<org.jboss.dna.graph.connectors.RepositorySource> getSources()
RepositorySource instances managed by this instance.
public org.jboss.dna.graph.connectors.RepositorySource getSource(String sourceName)
sourceName - the name of the source
public org.jboss.dna.graph.connectors.RepositoryConnectionPool getConnectionPool(String sourceName)
RepositorySource with the specified name managed by this instance.
sourceName - the name of the source
public boolean addSource(org.jboss.dna.graph.connectors.RepositorySource source)
source - the source to add
public boolean removeSource(org.jboss.dna.graph.connectors.RepositorySource source,
long timeToAwait,
TimeUnit unit)
throws InterruptedException
This method can safely be called while the federation repository is in use.
source - the source to be removedtimeToAwait - the amount of time to wait while all of the source's connections are closed, or non-positive if the call
should not wait at allunit - the time unit to be used for timeToAwait
InterruptedException - if the thread is interrupted while awaiting closing of the connections
public org.jboss.dna.graph.connectors.RepositorySource removeSource(String name,
long timeToAwait,
TimeUnit unit)
throws InterruptedException
name - the name of the source to be removedtimeToAwait - the amount of time to wait while all of the source's connections are closed, or non-positive if the call
should not wait at allunit - the time unit to be used for timeToAwait
InterruptedException - if the thread is interrupted while awaiting closing of the connectionspublic org.jboss.dna.graph.connectors.RepositoryConnection createConnection(String sourceName)
createConnection in interface org.jboss.dna.graph.connectors.RepositoryConnectionFactoryRepositoryConnectionFactory.createConnection(java.lang.String)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||