public XAResource wrap(final XAResource xaResource, final String name) { return new WrapperNamedXAResource(xaResource, name); } }
private String decodeFlags(int flags) { if (flags == 0) { return " TMNOFLAGS"; } StringBuilder b = new StringBuilder(); decodeFlag(flags, b, TMENDRSCAN, " TMENDRSCAN"); decodeFlag(flags, b, TMFAIL, " TMFAIL"); decodeFlag(flags, b, TMJOIN, " TMJOIN"); decodeFlag(flags, b, TMONEPHASE, " TMONEPHASE"); decodeFlag(flags, b, TMRESUME, " TMRESUME"); decodeFlag(flags, b, TMSTARTRSCAN, " TMSTARTRSCAN"); decodeFlag(flags, b, TMSUCCESS, " TMSUCCESS"); decodeFlag(flags, b, TMSUSPEND, " TMSUSPEND"); if (flags != 0) { b.append(" remaining: ").append(flags); } return b.toString(); }
public Xid[] recover(int flag) throws XAException { if (log.isTraceEnabled()) { log.trace("Recover called on XAResource " + getName() + "\n flags: " + decodeFlags(flag)); } return xaResource.recover(flag); }
public int prepare(Xid xid) throws XAException { if (log.isTraceEnabled()) { log.trace("Prepare called on XAResource " + getName() + "\n Xid: " + xid); } return xaResource.prepare(xid); }
public void commit(Xid xid, boolean onePhase) throws XAException { if (log.isTraceEnabled()) { log.trace("Commit called on XAResource " + getName() + "\n Xid: " + xid + "\n onePhase:" + onePhase); } xaResource.commit(xid, onePhase); }
public XAResource wrap(final XAResource xaResource, final String name) { return new WrapperNamedXAResource(xaResource, name); } }
public void start(Xid xid, int flags) throws XAException { if (log.isTraceEnabled()) { log.trace("Start called on XAResource " + getName() + "\n Xid: " + xid + "\n flags:" + decodeFlags(flags)); } xaResource.start(xid, flags); } private String decodeFlags(int flags) {
public void forget(Xid xid) throws XAException { if (log.isTraceEnabled()) { log.trace("Forget called on XAResource " + getName() + "\n Xid: " + xid); } xaResource.forget(xid); }
public XAResource wrap(XAResource xaResource, String name) { return new WrapperNamedXAResource(xaResource, name); } }
public void end(Xid xid, int flags) throws XAException { if (log.isTraceEnabled()) { log.trace("End called on XAResource " + getName() + "\n Xid: " + xid + "\n flags:" + decodeFlags(flags)); } xaResource.end(xid, flags); }
public void rollback(Xid xid) throws XAException { if (log.isTraceEnabled()) { log.trace("Rollback called on XAResource " + getName() + "\n Xid: " + xid); } xaResource.rollback(xid); }
/** * {@link XAResource} instances must be named to support recovery, so either pass * {@link NamedXAResource} instances through or wrap with the Spring name. * * @param xaResource * @return the wrapped XAResource instance */ protected XAResource wrapXAResource(XAResource xaResource) { String name = getName(); if (xaResource instanceof NamedXAResource || name == null) { return xaResource; } return new WrapperNamedXAResource(xaResource, name); }
@Override protected XAResource createXaResource(PooledSession session) throws JMSException { XAResource xares = ((XASession)session.getInternalSession()).getXAResource(); if (name != null) { xares = new WrapperNamedXAResource(xares, name); } return xares; } }
@Override protected XAResource createXaResource(PooledSession session) throws JMSException { XAResource xares = ((XASession)session.getInternalSession()).getXAResource(); if (name != null) { xares = new WrapperNamedXAResource(xares, name); } return xares; } }
protected XAResource createXaResource(PooledSession session) throws JMSException { XAResource xares = new LocalAndXATransaction(session.getSession().getTransactionContext()); if (name != null) { xares = new WrapperNamedXAResource(xares, name); } return xares; }
public NamedXAResource getNamedXAResource() throws SystemException { try { XAResource[] xaResources = resourceAdapter.getXAResources(new ActivationSpec[]{activationSpec}); if (xaResources == null || xaResources.length == 0 || xaResources[0] == null) { return null; } return new WrapperNamedXAResource(xaResources[0], name); } catch (ResourceException e) { throw (SystemException) new SystemException("Could not get XAResource for recovery for mdb: " + name).initCause(e); } }
public void getConnection(ConnectionInfo connectionInfo) throws ResourceException { next.getConnection(connectionInfo); ManagedConnectionInfo mci = connectionInfo.getManagedConnectionInfo(); mci.setXAResource(new WrapperNamedXAResource(mci.getManagedConnection().getXAResource(), name)); }