biz.hammurapi.jms
Class TopicConnectionWrapper
java.lang.Object
biz.hammurapi.config.ComponentBase
biz.hammurapi.config.JndiWrapper
biz.hammurapi.jms.TopicConnectionWrapper
- 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 TopicConnectionWrapper
- extends biz.hammurapi.config.JndiWrapper
This class reads configuration from XML, looks up JMS Topic 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:
<topicConnection type="biz.hammurapi.jms.TopicConnectionWrapper" jndi-name="TopicConnectionFactory">
<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>
</topicConnection>
Environment properties are passed to the constructor of initial JNDI context.
- Author:
- Pavel Vlasov
Fields inherited from class biz.hammurapi.config.ComponentBase |
owner |
Method Summary |
void |
configure(org.w3c.dom.Node configNode,
biz.hammurapi.config.Context context)
|
java.lang.Object |
getMaster()
Returns topic 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 |
TopicConnectionWrapper
public TopicConnectionWrapper()
getMaster
public java.lang.Object getMaster()
- Returns topic 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.