org.objectweb.jonas.jtm
Class TransactionServiceImpl

java.lang.Object
  |
  +--org.objectweb.jonas.service.AbsServiceImpl
        |
        +--org.objectweb.jonas.jtm.TransactionServiceImpl
All Implemented Interfaces:
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.


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
 Current getCurrent()
          Gets the Current object instance
 java.lang.Integer getCurrentTimeOut()
          MBean method get the default timeout
 java.lang.String getJTMHostName()
          MBean method
 java.lang.Boolean getJTMLocal()
          MBean method
 java.lang.Integer getJTMPortNumber()
          MBean method
 TransactionFactory getTransactionFactory()
          Gets the TransactionFactory object (JTM factory)
 javax.transaction.TransactionManager getTransactionManager()
          Gets the TransactionManager object instance
 java.lang.Integer[] getTxCounters()
          MBean method:
 javax.transaction.UserTransaction getUserTransaction()
          Gets the UserTransaction object instance
 void resetAllTxTotalCounters()
          MBean method: reset all tx counter
 void setCurrentTimeOut(java.lang.Integer t)
          MBean method get the default timeout
 void setTimeout(int t)
          Sets the default transaction timeout and register Current in JNDI
 
Methods inherited from class org.objectweb.jonas.service.AbsServiceImpl
getName, init, isStarted, setName, start, stop
 
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
 

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.
Overrides:
doInit in class AbsServiceImpl

doStart

public void doStart()
             throws ServiceException
Start the Service Initialization of the service is already done.
Overrides:
doStart in class AbsServiceImpl

doStop

public void doStop()
            throws ServiceException
Stop the transaction service Not already implementated
Overrides:
doStop in class AbsServiceImpl

getCurrent

public Current getCurrent()
Gets the Current object instance
Specified by:
getCurrent in interface TransactionService

getTransactionManager

public javax.transaction.TransactionManager getTransactionManager()
Gets the TransactionManager object instance
Specified by:
getTransactionManager in interface TransactionService

getUserTransaction

public javax.transaction.UserTransaction getUserTransaction()
Gets the UserTransaction object instance
Specified by:
getUserTransaction in interface TransactionService

getTransactionFactory

public TransactionFactory getTransactionFactory()
Gets the TransactionFactory object (JTM factory)
Specified by:
getTransactionFactory in interface TransactionService

setTimeout

public void setTimeout(int t)
Sets the default transaction timeout and register Current in JNDI
Specified by:
setTimeout in interface TransactionService

setCurrentTimeOut

public void setCurrentTimeOut(java.lang.Integer t)
MBean method get the default timeout
Specified by:
setCurrentTimeOut in interface TransactionServiceImplMBean
Following copied from interface: org.objectweb.jonas.jtm.TransactionServiceImplMBean
Parameters:
new - time out for transaction

getCurrentTimeOut

public java.lang.Integer getCurrentTimeOut()
MBean method get the default timeout
Specified by:
getCurrentTimeOut in interface TransactionServiceImplMBean
Following copied from interface: org.objectweb.jonas.jtm.TransactionServiceImplMBean
Returns:
Integer current time out for transaction

getJTMLocal

public java.lang.Boolean getJTMLocal()
MBean method
Specified by:
getJTMLocal in interface TransactionServiceImplMBean
Returns:
true if the jtm is local

getJTMPortNumber

public java.lang.Integer getJTMPortNumber()
MBean method
Specified by:
getJTMPortNumber in interface TransactionServiceImplMBean
Returns:
the jtm port number

getJTMHostName

public java.lang.String getJTMHostName()
MBean method
Specified by:
getJTMHostName in interface TransactionServiceImplMBean
Returns:
the jtm host name

getTxCounters

public java.lang.Integer[] getTxCounters()
MBean method:
Specified by:
getTxCounters in interface TransactionServiceImplMBean
Returns:
all tx counter

resetAllTxTotalCounters

public void resetAllTxTotalCounters()
MBean method: reset all tx counter
Specified by:
resetAllTxTotalCounters in interface TransactionServiceImplMBean