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.

Author:
Philippe Durieux Contributor(s):

Field Summary
static java.lang.String CLASS
           
static java.lang.String JONAS
           
static java.lang.String REMOTE
           
static java.lang.String SERVER
           
static java.lang.String TIMEOUT
           
 
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 saveConfig()
          MBean method: saves the updated server configuration.
 void setCurrentTimeOut(java.lang.Integer t)
          MBean method set the default timeout mark the transaction service as reconfigured
 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
 

Field Detail

TIMEOUT

public static final java.lang.String TIMEOUT

REMOTE

public static final java.lang.String REMOTE

CLASS

public static final java.lang.String CLASS

SERVER

public static final java.lang.String SERVER

JONAS

public static final java.lang.String JONAS
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 set the default timeout mark the transaction service as reconfigured
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

saveConfig

public void saveConfig()
MBean method: saves the updated server configuration. The modified configuration values are saved in the jonas.properties conf. file located in :
    • the current start-up directory (.)
      the directory $JONAS_ROOT/update/jonasServName, where jonasServName is the name of the current JOnAS server as given by the jonas.name configuration property. Currently, this location sould not be used because the JOnAS server bootstrap was not modified to take into account this location for config files.
      Specified by:
      saveConfig in interface TransactionServiceImplMBean