org.mortbay.jetty.plus

Class JotmService

public class JotmService extends TMService

Implementation of TMService for Objectweb JOTM (www.objectweb.org)

Author: mhalas

Field Summary
static StringDEFAULT_SERVICE_NAME
protected Mapm_mpDataSources
Global data sources specified in server.xml
protected TMServicem_tm
Instance of JOTM transaction manager.
Constructor Summary
JotmService()
Method Summary
voidaddDataSource(String dsJNDIName, StandardXADataSource xaDataSource, StandardXAPoolDataSource xaPool)
Add a datasource and a pool for it to the Transaction Mgr
voidaddDataSource(String dsJNDIName, StandardXADataSource xaDataSource)
Add a DataSource that does not have an associated pool.
TransactionManagergetTransactionManager()
returns a TransactionManager object.
UserTransactiongetUserTransaction()
Returns an UserTransaction object.
voidstart()
Start the LifeCycle.
voidstop()
Stop the LifeCycle.

Field Detail

DEFAULT_SERVICE_NAME

public static final String DEFAULT_SERVICE_NAME

m_mpDataSources

protected Map m_mpDataSources
Global data sources specified in server.xml

m_tm

protected TMService m_tm
Instance of JOTM transaction manager.

Constructor Detail

JotmService

public JotmService()

Method Detail

addDataSource

public void addDataSource(String dsJNDIName, StandardXADataSource xaDataSource, StandardXAPoolDataSource xaPool)
Add a datasource and a pool for it to the Transaction Mgr

Parameters: jndiName client lookup jndi of DataSource xaDataSource the DataSource xaPool the Pool

Throws: SQLException if an error occurs NamingException if an error occurs

addDataSource

public void addDataSource(String dsJNDIName, StandardXADataSource xaDataSource)
Add a DataSource that does not have an associated pool. You should only use this if the driver for the datasource does it's own pooling.

Parameters: dsJNDIName a String value xaDataSource a StandardXADataSource value

getTransactionManager

public TransactionManager getTransactionManager()
returns a TransactionManager object.

Returns: TransactionManager

getUserTransaction

public UserTransaction getUserTransaction()
Returns an UserTransaction object.

Returns: UserTransaction

start

public void start()
Start the LifeCycle.

Throws: Exception An arbitrary exception may be thrown.

stop

public void stop()
Stop the LifeCycle. The LifeCycle may wait for current activities to complete normally, but it can be interrupted.

Throws: InterruptedException Stopping a lifecycle is rarely atomic and may be interrupted by another thread. If this happens InterruptedException is throw and the component will be in an indeterminant state and should probably be discarded.

Copyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.