org.modeshape.connector.jbosscache
Class JBossCacheRepository

java.lang.Object
  extended by org.modeshape.graph.connector.base.Repository<JBossCacheNode,JBossCacheWorkspace>
      extended by org.modeshape.connector.jbosscache.JBossCacheRepository

@ThreadSafe
public class JBossCacheRepository
extends Repository<JBossCacheNode,JBossCacheWorkspace>

The representation of an in-memory repository and its content.


Field Summary
 
Fields inherited from class org.modeshape.graph.connector.base.Repository
context, rootNodeUuid, source
 
Constructor Summary
JBossCacheRepository(JBossCacheSource source, org.jboss.cache.Cache<UUID,JBossCacheNode> cache)
           
 
Method Summary
 org.jboss.cache.Cache<UUID,JBossCacheNode> getCache()
           
 Set<String> getWorkspaceNames()
          Get the names of the available workspaces that have been loaded.
 void shutdown()
          This method shuts down the workspace and makes it no longer usable.
 JBossCacheTransaction startTransaction(ExecutionContext context, boolean readonly)
          Begin a transaction, hinting whether the transaction will be used only to read the content.
 
Methods inherited from class org.modeshape.graph.connector.base.Repository
createRequestProcessor, createWorkspace, destroyWorkspace, getContext, getDefaultWorkspaceName, getRootNodeUuid, getSourceName, getWorkspace, initialize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JBossCacheRepository

public JBossCacheRepository(JBossCacheSource source,
                            org.jboss.cache.Cache<UUID,JBossCacheNode> cache)
Method Detail

getWorkspaceNames

public Set<String> getWorkspaceNames()
Get the names of the available workspaces that have been loaded.

Overrides:
getWorkspaceNames in class Repository<JBossCacheNode,JBossCacheWorkspace>
Returns:
the immutable names of the workspaces.
See Also:
Repository.getWorkspaceNames()

getCache

public org.jboss.cache.Cache<UUID,JBossCacheNode> getCache()
Returns:
cache

shutdown

public void shutdown()
This method shuts down the workspace and makes it no longer usable. This method should also only be called once.


startTransaction

public JBossCacheTransaction startTransaction(ExecutionContext context,
                                              boolean readonly)
Begin a transaction, hinting whether the transaction will be used only to read the content. If this is called, then the transaction must be either committed or rolled back.

Specified by:
startTransaction in class Repository<JBossCacheNode,JBossCacheWorkspace>
Parameters:
context - the context in which the transaction is to be performed; may not be null
readonly - true if the transaction will not modify any content, or false if changes are to be made
Returns:
the transaction; never null
See Also:
Repository.startTransaction(org.modeshape.graph.ExecutionContext, boolean)


Copyright © 2008-2012 JBoss, a division of Red Hat. All Rights Reserved.