biz.hammurapi.jms
Class QueueConnectionWrapper

java.lang.Object
  extended by biz.hammurapi.config.ComponentBase
      extended by biz.hammurapi.config.JndiWrapper
          extended by biz.hammurapi.jms.QueueConnectionWrapper
All Implemented Interfaces:
biz.hammurapi.config.Component, biz.hammurapi.config.Context, biz.hammurapi.config.DomConfigurable, biz.hammurapi.config.Wrapper, biz.hammurapi.metrics.MeasurementCollector, biz.hammurapi.metrics.MeasurementConsumer

public class QueueConnectionWrapper
extends biz.hammurapi.config.JndiWrapper

This class reads configuration from XML, looks up JMS queue connection factory in JNDI and obtains connection from the factory. Configuration:
Attribute: jndi-name
Nested elements: environment-property with attribute name, user and password elements for authentication. Example:

<queueConnection type="biz.hammurapi.jms.QueueConnectionWrapper" jndi-name="QueueConnectionFactory"> 
            <environment-property name="java.naming.factory.initial">factory class</environment-property>
            <environment-property name="java.naming.provider.url">provider url</environment-property>
            <user>usr</user>
            <password>pwd</password>
        </queueConnection>
        
Environment properties are passed to the constructor of initial JNDI context.

Author:
Pavel Vlasov

Field Summary
 
Fields inherited from class biz.hammurapi.config.ComponentBase
owner
 
Constructor Summary
QueueConnectionWrapper()
           
 
Method Summary
 void configure(org.w3c.dom.Node configNode, biz.hammurapi.config.Context context)
           
 java.lang.Object getMaster()
          Returns queue connection.
 void setOwner(java.lang.Object owner)
           
 void start()
          Obstains connection factory from JNDI, gets connection and starts it.
 void stop()
          Stops connection.
 
Methods inherited from class biz.hammurapi.config.JndiWrapper
getChild
 
Methods inherited from class biz.hammurapi.config.ComponentBase
addMeasurement, get, getMeasurementConsumer, getOwner, getOwner, setMeasurementConsumer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueueConnectionWrapper

public QueueConnectionWrapper()
Method Detail

getMaster

public java.lang.Object getMaster()
Returns queue connection.

Specified by:
getMaster in interface biz.hammurapi.config.Wrapper
Overrides:
getMaster in class biz.hammurapi.config.JndiWrapper

start

public void start()
           throws biz.hammurapi.config.ConfigurationException
Obstains connection factory from JNDI, gets connection and starts it.

Specified by:
start in interface biz.hammurapi.config.Component
Overrides:
start in class biz.hammurapi.config.JndiWrapper
Throws:
biz.hammurapi.config.ConfigurationException

stop

public void stop()
          throws biz.hammurapi.config.ConfigurationException
Stops connection.

Specified by:
stop in interface biz.hammurapi.config.Component
Overrides:
stop in class biz.hammurapi.config.JndiWrapper
Throws:
biz.hammurapi.config.ConfigurationException

setOwner

public void setOwner(java.lang.Object owner)
Specified by:
setOwner in interface biz.hammurapi.config.Component
Overrides:
setOwner in class biz.hammurapi.config.ComponentBase

configure

public void configure(org.w3c.dom.Node configNode,
                      biz.hammurapi.config.Context context)
               throws biz.hammurapi.config.ConfigurationException
Specified by:
configure in interface biz.hammurapi.config.DomConfigurable
Overrides:
configure in class biz.hammurapi.config.JndiWrapper
Throws:
biz.hammurapi.config.ConfigurationException


Copyright © 2006 Hammurapi Group. All Rights Reserved.