org.apache.slide.common
Class XAServiceBase

java.lang.Object
  extended byorg.apache.commons.transaction.util.xa.AbstractXAResource
      extended byorg.apache.slide.common.AbstractXAServiceBase
          extended byorg.apache.slide.common.XAServiceBase
All Implemented Interfaces:
Service, javax.transaction.Status, javax.transaction.xa.XAResource
Direct Known Subclasses:
DefaultIndexer

public class XAServiceBase
extends AbstractXAServiceBase

Slide Service dummy implementation.

Version:
$Revision: 1.3 $

Nested Class Summary
protected  class XAServiceBase.DummyTxResource
           
 
Field Summary
protected  boolean started
           
 
Fields inherited from class org.apache.slide.common.AbstractXAServiceBase
LOG_CHANNEL, loggerFacade, namespace, scope
 
Fields inherited from interface javax.transaction.xa.XAResource
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY
 
Fields inherited from interface javax.transaction.Status
STATUS_ACTIVE, STATUS_COMMITTED, STATUS_COMMITTING, STATUS_MARKED_ROLLBACK, STATUS_NO_TRANSACTION, STATUS_PREPARED, STATUS_PREPARING, STATUS_ROLLEDBACK, STATUS_ROLLING_BACK, STATUS_UNKNOWN
 
Constructor Summary
XAServiceBase()
           
 
Method Summary
 void connect()
          Connects to the underlying data source (if any is needed).
protected  org.apache.commons.transaction.util.xa.TransactionalResource createTransactionResource(javax.transaction.xa.Xid xid)
           
 void disconnect()
          Disconnects from the underlying data source.
 int getTransactionTimeout()
           
protected  boolean includeBranchInXid()
           
 boolean isConnected()
          This function tells whether or not the service is connected.
 boolean isSameRM(javax.transaction.xa.XAResource xares)
           
 javax.transaction.xa.Xid[] recover(int flag)
           
 void reset()
          Deletes service underlying data source, if possible (and meaningful).
 void setParameters(java.util.Hashtable parameters)
          Initializes the service with a set of parameters.
 boolean setTransactionTimeout(int arg0)
           
 
Methods inherited from class org.apache.slide.common.AbstractXAServiceBase
cacheResults, connect, connectIfNeeded, connectIfNeeded, getLogger, getLoggerFacade, initialize, setNamespace, setScope
 
Methods inherited from class org.apache.commons.transaction.util.xa.AbstractXAResource
addAcitveTransactionalResource, addSuspendedTransactionalResource, commit, end, forget, getActiveTransactionalResource, getCurrentlyActiveTransactionalResource, getSuspendedTransactionalResource, getTransactionalResource, prepare, removeActiveTransactionalResource, removeSuspendedTransactionalResource, rollback, setCurrentlyActiveTransactionalResource, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.transaction.xa.XAResource
commit, end, forget, prepare, rollback, start
 

Field Detail

started

protected boolean started
Constructor Detail

XAServiceBase

public XAServiceBase()
Method Detail

setParameters

public void setParameters(java.util.Hashtable parameters)
                   throws ServiceParameterErrorException,
                          ServiceParameterMissingException
Description copied from class: AbstractXAServiceBase
Initializes the service with a set of parameters. Those could be :
  • User name, login info
  • Host name on which to connect
  • Remote port
  • JDBC driver whoich is to be used :-)
  • Anything else ...

    Specified by:
    setParameters in interface Service
    Specified by:
    setParameters in class AbstractXAServiceBase
    Parameters:
    parameters - Hashtable containing the parameters' names and associated values
    Throws:
    ServiceParameterErrorException - Incorrect service parameter
    ServiceParameterMissingException - Service parameter missing

  • connect

    public void connect()
                 throws ServiceConnectionFailedException
    Description copied from class: AbstractXAServiceBase
    Connects to the underlying data source (if any is needed).

    Specified by:
    connect in interface Service
    Specified by:
    connect in class AbstractXAServiceBase
    Throws:
    ServiceConnectionFailedException - Connection failed

    disconnect

    public void disconnect()
                    throws ServiceDisconnectionFailedException
    Description copied from class: AbstractXAServiceBase
    Disconnects from the underlying data source.

    Specified by:
    disconnect in interface Service
    Specified by:
    disconnect in class AbstractXAServiceBase
    Throws:
    ServiceDisconnectionFailedException - Disconnection failed

    reset

    public void reset()
               throws ServiceResetFailedException
    Description copied from class: AbstractXAServiceBase
    Deletes service underlying data source, if possible (and meaningful).

    Specified by:
    reset in interface Service
    Specified by:
    reset in class AbstractXAServiceBase
    Throws:
    ServiceResetFailedException - Reset failed

    isConnected

    public boolean isConnected()
                        throws ServiceAccessException
    Description copied from class: AbstractXAServiceBase
    This function tells whether or not the service is connected.

    Specified by:
    isConnected in interface Service
    Specified by:
    isConnected in class AbstractXAServiceBase
    Returns:
    boolean true if we are connected
    Throws:
    ServiceAccessException - Service access error

    isSameRM

    public boolean isSameRM(javax.transaction.xa.XAResource xares)
                     throws javax.transaction.xa.XAException
    Throws:
    javax.transaction.xa.XAException

    recover

    public javax.transaction.xa.Xid[] recover(int flag)
                                       throws javax.transaction.xa.XAException
    Throws:
    javax.transaction.xa.XAException

    getTransactionTimeout

    public int getTransactionTimeout()
                              throws javax.transaction.xa.XAException
    Throws:
    javax.transaction.xa.XAException

    setTransactionTimeout

    public boolean setTransactionTimeout(int arg0)
                                  throws javax.transaction.xa.XAException
    Throws:
    javax.transaction.xa.XAException

    createTransactionResource

    protected org.apache.commons.transaction.util.xa.TransactionalResource createTransactionResource(javax.transaction.xa.Xid xid)

    includeBranchInXid

    protected boolean includeBranchInXid()