|
|||||||||
| 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.
| Constructor Summary | |
|---|---|
RepositoryLibrary()
Create a new manager instance. |
|
RepositoryLibrary(ExecutionContext executionContext)
Create a new manager instance. |
|
RepositoryLibrary(ExecutionContext executionContext,
RepositoryConnectionFactory delegate)
Create a new manager instance. |
|
RepositoryLibrary(RepositoryConnectionFactory delegate)
Create a new manager instance. |
|
| Method Summary | |
|---|---|
boolean |
addSource(RepositorySource source)
Add the supplied federated source. |
RepositoryConnection |
createConnection(String sourceName)
Create a RepositoryConnection using the given RepositorySource name. |
ServiceAdministrator |
getAdministrator()
|
RepositoryConnectionPool |
getConnectionPool(String sourceName)
Get the connection pool managing the RepositorySource with the specified name managed by this instance. |
RepositoryConnectionFactory |
getDelegate()
Get the delegate connection factory. |
ExecutionContext |
getExecutionContext()
|
MimeTypeDetectors |
getMimeTypeDetectors()
|
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<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(RepositorySource source,
long timeToAwait,
TimeUnit unit)
Remove from this federated repository the supplied source (or a source with the same name as that supplied). |
RepositorySource |
removeSource(String name,
long timeToAwait,
TimeUnit unit)
Remove from this federated repository the source with the supplied name. |
void |
setDelegate(RepositoryConnectionFactory delegate)
Set the delegate connection factory. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RepositoryLibrary()
public RepositoryLibrary(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(ExecutionContext executionContext)
executionContext - the execution context, which can be used used by sources to create other ExecutionContext
instances with different JAAS security contexts
IllegalArgumentException - if the executionContextFactory reference is null
public RepositoryLibrary(ExecutionContext executionContext,
RepositoryConnectionFactory delegate)
executionContext - the execution context, which can be used used by sources to create other ExecutionContext
instances with different JAAS security contextsdelegate - 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 ExecutionContext getExecutionContext()
public MimeTypeDetectors getMimeTypeDetectors()
public RepositoryConnectionFactory getDelegate()
public void setDelegate(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()
public 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<RepositorySource> getSources()
RepositorySource instances managed by this instance.
public RepositorySource getSource(String sourceName)
sourceName - the name of the source
public RepositoryConnectionPool getConnectionPool(String sourceName)
RepositorySource with the specified name managed by this instance.
sourceName - the name of the source
public boolean addSource(RepositorySource source)
source - the source to add
public boolean removeSource(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 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 RepositoryConnection createConnection(String sourceName)
RepositoryConnection using the given RepositorySource name.
createConnection in interface RepositoryConnectionFactorysourceName - the name of the source from which a connection should be obtained
RepositoryConnectionFactory.createConnection(java.lang.String)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||