JBoss.orgCommunity Documentation

Chapter 16. Infinispan Connector

The Infinispan repository connector allows a Infinispan instance to be used as a JBoss DNA (and thus JCR) repository. This provides a way for the content in a repository to be stored in an effective, scalable, and distributed data grid. Like other connectors, this can be paired with other repository sources to provide a local or federated repository.

The InfinispanSource class provides a number of JavaBean properties that control its behavior:

Table 16.1. InfinispanSource properties

PropertyDescription
nameThe name of the repository source, which is used by the RepositoryService when obtaining a RepositoryConnection by name.
cacheManagerJndiNameOptional property that, if used, specifies the name in JNDI where an existing Infinispan Cache Manager instance can be found. That factory would then be used if needed to create an Infinispan Cache instance. If no value is provided, then the Infinispan DefaultCacheManager class is used.
cacheConfigurationNameOptional property that, if used, specifies the name of the configuration that is supplied to the cache manager when creating a new Infinispan CacheManager instance.
defaultCachePolicyOptional 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.
defaultWorkspaceNameOptional 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.
predefinedWorkspaceNamesOptional property that defines the names of the workspaces that exist and that are available for use without having to create them.
retryLimitOptional 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'.
rootNodeUuidOptional property that, if used, specifies the UUID that should be used for the root node of each workspace. If no value is specified, a random UUID is generated each time that the repository is started.

The Infinispan connector is used by creating in the JcrConfiguration a repository source that uses the InfinispanSource class. For example:



JcrConfiguration config = ...
config.repositorySource("source A")
      .usingClass(InfinispanSource.class)
      .setDescription("The repository for our content")
      .setProperty("defaultWorkspaceName", "prod")
      .setProperty("rootNodeUuid", UUID.fromString("84b73fc8-81a8-42ed-aa4b-3905094966f0")
      .setProperty("predefinedWorkspaceNames", new String[] { "staging", "dev"});