org.jboss.jms.recovery
Class XAResourceWrapper

java.lang.Object
  extended by org.jboss.jms.recovery.XAResourceWrapper
All Implemented Interfaces:
javax.jms.ExceptionListener, XAResource

public class XAResourceWrapper
extends Object
implements XAResource, javax.jms.ExceptionListener

XAResourceWrapper.

Version:
$Revision: 57209 $
Author:
Adrian Brock

Field Summary
 
Fields inherited from interface javax.transaction.xa.XAResource
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY
 
Constructor Summary
XAResourceWrapper()
           
 
Method Summary
protected  XAException check(XAException e)
          Check whether an XAException is fatal.
 void close()
          Close the connection
 void commit(Xid xid, boolean onePhase)
           
protected  XAResource connect()
          Connect to the server if not already done so
 void end(Xid xid, int flags)
           
protected  void finalize()
           
 void forget(Xid xid)
           
protected  javax.jms.XAConnectionFactory getConnectionFactory()
          Get the XAConnectionFactory
 XAResource getDelegate()
          Get the delegate XAResource
 String getProviderName()
          Get the providerName.
 int getTransactionTimeout()
           
 boolean isSameRM(XAResource xaRes)
           
 void onException(javax.jms.JMSException exception)
           
 int prepare(Xid xid)
           
 Xid[] recover(int flag)
           
 void rollback(Xid xid)
           
 void setProviderName(String providerName)
          Set the providerName.
 boolean setTransactionTimeout(int seconds)
           
 void start(Xid xid, int flags)
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XAResourceWrapper

public XAResourceWrapper()
Method Detail

getProviderName

public String getProviderName()
Get the providerName.

Returns:
the providerName.

setProviderName

public void setProviderName(String providerName)
Set the providerName.

Parameters:
providerName - the providerName.

recover

public Xid[] recover(int flag)
              throws XAException
Specified by:
recover 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

isSameRM

public boolean isSameRM(XAResource xaRes)
                 throws XAException
Specified by:
isSameRM in interface XAResource
Throws:
XAException

prepare

public int prepare(Xid xid)
            throws XAException
Specified by:
prepare in interface XAResource
Throws:
XAException

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

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

onException

public void onException(javax.jms.JMSException exception)
Specified by:
onException in interface javax.jms.ExceptionListener

getDelegate

public XAResource getDelegate()
                       throws XAException
Get the delegate XAResource

Returns:
the delegate
Throws:
XAException - for any problem

connect

protected XAResource connect()
                      throws Exception
Connect to the server if not already done so

Returns:
the delegate XAResource
Throws:
Exception - for any problem

getConnectionFactory

protected javax.jms.XAConnectionFactory getConnectionFactory()
                                                      throws Exception
Get the XAConnectionFactory

Returns:
the connection
Throws:
Exception - for any problem

close

public void close()
Close the connection


check

protected XAException check(XAException e)
                     throws XAException
Check whether an XAException is fatal. If it is an RM problem we close the connection so the next call will reconnect.

Parameters:
e - the xa exception
Returns:
never
Throws:
XAException - always

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.