|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.modeshape.graph.connector.federation.FederatedRepositorySource
@ThreadSafe public class FederatedRepositorySource
A RepositorySource
for a federated repository.
Field Summary | |
---|---|
static int |
DEFAULT_RETRY_LIMIT
The default limit is 0 for retrying connection calls to the underlying source. |
protected static String |
RETRY_LIMIT
|
protected static String |
SOURCE_NAME
|
Constructor Summary | |
---|---|
FederatedRepositorySource()
Construct a new instance of a RepositorySource for a federated repository. |
Method Summary | |
---|---|
org.modeshape.graph.connector.federation.FederatedWorkspace |
addWorkspace(String workspaceName,
Iterable<Projection> projections,
boolean isDefault)
Add a federated workspace to this source. |
protected void |
changeConfiguration()
Mark the current configuration (if there is one) as being invalid. |
void |
close()
Signal this source that it is no longer needed and should begin the process of reclaiming or closing all resources that it has acquired. |
protected Projection |
createProjection(ExecutionContext context,
ProjectionParser projectionParser,
Node node)
Instantiate the Projection described by the supplied properties. |
boolean |
equals(Object obj)
|
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. |
Object |
getObjectInstance(Object obj,
Name name,
Context nameCtx,
Hashtable<?,?> environment)
|
Reference |
getReference()
|
int |
getRetryLimit()
Get the maximum number of retries that may be performed on a given operation when using connections created by this source. |
int |
hashCode()
|
boolean |
hasWorkspace(String workspaceName)
|
void |
initialize(RepositoryContext context)
Initialize this source to use the supplied RepositoryContext , from which this source can obtain the
configuration defining this source,
connections to other sources , and the
execution context . |
protected org.modeshape.graph.connector.federation.FederatedRepository |
loadRepository(String name,
RepositoryContext repositoryContext)
Utility to load the current configuration for this source from the configuration repository . |
boolean |
removeWorkspace(String workspaceName)
Remove the named workspace from the repository source. |
void |
setName(String name)
|
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 class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_RETRY_LIMIT
connection
calls to the underlying source.
protected static final String SOURCE_NAME
protected static final String RETRY_LIMIT
Constructor Detail |
---|
public FederatedRepositorySource()
RepositorySource
for a federated repository.
Method Detail |
---|
public String getName()
getName
in interface RepositorySource
RepositorySource.getName()
public void setName(String name)
name
- Sets name to the specified value.public int 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.
getRetryLimit
in interface RepositorySource
RepositorySource.getRetryLimit()
public 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.
setRetryLimit
in interface RepositorySource
limit
- the maximum number of allowable retries, or 0 if the source has no limitRepositorySource.setRetryLimit(int)
public RepositorySourceCapabilities getCapabilities()
getCapabilities
in interface RepositorySource
RepositorySource.getCapabilities()
public void initialize(RepositoryContext context) throws RepositorySourceException
RepositoryContext
, from which this source can obtain the
configuration
defining this source,
connections
to other sources
, and the
execution context
.
This method may be called each time the configuration changes, allowing the source to update itself.
initialize
in interface RepositorySource
RepositorySourceException
RepositorySource.initialize(org.modeshape.graph.connector.RepositoryContext)
public RepositoryConnection getConnection() throws RepositorySourceException
getConnection
in interface RepositorySource
RepositorySourceException
- if there is a problem obtaining a connectionRepositorySource.getConnection()
public void close()
connections
may still be in use, this method may not necessarily close all
resources immediately.
This is a required method, and must be called when this source is no longer needed if one or more connections
have been obtained since the previous call to this method.
Note that calling this method also does not preclude obtaining more connections
after this method
is called. If that happens, this source should simply reacquire any resources necessary to provide additional connections,
and this method needs to be called once again.
close
in interface RepositorySource
RepositorySource.close()
public Reference getReference()
getReference
in interface Referenceable
Referenceable.getReference()
public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?,?> environment) throws Exception
getObjectInstance
in interface ObjectFactory
Exception
ObjectFactory.getObjectInstance(java.lang.Object, javax.naming.Name, javax.naming.Context,
java.util.Hashtable)
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
protected void changeConfiguration()
protected org.modeshape.graph.connector.federation.FederatedRepository loadRepository(String name, RepositoryContext repositoryContext) throws RepositorySourceException
configuration repository
. This method may only be called after the source is initialized
.
name
- the name of the source; may not be nullrepositoryContext
- the repository context; may not be null
RepositorySourceException
- if there is a problem with the configurationpublic org.modeshape.graph.connector.federation.FederatedWorkspace addWorkspace(String workspaceName, Iterable<Projection> projections, boolean isDefault)
workspaceName
- the name of the new federated workspaceprojections
- the projections that should be used in the workspaceisDefault
- true if this workspace should be used as the default workspace, or false otherwise
IllegalArgumentException
- if the workspace name or the projections reference are nullpublic boolean removeWorkspace(String workspaceName)
workspaceName
- the name of the workspace to remove
IllegalArgumentException
- if the workspace name is nullpublic boolean hasWorkspace(String workspaceName)
protected Projection createProjection(ExecutionContext context, ProjectionParser projectionParser, Node node)
Projection
described by the supplied properties.
context
- the execution context that should be used to read the configuration; may not be nullprojectionParser
- the projection rule parser that should be used; may not be nullnode
- the node where these properties were found; never null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |