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):

Field Summary
static java.lang.String SERVICE_NAME
           
 
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
 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
 org.objectweb.jotm.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: save updated configuration
 void setCurrentTimeOut(java.lang.Integer t)
          MBean method Reconfiguration operation: set new value for timeout.
 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
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 javax.transaction.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

setCurrentTimeOut

public void setCurrentTimeOut(java.lang.Integer t)
MBean method Reconfiguration operation: set new value for timeout.

Specified by:
setCurrentTimeOut in interface TransactionServiceImplMBean
Parameters:
t - new value for time-out

getCurrentTimeOut

public java.lang.Integer getCurrentTimeOut()
MBean method get the default timeout

Specified by:
getCurrentTimeOut in interface TransactionServiceImplMBean
Returns:
the time-out value

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: save updated configuration

Specified by:
saveConfig in interface TransactionServiceImplMBean