org.mortbay.jetty.plus
Class JotmService

java.lang.Object
  extended by org.mortbay.jetty.plus.AbstractService
      extended by org.mortbay.jetty.plus.TMService
          extended by org.mortbay.jetty.plus.JotmService
All Implemented Interfaces:
Service, LifeCycle

public class JotmService
extends TMService

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

Author:
mhalas

Field Summary
static java.lang.String DEFAULT_SERVICE_NAME
           
protected  java.util.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
_transactionManagerJNDI, DEFAULT_USER_TX_JNDI
 
Fields inherited from class org.mortbay.jetty.plus.AbstractService
_jndi, _name, _started
 
Constructor Summary
JotmService()
           
 
Method Summary
 void addDataSource(java.lang.String dsJNDIName, StandardXADataSource xaDataSource)
          Add a DataSource that does not have an associated pool.
 void addDataSource(java.lang.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
getTransactionManagerJNDI
 
Methods inherited from class org.mortbay.jetty.plus.AbstractService
getJNDI, getName, isStarted, setJNDI, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SERVICE_NAME

public static final java.lang.String DEFAULT_SERVICE_NAME
See Also:
Constant Field Values

m_tm

protected org.objectweb.transaction.jta.TMService m_tm
Instance of JOTM transaction manager.


m_mpDataSources

protected java.util.Map m_mpDataSources
Global data sources specified in server.xml

Constructor Detail

JotmService

public JotmService()
Method Detail

getTransactionManager

public TransactionManager getTransactionManager()
returns a TransactionManager object.

Specified by:
getTransactionManager in class TMService
Returns:
TransactionManager

getUserTransaction

public UserTransaction getUserTransaction()
Returns an UserTransaction object.

Specified by:
getUserTransaction in class TMService
Returns:
UserTransaction

start

public void start()
           throws java.lang.Exception
Start the LifeCycle.

Specified by:
start in interface Service
Specified by:
start in interface LifeCycle
Overrides:
start in class AbstractService
Throws:
java.lang.Exception - An arbitrary exception may be thrown.

stop

public void stop()
          throws java.lang.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
Specified by:
stop in interface LifeCycle
Overrides:
stop in class AbstractService
Throws:
java.lang.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.

addDataSource

public void addDataSource(java.lang.String dsJNDIName,
                          StandardXADataSource xaDataSource,
                          StandardXAPoolDataSource xaPool)
                   throws java.sql.SQLException,
                          javax.naming.NamingException
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:
java.sql.SQLException - if an error occurs
javax.naming.NamingException - if an error occurs

addDataSource

public void addDataSource(java.lang.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


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