org.modeshape.connector.jbosscache
Class JBossCacheTransaction
java.lang.Object
org.modeshape.graph.connector.base.BaseTransaction<NodeType,WorkspaceType>
org.modeshape.graph.connector.base.MapTransaction<JBossCacheNode,JBossCacheWorkspace>
org.modeshape.connector.jbosscache.JBossCacheTransaction
- All Implemented Interfaces:
- Transaction<JBossCacheNode,JBossCacheWorkspace>
@NotThreadSafe
public class JBossCacheTransaction
- extends MapTransaction<JBossCacheNode,JBossCacheWorkspace>
Methods inherited from class org.modeshape.graph.connector.base.MapTransaction |
addChild, addChild, cloneNode, copyBranch, copyNode, destroyNode, findLatest, findNode, getChangesFor, getChild, getChildren, getChildrenLocations, getNode, getParent, getUuidsUnderNode, print, query, removeAllChildren, removeNode, removeProperty, search, setProperties, verifyNodeExists |
Methods inherited from class org.modeshape.graph.connector.base.BaseTransaction |
getContext, getFirstChild, getNode, getRepository, getRootLocation, getRootNode, getRootUuid, lockNode, pathFor, readable, unlockNode |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JBossCacheTransaction
protected JBossCacheTransaction(ExecutionContext context,
JBossCacheRepository repository,
UUID rootNodeUuid,
Lock lock)
getWorkspaceNames
public Set<String> getWorkspaceNames()
- Get the names of the existing workspaces.
- Specified by:
getWorkspaceNames
in interface Transaction<JBossCacheNode,JBossCacheWorkspace>
- Overrides:
getWorkspaceNames
in class BaseTransaction<JBossCacheNode,JBossCacheWorkspace>
- Returns:
- the immutable set of workspace names; never null
- See Also:
Transaction.getWorkspaceNames()
getWorkspace
public JBossCacheWorkspace getWorkspace(String name,
JBossCacheWorkspace originalToClone)
- Creates a new workspace with the given name containing only a root node. If the workspace already exists, it is left
untouched and returned.
- Parameters:
name
- the name of the workspace; may not be nulloriginalToClone
- the workspace that should be cloned, or null if the new workspace is to only contain a root node
- Returns:
- the newly created workspace; may not be null
- See Also:
Transaction.getWorkspace(java.lang.String,
org.modeshape.graph.connector.base.Workspace)
destroyWorkspace
public boolean destroyWorkspace(JBossCacheWorkspace workspace)
- Destroy the workspace with the supplied name.
- Parameters:
workspace
- the workspace that is to be destroyed; may not be null
- Returns:
- true if the workspace was destroyed, or false if the workspace did not exist
- See Also:
Transaction.destroyWorkspace(org.modeshape.graph.connector.base.Workspace)
createNode
protected JBossCacheNode createNode(UUID uuid,
Path.Segment name,
UUID parentUuid,
Iterable<Property> properties)
- Create a new instance of the node, given the supplied UUID. This method should do nothing but instantiate the new node; the
caller will add to the appropriate maps.
- Overrides:
createNode
in class MapTransaction<JBossCacheNode,JBossCacheWorkspace>
- Parameters:
uuid
- the desired UUID; never nullname
- the name of the new node; may be null if the name is not knownparentUuid
- the UUID of the parent node; may be null if this is the root nodeproperties
- the properties; may be null if there are no properties
- Returns:
- the new node; never null
- See Also:
MapTransaction.createNode(java.util.UUID,
org.modeshape.graph.property.Path.Segment, java.util.UUID, java.lang.Iterable)
commit
public void commit()
- Commit any changes that have been made to the repository. This method may throw runtime exceptions if there are failures
committing the changes, but the transaction is still expected to be closed.
- Specified by:
commit
in interface Transaction<JBossCacheNode,JBossCacheWorkspace>
- Overrides:
commit
in class MapTransaction<JBossCacheNode,JBossCacheWorkspace>
- See Also:
Transaction.commit()
rollback
public void rollback()
- Rollback any changes that have been made to this repository. This method may throw runtime exceptions if there are failures
rolling back the changes, but the transaction is still expected to be closed.
- Specified by:
rollback
in interface Transaction<JBossCacheNode,JBossCacheWorkspace>
- Overrides:
rollback
in class MapTransaction<JBossCacheNode,JBossCacheWorkspace>
- See Also:
Transaction.rollback()
Copyright © 2008-2010 JBoss, a division of Red Hat. All Rights Reserved.