org.objectweb.jonas.jtm
Class TransactionServiceImpl

java.lang.Object
  extended byjavax.management.NotificationBroadcasterSupport
      extended byorg.objectweb.jonas.management.ReconfigDispatcher
          extended byorg.objectweb.jonas.service.AbsServiceImpl
              extended byorg.objectweb.jonas.jtm.TransactionServiceImpl
All Implemented Interfaces:
javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, ReconfigDispatcherMBean, Service, TransactionService, TransactionServiceImplMBean

public class TransactionServiceImpl
extends AbsServiceImpl
implements TransactionService, TransactionServiceImplMBean

Transaction Service implementation. This singleton class must exist in each jonas server. This class manages a unique Current object that implements both TransactionManager and UserTransaction interfaces.

Author:
Philippe Durieux Contributor(s): Adriana Danes

Field Summary
static java.lang.String SERVICE_NAME
          Service name as used to label configuration properties
 
Fields inherited from class org.objectweb.jonas.management.ReconfigDispatcher
RECONFIG_TYPE, SAVE_RECONFIG_TYPE
 
Constructor Summary
TransactionServiceImpl()
           
 
Method Summary
 void doInit(javax.naming.Context ctx)
          Init the Service.
 void doStart()
          Start the Service Initialization of the service is already done.
 void doStop()
          Stop the transaction service Not already implementated
 org.objectweb.jotm.Current getCurrent()
          Gets the Current object instance
protected  int getTotalBegunTransactions()
          Get begun transactions number
protected  int getTotalCommittedTransactions()
          Get committed transactions number
protected  int getTotalCurrentTransactions()
          Get current transactions number
protected  int getTotalExpiredTransactions()
          Get expired transactions number
protected  int getTotalRolledbackTransactions()
          Get rollebacked transactions number
 org.objectweb.jotm.TransactionFactory getTransactionFactory()
          Gets the TransactionFactory object (JTM factory)
 org.objectweb.transaction.jta.TransactionManager getTransactionManager()
          Gets the TransactionManager object instance
 javax.transaction.UserTransaction getUserTransaction()
          Gets the UserTransaction object instance
protected  void resetAllTxTotalCounters()
          Reset all transaction counters
 void setTimeout(int t)
          Sets the default transaction timeout and register Current in JNDI
 
Methods inherited from class org.objectweb.jonas.service.AbsServiceImpl
getDomainName, getJonasServerName, getName, init, isStarted, setName, start, stop
 
Methods inherited from class org.objectweb.jonas.management.ReconfigDispatcher
addNotificationListener, getFilter, getHandback, getListener, getNotificationInfo, initLogger, removeNotificationListener, sendReconfigNotification, sendSaveNotification
 
Methods inherited from class javax.management.NotificationBroadcasterSupport
handleNotification, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.jonas.service.Service
getName, init, isStarted, setName, start, stop
 

Field Detail

SERVICE_NAME

public static final java.lang.String SERVICE_NAME
Service name as used to label configuration properties

See Also:
Constant Field Values
Constructor Detail

TransactionServiceImpl

public TransactionServiceImpl()
Method Detail

doInit

public void doInit(javax.naming.Context ctx)
            throws ServiceException
Init the Service. Configuration information is passed thru a Context object.

Specified by:
doInit in class AbsServiceImpl
Parameters:
ctx - naming context containing configuration parameters
Throws:
ServiceException - if service initialization failes

doStart

public void doStart()
             throws ServiceException
Start the Service Initialization of the service is already done.

Specified by:
doStart in class AbsServiceImpl
Throws:
ServiceException - if service start fails

doStop

public void doStop()
            throws ServiceException
Stop the transaction service Not already implementated

Specified by:
doStop in class AbsServiceImpl
Throws:
ServiceException - if the service stop fails

getCurrent

public org.objectweb.jotm.Current getCurrent()
Gets the Current object instance

Specified by:
getCurrent in interface TransactionService
Returns:
the current object

getTransactionManager

public org.objectweb.transaction.jta.TransactionManager getTransactionManager()
Gets the TransactionManager object instance

Specified by:
getTransactionManager in interface TransactionService
Returns:
the transaction manager

getUserTransaction

public javax.transaction.UserTransaction getUserTransaction()
Gets the UserTransaction object instance

Specified by:
getUserTransaction in interface TransactionService
Returns:
the user transaction object

getTransactionFactory

public org.objectweb.jotm.TransactionFactory getTransactionFactory()
Gets the TransactionFactory object (JTM factory)

Specified by:
getTransactionFactory in interface TransactionService
Returns:
the transaction factory (JTM object)

setTimeout

public void setTimeout(int t)
Sets the default transaction timeout and register Current in JNDI

Specified by:
setTimeout in interface TransactionService
Parameters:
t - new value for time-out

getTotalBegunTransactions

protected int getTotalBegunTransactions()
Get begun transactions number

Returns:
total number of begun transactions

getTotalCommittedTransactions

protected int getTotalCommittedTransactions()
Get committed transactions number

Returns:
total number of committed transactions

getTotalCurrentTransactions

protected int getTotalCurrentTransactions()
Get current transactions number

Returns:
total number of current transactions

getTotalExpiredTransactions

protected int getTotalExpiredTransactions()
Get expired transactions number

Returns:
total number of expired transactions

getTotalRolledbackTransactions

protected int getTotalRolledbackTransactions()
Get rollebacked transactions number

Returns:
total number of rollbacked transactions

resetAllTxTotalCounters

protected void resetAllTxTotalCounters()
Reset all transaction counters