org.mortbay.jetty.plus
Class JotmService

java.lang.Object
  |
  +--org.mortbay.jetty.plus.AbstractService
        |
        +--org.mortbay.jetty.plus.TMService
              |
              +--org.mortbay.jetty.plus.JotmService
All Implemented Interfaces:
LifeCycle, Service

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
           
 
Fields inherited from class org.mortbay.jetty.plus.TMService
DEFAULT_USER_TX_JNDI
 
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
equals, 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
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
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
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:
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 ? 2000 Mortbay Consulting Pty. Ltd. All Rights Reserved.