biz.hammurapi.jms.adapter
Class JmsConnection

java.lang.Object
  extended by biz.hammurapi.util.VisitableBase
      extended by biz.hammurapi.config.GenericContainer
          extended by biz.hammurapi.jms.adapter.JmsConnection
All Implemented Interfaces:
biz.hammurapi.config.Command, biz.hammurapi.config.Component, biz.hammurapi.config.Context, biz.hammurapi.metrics.MeasurementCollector, biz.hammurapi.metrics.MeasurementConsumer, biz.hammurapi.util.Attributable, biz.hammurapi.util.Visitable
Direct Known Subclasses:
FactoryConnection, JndiConnection

public abstract class JmsConnection
extends biz.hammurapi.config.GenericContainer

Base class for Jndi and Factory connections.

Author:
Pavel

Field Summary
protected  biz.hammurapi.jms.adapter.definition.Connection definition
           
 
Constructor Summary
JmsConnection(JmsAdapter jmsAdapter, biz.hammurapi.jms.adapter.definition.Connection definition)
           
 
Method Summary
 javax.jms.Session borrowSession()
           
protected abstract  javax.jms.ConnectionFactory getConnectionFactory()
          Subclasses shall implement this method to either look up connection factory in JNDI or create using vendor-specific API's.
 void invalidateSession(javax.jms.Session session)
           
 void returnSession(javax.jms.Session session)
           
 void start()
           
 void stop()
           
 
Methods inherited from class biz.hammurapi.config.GenericContainer
acceptChildren, addComponent, addMeasurement, execute, get, getAttribute, getComponentMap, getComponentNames, getComponents, getMeasurementConsumer, getOwner, removeAttribute, setAttribute, setMeasurementConsumer, setOwner
 
Methods inherited from class biz.hammurapi.util.VisitableBase
accept, object2visitor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

definition

protected biz.hammurapi.jms.adapter.definition.Connection definition
Constructor Detail

JmsConnection

public JmsConnection(JmsAdapter jmsAdapter,
                     biz.hammurapi.jms.adapter.definition.Connection definition)
              throws biz.hammurapi.config.ConfigurationException
Throws:
biz.hammurapi.config.ConfigurationException
Method Detail

getConnectionFactory

protected abstract javax.jms.ConnectionFactory getConnectionFactory()
                                                             throws biz.hammurapi.config.ConfigurationException
Subclasses shall implement this method to either look up connection factory in JNDI or create using vendor-specific API's.

Returns:
Throws:
javax.jms.JMSException
biz.hammurapi.config.ConfigurationException

borrowSession

public javax.jms.Session borrowSession()
                                throws javax.jms.JMSException
Throws:
javax.jms.JMSException

returnSession

public void returnSession(javax.jms.Session session)
                   throws javax.jms.JMSException
Throws:
javax.jms.JMSException

invalidateSession

public void invalidateSession(javax.jms.Session session)
                       throws javax.jms.JMSException
Throws:
javax.jms.JMSException

start

public void start()
           throws biz.hammurapi.config.ConfigurationException
Specified by:
start in interface biz.hammurapi.config.Component
Overrides:
start in class biz.hammurapi.config.GenericContainer
Throws:
biz.hammurapi.config.ConfigurationException

stop

public void stop()
          throws biz.hammurapi.config.ConfigurationException
Specified by:
stop in interface biz.hammurapi.config.Component
Overrides:
stop in class biz.hammurapi.config.GenericContainer
Throws:
biz.hammurapi.config.ConfigurationException


Copyright © 2006 Hammurapi Group. All Rights Reserved.