public final class Consumer extends MessageAdapter implements javax.jms.MessageListener
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
applicationName |
protected EventListenerContext |
eventListenerContext
MessageListener.onMessage(Message) выполняется в одном потоке Session . |
protected EventProcessor |
eventProcessor |
boolean |
localSession |
deliveryMode, priority, session, timeToLive
Constructor and Description |
---|
Consumer(EventProcessor eventProcessor,
javax.jms.Session session,
java.lang.Class<? extends Event> clazz,
EventType type,
int moduleId,
int pluginId,
java.lang.String destination,
java.lang.String query,
boolean setMessageListener,
boolean localSession) |
Consumer(EventProcessor eventProcessor,
javax.jms.Session session,
int moduleId,
int pluginId,
java.lang.String destination,
java.lang.String query,
boolean queue,
boolean noLocal,
int deliveryMode,
int priority,
long timeToLive,
boolean localSession,
java.lang.Class<? extends Event>... clazz) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected javax.jms.MessageConsumer |
createConsumer(java.lang.String destination,
java.lang.String query,
boolean noLocal,
boolean topic) |
void |
destroy() |
void |
notify(Event e,
EventListenerContext ctx) |
void |
onMessage(javax.jms.Message message) |
protected boolean |
onMessage0(javax.jms.Message message,
EventListenerContext ctx,
EventListener<Event> listener) |
<E extends Event> |
receive() |
<E extends Event> |
receive(long timeout) |
<E extends Event> |
receiveNoWait() |
protected void |
trySendReply(javax.jms.Message message,
Event e,
java.lang.Exception ex) |
protected final EventProcessor eventProcessor
protected final java.lang.String applicationName
protected final EventListenerContext eventListenerContext
MessageListener.onMessage(Message)
выполняется в одном потоке Session
.EventListenerContext
, если обработка в одном пакете.public final boolean localSession
public Consumer(EventProcessor eventProcessor, javax.jms.Session session, java.lang.Class<? extends Event> clazz, EventType type, int moduleId, int pluginId, java.lang.String destination, java.lang.String query, boolean setMessageListener, boolean localSession) throws javax.jms.JMSException, javax.xml.bind.JAXBException
javax.jms.JMSException
javax.xml.bind.JAXBException
public Consumer(EventProcessor eventProcessor, javax.jms.Session session, int moduleId, int pluginId, java.lang.String destination, java.lang.String query, boolean queue, boolean noLocal, int deliveryMode, int priority, long timeToLive, boolean localSession, java.lang.Class<? extends Event>... clazz) throws javax.jms.JMSException, javax.xml.bind.JAXBException
javax.jms.JMSException
javax.xml.bind.JAXBException
protected boolean onMessage0(javax.jms.Message message, EventListenerContext ctx, EventListener<Event> listener) throws javax.jms.JMSException, javax.xml.bind.JAXBException, ru.bitel.bgbilling.common.BGException
javax.jms.JMSException
javax.xml.bind.JAXBException
ru.bitel.bgbilling.common.BGException
public void onMessage(javax.jms.Message message)
onMessage
in interface javax.jms.MessageListener
protected javax.jms.MessageConsumer createConsumer(java.lang.String destination, java.lang.String query, boolean noLocal, boolean topic) throws javax.jms.JMSException
javax.jms.JMSException
protected final void trySendReply(javax.jms.Message message, Event e, java.lang.Exception ex) throws javax.jms.JMSException, javax.xml.bind.JAXBException
javax.jms.JMSException
javax.xml.bind.JAXBException
public void close() throws javax.jms.JMSException
javax.jms.JMSException
public void destroy() throws javax.jms.JMSException
javax.jms.JMSException
public <E extends Event> E receive() throws ru.bitel.bgbilling.common.BGException
ru.bitel.bgbilling.common.BGException
public <E extends Event> E receive(long timeout) throws ru.bitel.bgbilling.common.BGException
ru.bitel.bgbilling.common.BGException
public <E extends Event> E receiveNoWait() throws ru.bitel.bgbilling.common.BGException
ru.bitel.bgbilling.common.BGException
public void notify(Event e, EventListenerContext ctx) throws ru.bitel.bgbilling.common.BGException
notify
in interface EventListener<Event>
ru.bitel.bgbilling.common.BGException