biz.hammurapi.jms.adapter
Class JmsAdapter

java.lang.Object
  extended by biz.hammurapi.util.VisitableBase
      extended by biz.hammurapi.config.GenericContainer
          extended by biz.hammurapi.jms.adapter.JmsAdapter
All Implemented Interfaces:
biz.hammurapi.config.Command, biz.hammurapi.config.Component, biz.hammurapi.config.Context, biz.hammurapi.config.MutableContext, biz.hammurapi.metrics.MeasurementCollector, biz.hammurapi.metrics.MeasurementConsumer, biz.hammurapi.util.Attributable, biz.hammurapi.util.Visitable, biz.hammurapi.util.Worker

public class JmsAdapter
extends biz.hammurapi.config.GenericContainer
implements biz.hammurapi.config.MutableContext, biz.hammurapi.util.Worker


Constructor Summary
JmsAdapter(biz.hammurapi.jms.adapter.definition.JmsAdapter definition)
          Instantiates JMS adapter from the definition.
 
Method Summary
 java.lang.Object get(java.lang.String name)
          Returns service.
 biz.hammurapi.jms.adapter.definition.JmsAdapter getDefinition()
           
 java.util.Timer getTimer()
           
static java.lang.Object instantiate(biz.hammurapi.jms.adapter.definition.NamedObjectSpecification objSpec)
          Instantiates object from specifications and configures it by injecting properties.
static java.lang.Object instantiate(biz.hammurapi.jms.adapter.definition.ObjectSpecification objSpec)
          Instantiates object from specifications and configures it by injecting properties.
static java.util.Hashtable instantiate(biz.hammurapi.jms.adapter.definition.Property[] properties)
          Instantiates properties from XML defintion
static boolean isBlank(java.lang.String str)
           
static void main(java.lang.String[] args)
          The first and only argument is definition URL.
 boolean post(java.lang.Runnable job)
          Executes job in the current thread if there is no default worker.
 void remove(java.lang.String name)
           
 void set(java.lang.String name, java.lang.Object value)
           
 void setDefaultWorker(biz.hammurapi.util.Worker defaultWorker)
          Sets default worker.
 void setOwner(java.lang.Object owner)
          Adapter is always naming root.
 void start()
           
 void stop()
           
 
Methods inherited from class biz.hammurapi.config.GenericContainer
acceptChildren, addComponent, addMeasurement, execute, getAttribute, getComponentMap, getComponentNames, getComponents, getMeasurementConsumer, getOwner, removeAttribute, setAttribute, setMeasurementConsumer
 
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
 

Constructor Detail

JmsAdapter

public JmsAdapter(biz.hammurapi.jms.adapter.definition.JmsAdapter definition)
           throws biz.hammurapi.config.ConfigurationException
Instantiates JMS adapter from the definition.

Parameters:
definition -
Throws:
biz.hammurapi.config.ConfigurationException
Method Detail

setDefaultWorker

public void setDefaultWorker(biz.hammurapi.util.Worker defaultWorker)
Sets default worker. Overrides default worker read from configuration. This method is used by JCA wrapper.

Parameters:
defaultWorker -

getTimer

public java.util.Timer getTimer()

instantiate

public static java.lang.Object instantiate(biz.hammurapi.jms.adapter.definition.ObjectSpecification objSpec)
                                    throws biz.hammurapi.config.ConfigurationException
Instantiates object from specifications and configures it by injecting properties.

Parameters:
objSpec -
Returns:
Throws:
biz.hammurapi.config.ConfigurationException

instantiate

public static java.lang.Object instantiate(biz.hammurapi.jms.adapter.definition.NamedObjectSpecification objSpec)
                                    throws biz.hammurapi.config.ConfigurationException
Instantiates object from specifications and configures it by injecting properties.

Parameters:
objSpec -
Returns:
Throws:
biz.hammurapi.config.ConfigurationException

instantiate

public static java.util.Hashtable instantiate(biz.hammurapi.jms.adapter.definition.Property[] properties)
                                       throws biz.hammurapi.config.ConfigurationException
Instantiates properties from XML defintion

Parameters:
property -
Returns:
Throws:
biz.hammurapi.config.ConfigurationException

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

remove

public void remove(java.lang.String name)
Specified by:
remove in interface biz.hammurapi.config.MutableContext

set

public void set(java.lang.String name,
                java.lang.Object value)
Specified by:
set in interface biz.hammurapi.config.MutableContext

get

public java.lang.Object get(java.lang.String name)
Returns service. Unwraps wrappers.

Specified by:
get in interface biz.hammurapi.config.Context
Overrides:
get in class biz.hammurapi.config.GenericContainer

main

public static void main(java.lang.String[] args)
The first and only argument is definition URL. If URL starts with "resource:" then definition is loaded from classpath resource. If the first argument is not present then definition is read from System.in Adapter is stopped by shutdown hook on JVM termination (Ctrl-C).

Parameters:
args -

isBlank

public static boolean isBlank(java.lang.String str)

getDefinition

public biz.hammurapi.jms.adapter.definition.JmsAdapter getDefinition()
Returns:
Adapter XML definition.

setOwner

public void setOwner(java.lang.Object owner)
Adapter is always naming root. Owner is available through 'owner' alias.

Specified by:
setOwner in interface biz.hammurapi.config.Component
Overrides:
setOwner in class biz.hammurapi.config.GenericContainer

post

public boolean post(java.lang.Runnable job)
Executes job in the current thread if there is no default worker.

Specified by:
post in interface biz.hammurapi.util.Worker


Copyright © 2006 Hammurapi Group. All Rights Reserved.