org.modeshape.jcr
Class JcrXaSession
java.lang.Object
org.modeshape.jcr.JcrSession
org.modeshape.jcr.JcrXaSession
- All Implemented Interfaces:
- Session, XAResource
public class JcrXaSession
- extends JcrSession
- implements XAResource
An extension of JcrSession that is also an XAResource, enabling clients to explicitly enlist the session in the
transaction.
This implementation simply delegates to the Infinispan cache's XAResource instance, since
ModeShape does not need to itself be a resource that participates in the transaction. (Instead, ModeShape registers as a
Synchronization on the transaction, ensuring that it is notified when the transaction completes.)
| Fields inherited from interface javax.transaction.xa.XAResource |
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY |
| Methods inherited from class org.modeshape.jcr.JcrSession |
addLockToken, checkPermission, createNodeKeyFromIdentifier, entryForNode, exportDocumentView, exportDocumentView, exportSystemView, exportSystemView, getAccessControlManager, getAttribute, getAttributeNames, getImportContentHandler, getItem, getLockTokens, getNamespacePrefix, getNamespacePrefixes, getNamespaceURI, getNode, getNodeByIdentifier, getNodeByUUID, getNonSystemNodeByIdentifier, getProperty, getRepository, getRetentionManager, getRootNode, getUserID, getValueFactory, getWorkspace, hasCapability, hasPendingChanges, hasPermission, impersonate, importXML, initBaseVersionKeys, initOriginalVersionKeys, isAnonymous, isForeignKey, isForeignKey, isLive, itemExists, logout, move, nodeExists, nodeExists, nodeIdentifier, nodeIdentifier, propertyExists, readable, readableLocation, refresh, removeItem, removeLockToken, save, setNamespacePrefix, toString |
JcrXaSession
protected JcrXaSession(JcrRepository repository,
String workspaceName,
ExecutionContext context,
Map<String,Object> sessionAttributes,
boolean readOnly)
delegate
protected final XAResource delegate()
start
public void start(Xid xid,
int flags)
throws XAException
- Specified by:
start in interface XAResource
- Throws:
XAException
end
public void end(Xid xid,
int flags)
throws XAException
- Specified by:
end in interface XAResource
- Throws:
XAException
prepare
public int prepare(Xid xid)
throws XAException
- Specified by:
prepare in interface XAResource
- Throws:
XAException
commit
public void commit(Xid xid,
boolean onePhase)
throws XAException
- Specified by:
commit in interface XAResource
- Throws:
XAException
rollback
public void rollback(Xid xid)
throws XAException
- Specified by:
rollback in interface XAResource
- Throws:
XAException
forget
public void forget(Xid xid)
throws XAException
- Specified by:
forget in interface XAResource
- Throws:
XAException
recover
public Xid[] recover(int flag)
throws XAException
- Specified by:
recover in interface XAResource
- Throws:
XAException
isSameRM
public boolean isSameRM(XAResource xaRes)
throws XAException
- Specified by:
isSameRM in interface XAResource
- Throws:
XAException
getTransactionTimeout
public int getTransactionTimeout()
throws XAException
- Specified by:
getTransactionTimeout in interface XAResource
- Throws:
XAException
setTransactionTimeout
public boolean setTransactionTimeout(int seconds)
throws XAException
- Specified by:
setTransactionTimeout in interface XAResource
- Throws:
XAException
Copyright © 2008-2013 JBoss, a division of Red Hat. All Rights Reserved.