JBoss.orgCommunity Documentation
The in-memory repository connector is a simple connector that creates a transient, in-memory repository. This repository is used as a very simple in-memory cache or as a standalone transient repository. This connector works well for a readable and writable repository source with small to moderate sized content that need not be permanently saved.
The InMemoryRepositorySource
class provides a number of JavaBean properties that control its behavior:
Table 11.1. InMemoryRepositorySource
properties
Property | Description |
---|---|
name | The name of the repository source, which is used by the RepositoryService when obtaining a RepositoryConnection by name. |
jndiName | Optional property that, if used, specifies the name in JNDI where an InMemoryRepository instance can be found.
This is an advanced property that is infrequently used. |
rootNodeUuid | Optional property that, if used, defines the UUID of the root node in the in-memory repository. If not used, then a new UUID is generated. |
retryLimit | Optional property that, if used, defines the number of times that any single operation on a RepositoryConnection to this source should be retried following a communication failure. The default value is '0'. |
defaultCachePolicy | Optional property that, if used, defines the default for how long this information provided by this source may to be cached by other, higher-level components. The default value of null implies that this source does not define a specific duration for caching information provided by this repository source. |
defaultWorkspaceName | Optional property that is initialized to an empty string and which defines the name for the workspace that will be used by default if none is specified. |
Using the in-memory connector is used by creating in the JcrConfiguration
a repository source that uses the InMemoryRepositorySource
class.
For example:
JcrConfiguration config = ...
config.repositorySource("source A")
.usingClass(InMemoryRepositorySource.class)
.setDescription("The repository for our content")
.setProperty("defaultWorkspaceName", workspaceName);