biz.hammurapi.jms.adapter
Class JmsService

java.lang.Object
  extended by biz.hammurapi.config.ComponentBase
      extended by biz.hammurapi.config.ServiceBase
          extended by biz.hammurapi.jms.adapter.JmsService
All Implemented Interfaces:
biz.hammurapi.config.Component, biz.hammurapi.config.Context, biz.hammurapi.config.Service, biz.hammurapi.metrics.MeasurementCollector, biz.hammurapi.metrics.MeasurementConsumer

public class JmsService
extends biz.hammurapi.config.ServiceBase


Field Summary
 
Fields inherited from class biz.hammurapi.config.ComponentBase
owner
 
Constructor Summary
JmsService(biz.hammurapi.jms.adapter.definition.JmsService definition)
           
 
Method Summary
 biz.hammurapi.util.Worker getWorker()
           
 java.lang.Object request(java.lang.Object obj)
          Sends object JMS destination, waits for reply, receives reply converts to Object and returns.
 void request(java.lang.Object obj, Processor receptor)
          Asynchronously performs request/reply operation in worker thread.
 void send(java.lang.Object obj, boolean async)
          Sends object to JMS destination.
protected  void startInternal()
           
protected  void stopInternal()
           
 
Methods inherited from class biz.hammurapi.config.ServiceBase
start, stop
 
Methods inherited from class biz.hammurapi.config.ComponentBase
addMeasurement, get, getChild, getMeasurementConsumer, getOwner, getOwner, setMeasurementConsumer, setOwner
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface biz.hammurapi.config.Component
setOwner
 

Constructor Detail

JmsService

public JmsService(biz.hammurapi.jms.adapter.definition.JmsService definition)
           throws biz.hammurapi.config.ConfigurationException
Throws:
biz.hammurapi.config.ConfigurationException
Method Detail

getWorker

public biz.hammurapi.util.Worker getWorker()

startInternal

protected void startInternal()
                      throws biz.hammurapi.config.ConfigurationException
Specified by:
startInternal in class biz.hammurapi.config.ServiceBase
Throws:
biz.hammurapi.config.ConfigurationException

stopInternal

protected void stopInternal()
                     throws biz.hammurapi.config.ConfigurationException
Specified by:
stopInternal in class biz.hammurapi.config.ServiceBase
Throws:
biz.hammurapi.config.ConfigurationException

send

public void send(java.lang.Object obj,
                 boolean async)
          throws javax.jms.JMSException
Sends object to JMS destination.

Parameters:
obj - Object to send
async - If true all operations are performed in a worker thread.
Throws:
javax.jms.JMSException

request

public java.lang.Object request(java.lang.Object obj)
                         throws javax.jms.JMSException
Sends object JMS destination, waits for reply, receives reply converts to Object and returns. Reply message is correlated on send message ID if reply destination is set. If reply destination is not specified in configuration then temporary reply destination is used. If wait expires this method returns null.

Parameters:
obj - Object to send.
Returns:
Reply object.
Throws:
javax.jms.JMSException

request

public void request(java.lang.Object obj,
                    Processor receptor)
Asynchronously performs request/reply operation in worker thread.

Parameters:
obj - Object to send
receptor - Processor for reply. In the case of failure, exception is passed to the processor.


Copyright © 2006 Hammurapi Group. All Rights Reserved.