Class OutboundConsumer
- java.lang.Object
-
- org.objectweb.joram.client.connector.OutboundConsumer
-
- All Implemented Interfaces:
AutoCloseable,MessageConsumer
- Direct Known Subclasses:
OutboundReceiver,OutboundSubscriber
public class OutboundConsumer extends Object implements MessageConsumer
AnOutboundConsumerinstance wraps a JMS consumer for a component involved in outbound messaging.
-
-
Field Summary
Fields Modifier and Type Field Description protected MessageConsumerconsumerWrapped JMS consumer.private static booleanDEBUGprivate static Loggerloggerprotected OutboundSessionsessionTheOutboundSessionthis consumer belongs to.(package private) booleanvalidfalseif consumer is no more valid.
-
Constructor Summary
Constructors Constructor Description OutboundConsumer(MessageConsumer consumer, OutboundSession session)Constructs anOutboundConsumerinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckValidity()Checks the validity of the subscriber instance.voidclose()Delegates the call to the wrapped JMS consumer.MessageListenergetMessageListener()Forbidden call on a component's outbound consumer, throws aIllegalStateExceptioninstance.StringgetMessageSelector()Delegates the call to the wrapped JMS consumer.Messagereceive()Delegates the call to the wrapped JMS consumer.Messagereceive(long timeOut)Delegates the call to the wrapped JMS consumer.MessagereceiveNoWait()Delegates the call to the wrapped JMS consumer.voidsetMessageListener(MessageListener messageListener)Forbidden call on a component's outbound consumer, throws aIllegalStateExceptioninstance.
-
-
-
Field Detail
-
logger
private static final Logger logger
-
DEBUG
private static final boolean DEBUG
-
session
protected OutboundSession session
TheOutboundSessionthis consumer belongs to.
-
consumer
protected MessageConsumer consumer
Wrapped JMS consumer.
-
valid
boolean valid
falseif consumer is no more valid.
-
-
Constructor Detail
-
OutboundConsumer
OutboundConsumer(MessageConsumer consumer, OutboundSession session)
Constructs anOutboundConsumerinstance.- Parameters:
consumer- JMS consumer to wrap.session- The OutboundSession this consumer belongs to.
-
-
Method Detail
-
checkValidity
protected void checkValidity() throws IllegalStateExceptionChecks the validity of the subscriber instance.- Throws:
IllegalStateException
-
setMessageListener
public void setMessageListener(MessageListener messageListener) throws JMSException
Forbidden call on a component's outbound consumer, throws aIllegalStateExceptioninstance.- Specified by:
setMessageListenerin interfaceMessageConsumer- Throws:
JMSException
-
getMessageListener
public MessageListener getMessageListener() throws JMSException
Forbidden call on a component's outbound consumer, throws aIllegalStateExceptioninstance.- Specified by:
getMessageListenerin interfaceMessageConsumer- Throws:
JMSException
-
getMessageSelector
public String getMessageSelector() throws JMSException
Delegates the call to the wrapped JMS consumer.- Specified by:
getMessageSelectorin interfaceMessageConsumer- Throws:
JMSException
-
receive
public Message receive(long timeOut) throws JMSException
Delegates the call to the wrapped JMS consumer.- Specified by:
receivein interfaceMessageConsumer- Throws:
JMSException
-
receive
public Message receive() throws JMSException
Delegates the call to the wrapped JMS consumer.- Specified by:
receivein interfaceMessageConsumer- Throws:
JMSException
-
receiveNoWait
public Message receiveNoWait() throws JMSException
Delegates the call to the wrapped JMS consumer.- Specified by:
receiveNoWaitin interfaceMessageConsumer- Throws:
JMSException
-
close
public void close() throws JMSExceptionDelegates the call to the wrapped JMS consumer.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceMessageConsumer- Throws:
JMSException
-
-