public class JcrXaSession extends JcrSession implements XAResource
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.)
JcrSession.JcrPreSave, JcrSession.SystemSessionCache
repository
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY
ACTION_ADD_NODE, ACTION_READ, ACTION_REMOVE, ACTION_SET_PROPERTY
Modifier | Constructor and Description |
---|---|
protected |
JcrXaSession(JcrRepository repository,
String workspaceName,
ExecutionContext context,
Map<String,Object> sessionAttributes,
boolean readOnly) |
Modifier and Type | Method and Description |
---|---|
void |
commit(Xid xid,
boolean onePhase) |
protected XAResource |
delegate() |
void |
end(Xid xid,
int flags) |
void |
forget(Xid xid) |
int |
getTransactionTimeout() |
boolean |
isSameRM(XAResource xaRes) |
int |
prepare(Xid xid) |
Xid[] |
recover(int flag) |
void |
rollback(Xid xid) |
boolean |
setTransactionTimeout(int seconds) |
void |
start(Xid xid,
int flags) |
addLockToken, checkPermission, createNodeKeyFromIdentifier, decode, encode, entryForNode, exportDocumentView, exportDocumentView, exportSystemView, exportSystemView, getAccessControlManager, getAttribute, getAttributeNames, getImportContentHandler, getItem, getLockTokens, getNamespacePrefix, getNamespacePrefixes, getNamespaceURI, getNode, getNode, getNodeByIdentifier, getNodeByUUID, getNonSystemNodeByIdentifier, getProperty, getRepository, getRetentionManager, getRootNode, getUserID, getValueFactory, getWorkspace, hasCapability, hasPendingChanges, hasPermission, impersonate, importXML, initBaseVersionKeys, initOriginalVersionKeys, isAnonymous, isForeignKey, isForeignKey, isLive, isReadOnly, itemExists, logout, move, nodeExists, nodeExists, nodeIdentifier, nodeIdentifier, propertyExists, readable, readableLocation, refresh, releaseCachedNode, removeItem, removeLockToken, save, sequence, setNamespacePrefix, toString
protected JcrXaSession(JcrRepository repository, String workspaceName, ExecutionContext context, Map<String,Object> sessionAttributes, boolean readOnly)
protected final XAResource delegate()
public void start(Xid xid, int flags) throws XAException
start
in interface XAResource
XAException
public void end(Xid xid, int flags) throws XAException
end
in interface XAResource
XAException
public int prepare(Xid xid) throws XAException
prepare
in interface XAResource
XAException
public void commit(Xid xid, boolean onePhase) throws XAException
commit
in interface XAResource
XAException
public void rollback(Xid xid) throws XAException
rollback
in interface XAResource
XAException
public void forget(Xid xid) throws XAException
forget
in interface XAResource
XAException
public Xid[] recover(int flag) throws XAException
recover
in interface XAResource
XAException
public boolean isSameRM(XAResource xaRes) throws XAException
isSameRM
in interface XAResource
XAException
public int getTransactionTimeout() throws XAException
getTransactionTimeout
in interface XAResource
XAException
public boolean setTransactionTimeout(int seconds) throws XAException
setTransactionTimeout
in interface XAResource
XAException
Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.