|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.modeshape.graph.connector.base.AbstractRepositorySource
public abstract class AbstractRepositorySource
Basic implementation of BaseRepositorySource
, providing default implementations of the accessors and mutators in that
interface.
Field Summary | |
---|---|
protected CachePolicy |
cachePolicy
|
static CachePolicy |
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 RepositoryContext |
repositoryContext
|
protected int |
retryLimit
|
protected UUID |
rootNodeUuid
|
Constructor Summary | |
---|---|
AbstractRepositorySource()
|
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. |
CachePolicy |
getDefaultCachePolicy()
Returns the cache policy for the repository source |
String |
getName()
Get the name for this repository source. |
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. |
String |
getRootNodeUuid()
Get the UUID of the root node for the cache. |
UUID |
getRootNodeUuidObject()
Get the UUID for the root node. |
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 . |
boolean |
isCreatingWorkspacesAllowed()
Get whether this source allows workspaces to be created. |
void |
setCachePolicy(CachePolicy 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)
Set the UUID of the root node in this repository. |
void |
setRootNodeUuidObject(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.base.BaseRepositorySource |
---|
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 CachePolicy DEFAULT_CACHE_POLICY
@Description(i18n=GraphI18n.class, value="retryLimitPropertyDescription") @Label(i18n=GraphI18n.class, value="retryLimitPropertyLabel") @Category(i18n=GraphI18n.class, value="retryLimitPropertyCategory") protected int retryLimit
@Description(i18n=GraphI18n.class, value="rootNodeUuidWithDefaultPropertyDescription") @Label(i18n=GraphI18n.class, value="rootNodeUuidPropertyLabel") @Category(i18n=GraphI18n.class, value="rootNodeUuidPropertyCategory") protected transient UUID rootNodeUuid
protected transient RepositoryContext repositoryContext
protected transient CachePolicy cachePolicy
Constructor Detail |
---|
public AbstractRepositorySource()
Method Detail |
---|
public boolean areUpdatesAllowed()
areUpdatesAllowed
in interface BaseRepositorySource
BaseRepositorySource.areUpdatesAllowed()
public boolean isCreatingWorkspacesAllowed()
isCreatingWorkspacesAllowed
in interface BaseRepositorySource
BaseRepositorySource.isCreatingWorkspacesAllowed()
public RepositoryContext getRepositoryContext()
repository context
for the repository source
getRepositoryContext
in interface BaseRepositorySource
repository context
for the repository sourceBaseRepositorySource.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 CachePolicy getDefaultCachePolicy()
cache policy
for the repository source
getDefaultCachePolicy
in interface BaseRepositorySource
cache policy
for the repository sourceBaseRepositorySource.getDefaultCachePolicy()
public void setCachePolicy(CachePolicy cachePolicy)
cachePolicy
- the new cache policy; may not be nullpublic UUID getRootNodeUuidObject()
getRootNodeUuidObject
in interface BaseRepositorySource
BaseRepositorySource.getRootNodeUuidObject()
public void setRootNodeUuidObject(String rootNodeUuid)
rootNodeUuid
- Sets rootNodeUuid to the specified value.
IllegalArgumentException
- if the string value cannot be converted to UUIDpublic String getRootNodeUuid()
public void setRootNodeUuid(String rootNodeUuid)
rootNodeUuid
- the UUID of the root node for the cache, or null if the UUID should be randomly generatedpublic 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 class path
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |