|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RepositorySource
A repository source is a description of a resource that can be used to access or store repository information. This class
serves as a factory for RepositoryConnection
instances and provides some basic configuration information.
Typically this interface is implemented by classes that provide standard-style getters and setters for the various properties necessary for proper configuration via reflection or introspection. This interface expects nor defines any such properties, leaving that entirely to the implementation classes.
Implementations should also provide a no-arg constructor so that it is possible to easily create instances and initialize using the standard getters and setters. One example where this is required is when a RepositorySource instance is recorded in a repository (e.g., in a configuration area), and needs to be reinstantiated.
Objects that implement this RepositorySource
interface are typically registered with a naming service such as Java
Naming and Directory InterfaceTM (JNDI). This interface extends both Referenceable
and
Serializable
so that such objects can be stored in any JNDI naming context and enable proper system recovery,
If the connections to a source are to be pooled, see RepositoryConnectionPool
.
Method Summary | |
---|---|
RepositorySourceCapabilities |
getCapabilities()
Get the capabilities for this source. |
RepositoryConnection |
getConnection()
Get a connection from this source. |
String |
getName()
Get the name for this repository source. |
int |
getRetryLimit()
Get the maximum number of retries that may be performed on a given operation when using connections created by this source. |
void |
initialize(RepositoryContext context)
Initialize this source to use the supplied RepositoryContext , from which this source can obtain
connections to other sources as well as
execution contexts . |
void |
setRetryLimit(int limit)
Set the maximum number of retries that may be performed on a given operation when using connections created by this source. |
Methods inherited from interface javax.naming.Referenceable |
---|
getReference |
Method Detail |
---|
void initialize(RepositoryContext context) throws RepositorySourceException
RepositoryContext
, from which this source can obtain
connections
to other sources
as well as
execution contexts
.
context
-
RepositorySourceException
String getName()
RepositoryConnection getConnection() throws RepositorySourceException
RepositorySourceException
- if there is a problem obtaining a connection
IllegalStateException
- if the factory is not in a state to create or return connectionsint getRetryLimit()
connections
created by this source. This value does not constitute a minimum number of retries; in fact, the connection
user is not required to retry any operations.
void setRetryLimit(int limit)
connections
created by this source. This value does not constitute a minimum number of retries; in fact, the connection
user is not required to retry any operations.
limit
- the maximum number of allowable retries, or 0 if the source has no limitRepositorySourceCapabilities getCapabilities()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |