org.mortbay.jetty.plus

Class JotmService

Implemented Interfaces:
LifeCycle, Service

public class JotmService
extends TMService

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

Field Summary

static String
DEFAULT_SERVICE_NAME
protected Map
m_mpDataSources
Global data sources specified in server.xml
protected org.objectweb.transaction.jta.TMService
m_tm
Instance of JOTM transaction manager.

Fields inherited from class org.mortbay.jetty.plus.TMService

DEFAULT_USER_TX_JNDI, _transactionManagerJNDI

Fields inherited from class org.mortbay.jetty.plus.AbstractService

_jndi, _name, _started

Constructor Summary

JotmService()

Method Summary

void
addDataSource(String dsJNDIName, StandardXADataSource xaDataSource)
Add a DataSource that does not have an associated pool.
void
addDataSource(String dsJNDIName, StandardXADataSource xaDataSource, StandardXAPoolDataSource xaPool)
Add a datasource and a pool for it to the Transaction Mgr
TransactionManager
getTransactionManager()
returns a TransactionManager object.
UserTransaction
getUserTransaction()
Returns an UserTransaction object.
void
start()
Start the LifeCycle.
void
stop()
Stop the LifeCycle.

Methods inherited from class org.mortbay.jetty.plus.TMService

getTransactionManager, getTransactionManagerJNDI, getUserTransaction

Methods inherited from class org.mortbay.jetty.plus.AbstractService

getJNDI, getName, isStarted, setJNDI, setName, start, stop

Field Details

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 org.objectweb.transaction.jta.TMService m_tm
Instance of JOTM transaction manager.

Constructor Details

JotmService

public JotmService()

Method Details

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

addDataSource

public void addDataSource(String dsJNDIName,
                          StandardXADataSource xaDataSource,
                          StandardXAPoolDataSource xaPool)
            throws SQLException,
                   NamingException
Add a datasource and a pool for it to the Transaction Mgr
Parameters:
xaDataSource - the DataSource
xaPool - the Pool

getTransactionManager

public TransactionManager getTransactionManager()
returns a TransactionManager object.
Overrides:
getTransactionManager in interface TMService
Returns:
TransactionManager

getUserTransaction

public UserTransaction getUserTransaction()
Returns an UserTransaction object.
Overrides:
getUserTransaction in interface TMService
Returns:
UserTransaction

start

public void start()
            throws Exception
Start the LifeCycle.
Specified by:
start in interface Service
start in interface LifeCycle
Overrides:
start in interface AbstractService

stop

public void stop()
            throws InterruptedException
Stop the LifeCycle. The LifeCycle may wait for current activities to complete normally, but it can be interrupted.
Specified by:
stop in interface Service
stop in interface LifeCycle
Overrides:
stop in interface AbstractService

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