|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.modeshape.connector.infinispan.BaseInfinispanSource
@ThreadSafe public abstract class BaseInfinispanSource
A repository source that uses an Infinispan instance to manage the content. This source is capable of using an existing
CacheContainer
or creating a new cache container. This process is controlled entirely by the JavaBean properties of the
InfinispanSource instance.
Field Summary | |
---|---|
protected static String |
ALLOW_CREATING_WORKSPACES
|
protected static String |
DEFAULT_CACHE_POLICY
|
static String |
DEFAULT_NAME_OF_DEFAULT_WORKSPACE
The initial name of the default workspace is ""default" ", unless otherwise specified. |
static int |
DEFAULT_RETRY_LIMIT
The default limit is 0 for retrying connection calls to the underlying source. |
static String |
DEFAULT_ROOT_NODE_UUID
The default limit is "cafebabe-cafe-babe-cafe-babecafebabe" for the root node's UUID. |
static boolean |
DEFAULT_UPDATES_ALLOWED
The initial value for whether updates are allowed is "true ", unless otherwise specified. |
protected static String |
DEFAULT_WORKSPACE
|
protected static String |
PREDEFINED_WORKSPACE_NAMES
|
protected static String |
RETRY_LIMIT
|
protected static String |
ROOT_NODE_UUID
|
protected static String |
SOURCE_NAME
|
protected static String |
UPDATES_ALLOWED
|
Constructor Summary | |
---|---|
BaseInfinispanSource()
Create a repository source instance. |
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. |
protected abstract org.infinispan.manager.CacheContainer |
createCacheContainer()
Method controls how a cache container gets created. |
RepositorySourceCapabilities |
getCapabilities()
Get the capabilities for this source. |
RepositoryConnection |
getConnection()
Get a connection from this source. |
protected Context |
getContext()
|
CachePolicy |
getDefaultCachePolicy()
Get the default cache policy for this source, or null if the global default cache policy should be used |
String |
getDefaultWorkspaceName()
Get the name of the default workspace. |
String |
getName()
Get the name for this repository source. |
protected Observer |
getObserver()
|
String[] |
getPredefinedWorkspaceNames()
Gets the names of the workspaces that are available when this source is created. |
Reference |
getReference()
|
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 of the root node for the cache. |
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 dynamically. |
protected void |
setContext(Context context)
|
void |
setCreatingWorkspacesAllowed(boolean allowWorkspaceCreation)
Set whether this source allows workspaces to be created dynamically. |
void |
setDefaultCachePolicy(CachePolicy defaultCachePolicy)
|
void |
setDefaultWorkspaceName(String nameOfDefaultWorkspace)
Set the name of the workspace that should be used when clients don't specify a workspace. |
void |
setName(String name)
Set the name of this source |
void |
setPredefinedWorkspaceNames(String[] predefinedWorkspaceNames)
Sets the names of the workspaces that are available when this source is created. |
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 |
setUpdatesAllowed(boolean updatesAllowed)
Set whether this source allows updates to data within workspaces |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.naming.spi.ObjectFactory |
---|
getObjectInstance |
Field Detail |
---|
public static final int DEFAULT_RETRY_LIMIT
connection
calls to the underlying source.
public static final String DEFAULT_ROOT_NODE_UUID
public static final String DEFAULT_NAME_OF_DEFAULT_WORKSPACE
name of the default workspace
is ""default" ", unless otherwise specified.
public static final boolean DEFAULT_UPDATES_ALLOWED
protected static final String ROOT_NODE_UUID
protected static final String SOURCE_NAME
protected static final String DEFAULT_CACHE_POLICY
protected static final String RETRY_LIMIT
protected static final String DEFAULT_WORKSPACE
protected static final String PREDEFINED_WORKSPACE_NAMES
protected static final String ALLOW_CREATING_WORKSPACES
protected static final String UPDATES_ALLOWED
Constructor Detail |
---|
public BaseInfinispanSource()
Method Detail |
---|
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 String getName()
getName
in interface RepositorySource
public RepositorySourceCapabilities getCapabilities()
getCapabilities
in interface RepositorySource
RepositorySource.getCapabilities()
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 void setName(String name)
name
- the name for this sourcepublic CachePolicy getDefaultCachePolicy()
getDefaultCachePolicy
in interface BaseRepositorySource
public void setDefaultCachePolicy(CachePolicy defaultCachePolicy)
defaultCachePolicy
- Sets defaultCachePolicy to the specified value.public String getRootNodeUuid()
public UUID getRootNodeUuidObject()
getRootNodeUuidObject
in interface BaseRepositorySource
public void setRootNodeUuid(String rootNodeUuid)
rootNodeUuid
- the UUID of the root node for the cache, or null if the UUID should be randomly generatedpublic String getDefaultWorkspaceName()
getDefaultWorkspaceName
in interface BaseRepositorySource
public void setDefaultWorkspaceName(String nameOfDefaultWorkspace)
nameOfDefaultWorkspace
- the name of the workspace that should be used by default, or null if the
default name
should be usedpublic String[] getPredefinedWorkspaceNames()
setPredefinedWorkspaceNames(String[])
,
setCreatingWorkspacesAllowed(boolean)
public void setPredefinedWorkspaceNames(String[] predefinedWorkspaceNames)
predefinedWorkspaceNames
- the names of the workspaces that this source should start with, or null if there are no
such workspacessetCreatingWorkspacesAllowed(boolean)
,
getPredefinedWorkspaceNames()
public boolean isCreatingWorkspacesAllowed()
isCreatingWorkspacesAllowed
in interface BaseRepositorySource
set of workspaces
is fixedsetPredefinedWorkspaceNames(String[])
,
getPredefinedWorkspaceNames()
,
setCreatingWorkspacesAllowed(boolean)
public void setCreatingWorkspacesAllowed(boolean allowWorkspaceCreation)
allowWorkspaceCreation
- true if this source allows workspaces to be created by clients, or false if the
set of workspaces
is fixedsetPredefinedWorkspaceNames(String[])
,
getPredefinedWorkspaceNames()
,
isCreatingWorkspacesAllowed()
protected abstract org.infinispan.manager.CacheContainer createCacheContainer()
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 RepositoryContext getRepositoryContext()
BaseRepositorySource
repository context
for the repository source
getRepositoryContext
in interface BaseRepositorySource
protected Observer getObserver()
protected Context getContext()
protected void setContext(Context context)
public boolean areUpdatesAllowed()
BaseRepositorySource
areUpdatesAllowed
in interface BaseRepositorySource
BaseRepositorySource.setUpdatesAllowed(boolean)
public void setUpdatesAllowed(boolean updatesAllowed)
BaseRepositorySource
setUpdatesAllowed
in interface BaseRepositorySource
updatesAllowed
- true if this source allows updates to data within workspaces clients, or false if updates are not
allowed.BaseRepositorySource.areUpdatesAllowed()
public RepositoryConnection getConnection() throws RepositorySourceException
getConnection
in interface RepositorySource
RepositorySourceException
- if there is a problem obtaining a connectionRepositorySource.getConnection()
public Reference getReference()
getReference
in interface Referenceable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |