com.espertech.esperio.jms
Class JMSOutputAdapter

java.lang.Object
  extended by com.espertech.esperio.jms.JMSOutputAdapter
All Implemented Interfaces:
Adapter, AdapterSPI, OutputAdapter
Direct Known Subclasses:
SpringJMSTemplateOutputAdapter

public abstract class JMSOutputAdapter
extends Object
implements OutputAdapter, AdapterSPI

Implements a JMS output adapter.


Field Summary
protected  javax.jms.Destination destination
          JMS Destination.
protected  JMSMessageMarshaller jmsMessageMarshaller
          Marshaller to use.
 
Constructor Summary
JMSOutputAdapter()
           
 
Method Summary
 void destroy()
          Destroy the Adapter, stopping the sending of all events and releasing all the resources, and disallowing any further state changes on the Adapter.
 com.espertech.esper.client.EPServiceProvider getEPServiceProvider()
          Returns the engine instance.
 JMSMessageMarshaller getJmsMessageMarshaller()
          Returns the JMS message marshaller.
 AdapterState getState()
          Get the state of this Adapter.
 Subscription getSubscription(String subscriptionAlias)
          Returns a given subscription by it's name, or null if not found
 Map<String,Subscription> getSubscriptionMap()
          Returns the subscriptions.
 void pause()
          Pause the sending of events after a Adapter has been started.
 void resume()
          Resume sending events after the Adapter has been paused.
abstract  void send(com.espertech.esper.event.EventBean eventBean, JMSMessageMarshaller jmsAdapterMarshaller)
          Abstract send methods for marshalling and sending an event of to JMS care.
 void setDestination(javax.jms.Destination destination)
          Sets the JMS destination.
 void setEPServiceProvider(com.espertech.esper.client.EPServiceProvider epService)
          An adapter takes an engine instance to process events.
 void setJmsMessageMarshaller(JMSMessageMarshaller jmsMessageMarshaller)
          Sets the JMS message marshaller.
 void setSubscriptionMap(Map<String,Subscription> subscriptionMap)
          Sets the subscriptions for the output adapter.
 void start()
          Start the sending of events into the runtime egine.
 void stop()
          Stop sending events and return the Adapter to the OPENED state, ready to be started once again.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

jmsMessageMarshaller

protected JMSMessageMarshaller jmsMessageMarshaller
Marshaller to use.


destination

protected javax.jms.Destination destination
JMS Destination.

Constructor Detail

JMSOutputAdapter

public JMSOutputAdapter()
Method Detail

send

public abstract void send(com.espertech.esper.event.EventBean eventBean,
                          JMSMessageMarshaller jmsAdapterMarshaller)
                   throws com.espertech.esper.client.EPException
Abstract send methods for marshalling and sending an event of to JMS care.

Parameters:
eventBean - is the event
jmsAdapterMarshaller - is the marshaller
Throws:
com.espertech.esper.client.EPException - when the send failed

getJmsMessageMarshaller

public JMSMessageMarshaller getJmsMessageMarshaller()
Returns the JMS message marshaller.

Returns:
marshaller

setJmsMessageMarshaller

public void setJmsMessageMarshaller(JMSMessageMarshaller jmsMessageMarshaller)
Sets the JMS message marshaller.

Parameters:
jmsMessageMarshaller - is the marshaller

setDestination

public void setDestination(javax.jms.Destination destination)
Sets the JMS destination.

Parameters:
destination - is the queue or topic

getSubscriptionMap

public Map<String,Subscription> getSubscriptionMap()
Description copied from interface: OutputAdapter
Returns the subscriptions.

Specified by:
getSubscriptionMap in interface OutputAdapter
Returns:
map of name and subscription

setSubscriptionMap

public void setSubscriptionMap(Map<String,Subscription> subscriptionMap)
Description copied from interface: OutputAdapter
Sets the subscriptions for the output adapter.

Specified by:
setSubscriptionMap in interface OutputAdapter
Parameters:
subscriptionMap - is the active subscriptions.

getSubscription

public Subscription getSubscription(String subscriptionAlias)
Description copied from interface: OutputAdapter
Returns a given subscription by it's name, or null if not found

Specified by:
getSubscription in interface OutputAdapter
Parameters:
subscriptionAlias - is the subscription
Returns:
subcription or null

getEPServiceProvider

public com.espertech.esper.client.EPServiceProvider getEPServiceProvider()
Description copied from interface: AdapterSPI
Returns the engine instance.

Specified by:
getEPServiceProvider in interface AdapterSPI
Returns:
engine

setEPServiceProvider

public void setEPServiceProvider(com.espertech.esper.client.EPServiceProvider epService)
Description copied from interface: AdapterSPI
An adapter takes an engine instance to process events.

Specified by:
setEPServiceProvider in interface AdapterSPI
Parameters:
epService - is the service instance for the adapter.

start

public void start()
           throws com.espertech.esper.client.EPException
Description copied from interface: Adapter
Start the sending of events into the runtime egine.

Specified by:
start in interface Adapter
Throws:
com.espertech.esper.client.EPException - in case of errors processing the events

pause

public void pause()
           throws com.espertech.esper.client.EPException
Description copied from interface: Adapter
Pause the sending of events after a Adapter has been started.

Specified by:
pause in interface Adapter
Throws:
com.espertech.esper.client.EPException - if this Adapter has already been stopped

resume

public void resume()
            throws com.espertech.esper.client.EPException
Description copied from interface: Adapter
Resume sending events after the Adapter has been paused.

Specified by:
resume in interface Adapter
Throws:
com.espertech.esper.client.EPException - in case of errors processing the events

stop

public void stop()
          throws com.espertech.esper.client.EPException
Description copied from interface: Adapter
Stop sending events and return the Adapter to the OPENED state, ready to be started once again.

Specified by:
stop in interface Adapter
Throws:
com.espertech.esper.client.EPException - in case of errors releasing resources

destroy

public void destroy()
             throws com.espertech.esper.client.EPException
Description copied from interface: Adapter
Destroy the Adapter, stopping the sending of all events and releasing all the resources, and disallowing any further state changes on the Adapter.

Specified by:
destroy in interface Adapter
Throws:
com.espertech.esper.client.EPException - to indicate errors during destroy

getState

public AdapterState getState()
Description copied from interface: Adapter
Get the state of this Adapter.

Specified by:
getState in interface Adapter
Returns:
state

© 2007 EsperTech Inc.
All rights reserved.
Visit us at espertech.com