|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.modeshape.graph.connector.path.AbstractPathRepositorySource
@ThreadSafe public abstract class AbstractPathRepositorySource
Basic implementation of the trivial PathRepositorySource
methods and the path
repository cache life cycle
.
Field Summary | |
---|---|
protected PathCachePolicy |
cachePolicy
|
static PathCachePolicy |
DEFAULT_CACHE_POLICY
The default cache policy for this repository source (no caching) |
static int |
DEFAULT_RETRY_LIMIT
The default number of times that a request that failed due to system error should be retried |
static String |
DEFAULT_ROOT_NODE_UUID
The default UUID that is used for root nodes in a store. |
protected String |
name
|
protected RepositoryContext |
repositoryContext
|
protected int |
retryLimit
|
protected UUID |
rootNodeUuid
|
Constructor Summary | |
---|---|
AbstractPathRepositorySource()
|
Method Summary | |
---|---|
boolean |
areUpdatesAllowed()
Get whether this source allows updates. |
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. |
PathCachePolicy |
getCachePolicy()
Returns the cache policy for the repository source |
String |
getName()
Get the name for this repository source. |
PathRepositoryCache |
getPathRepositoryCache()
|
RepositoryContext |
getRepositoryContext()
Returns the repository context for the 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. |
UUID |
getRootNodeUuid()
Get the UUID that is used for the root node of each workspace |
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 . |
void |
setCachePolicy(PathCachePolicy cachePolicy)
Sets the cache policy for the repository and replaces the path repository cache with a new path repository cache tied to the new cache policy |
void |
setName(String name)
Sets the name of the repository source. |
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. |
void |
setRootNodeUuid(String rootNodeUuid)
|
protected Map<String,Object> |
valuesFrom(Reference ref)
Extracts the values from the given reference, automatically translating BinaryRefAddr instances into the
deserialized classes that they represent. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.modeshape.graph.connector.path.PathRepositorySource |
---|
getDefaultWorkspaceName, setUpdatesAllowed |
Methods inherited from interface org.modeshape.graph.connector.RepositorySource |
---|
getCapabilities, getConnection |
Methods inherited from interface javax.naming.Referenceable |
---|
getReference |
Field Detail |
---|
public static final String DEFAULT_ROOT_NODE_UUID
public static final int DEFAULT_RETRY_LIMIT
public static final PathCachePolicy DEFAULT_CACHE_POLICY
protected int retryLimit
protected String name
protected transient RepositoryContext repositoryContext
protected transient UUID rootNodeUuid
protected transient PathCachePolicy cachePolicy
Constructor Detail |
---|
public AbstractPathRepositorySource()
Method Detail |
---|
public boolean areUpdatesAllowed()
areUpdatesAllowed
in interface PathRepositorySource
PathRepositorySource.areUpdatesAllowed()
public RepositoryContext getRepositoryContext()
repository context
for the repository source
getRepositoryContext
in interface PathRepositorySource
repository context
for the repository sourcePathRepositorySource.getRepositoryContext()
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(RepositoryContext)
public PathCachePolicy getCachePolicy()
cache policy
for the repository source
getCachePolicy
in interface PathRepositorySource
cache policy
for the repository sourcePathRepositorySource.getCachePolicy()
public void setCachePolicy(PathCachePolicy cachePolicy)
cachePolicy
- the new cache policy; may not be nullpublic UUID getRootNodeUuid()
PathRepositorySource
getRootNodeUuid
in interface PathRepositorySource
public void setRootNodeUuid(String rootNodeUuid)
rootNodeUuid
- Sets rootNodeUuid to the specified value.
IllegalArgumentException
- if the string value cannot be converted to UUIDpublic 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 String getName()
getName
in interface RepositorySource
RepositorySource.getName()
public void setName(String name)
name
- the new name for the repository source; may not be emptypublic 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 limit)
protected Map<String,Object> valuesFrom(Reference ref) throws IOException, ClassNotFoundException
BinaryRefAddr
instances into the
deserialized classes that they represent.
ref
- the reference from which the values should be extracted
IOException
- if there is an error deserializing a BinaryRefAddr
ClassNotFoundException
- if a serialized class cannot be deserialized because its class is not in the classpathpublic PathRepositoryCache getPathRepositoryCache()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |