biz.hammurapi.config
Class JndiWrapper

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

public class JndiWrapper
extends ComponentBase
implements DomConfigurable, Wrapper

Binds object from jndi to pv. Configuration:
Attribute: jndi-name
Nested elements: environment-property with attribute name. Example:

<topicConnectionFactory type="biz.hammurapi.config.JndiWrapper" jndi-name="TopicConnectionFactory"> 

     <environment-property name="java.naming.factory.initial">factory class</environment-property>

     <environment-property name="java.naming.provider.url">provider urle</environment-property>

 </topicConnectionFactory> 
 
Environment properties are passed to the constructor of initial JNDI context. If jndi-name attribute is not set then this class returns InitialContext as its master. If jndi-name is not set or master object is instance of javax.naming.Context then this component acts as a JNDI bridge.

Author:
Pavel Vlasov

Field Summary
 
Fields inherited from class biz.hammurapi.config.ComponentBase
owner
 
Constructor Summary
JndiWrapper()
           
 
Method Summary
 void configure(org.w3c.dom.Node configNode, Context context)
          Reads configuration from Node
protected  java.lang.Object getChild(java.lang.String name)
          Override this method if component has subcomponents.
 java.lang.Object getMaster()
           
 void start()
          Looks up master in JNDI.
 void stop()
          Invoked by container when component is not needed anymore.
 
Methods inherited from class biz.hammurapi.config.ComponentBase
addMeasurement, get, getMeasurementConsumer, getOwner, getOwner, setMeasurementConsumer, setOwner
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JndiWrapper

public JndiWrapper()
Method Detail

start

public void start()
           throws ConfigurationException
Looks up master in JNDI.

Specified by:
start in interface Component
Throws:
ConfigurationException

stop

public void stop()
          throws ConfigurationException
Description copied from interface: Component
Invoked by container when component is not needed anymore. Component shall perform cleanup in this method.

Specified by:
stop in interface Component
Throws:
ConfigurationException

configure

public void configure(org.w3c.dom.Node configNode,
                      Context context)
               throws ConfigurationException
Description copied from interface: DomConfigurable
Reads configuration from Node

Specified by:
configure in interface DomConfigurable
Throws:
ConfigurationException

getMaster

public java.lang.Object getMaster()
Specified by:
getMaster in interface Wrapper

getChild

protected java.lang.Object getChild(java.lang.String name)
Description copied from class: ComponentBase
Override this method if component has subcomponents.

Overrides:
getChild in class ComponentBase
Returns:


Copyright © 2003 Hammurapi Group. All Rights Reserved.