Package ru.bitel.bgbilling.kernel.event
Class Consumer
java.lang.Object
ru.bitel.bgbilling.kernel.event.MessageAdapter
ru.bitel.bgbilling.kernel.event.Consumer
- All Implemented Interfaces:
javax.jms.MessageListener
,EventListener<ru.bitel.bgbilling.kernel.event.common.Event>
Обработчик сообщения.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final String
protected final EventListenerContext
MessageListener.onMessage(Message)
выполняется в одном потокеSession
.
Поэтому можно использовать один объектEventListenerContext
, если обработка в одном пакете.protected final EventProcessor
final boolean
Fields inherited from class ru.bitel.bgbilling.kernel.event.MessageAdapter
deliveryMode, priority, session, timeToLive
-
Constructor Summary
ConstructorDescriptionConsumer
(EventProcessor eventProcessor, javax.jms.Session session, int moduleId, int pluginId, String destination, String query, boolean queue, boolean noLocal, int deliveryMode, int priority, long timeToLive, boolean localSession, Class<? extends ru.bitel.bgbilling.kernel.event.common.Event>... clazz) Consumer
(EventProcessor eventProcessor, javax.jms.Session session, Class<? extends ru.bitel.bgbilling.kernel.event.common.Event> clazz, EventType type, int moduleId, int pluginId, String destination, String query, boolean setMessageListener, boolean localSession) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected javax.jms.MessageConsumer
createConsumer
(String destination, String query, boolean noLocal, boolean topic) void
destroy()
void
notify
(ru.bitel.bgbilling.kernel.event.common.Event e, EventListenerContext ctx) void
onMessage
(javax.jms.Message message) protected boolean
onMessage0
(javax.jms.Message message, EventListenerContext eventListenerContext, EventListener<ru.bitel.bgbilling.kernel.event.common.Event> listener) <E extends ru.bitel.bgbilling.kernel.event.common.Event>
Ereceive()
<E extends ru.bitel.bgbilling.kernel.event.common.Event>
Ereceive
(long timeout) <E extends ru.bitel.bgbilling.kernel.event.common.Event>
Eprotected final void
trySendReply
(javax.jms.Message message, ru.bitel.bgbilling.kernel.event.common.Event e, Exception ex)
-
Field Details
-
eventProcessor
-
applicationName
-
eventListenerContext
MessageListener.onMessage(Message)
выполняется в одном потокеSession
.
Поэтому можно использовать один объектEventListenerContext
, если обработка в одном пакете. -
localSession
public final boolean localSession
-
-
Constructor Details
-
Consumer
public Consumer(EventProcessor eventProcessor, javax.jms.Session session, Class<? extends ru.bitel.bgbilling.kernel.event.common.Event> clazz, EventType type, int moduleId, int pluginId, String destination, String query, boolean setMessageListener, boolean localSession) throws javax.jms.JMSException, javax.xml.bind.JAXBException - Throws:
javax.jms.JMSException
javax.xml.bind.JAXBException
-
Consumer
public Consumer(EventProcessor eventProcessor, javax.jms.Session session, int moduleId, int pluginId, String destination, String query, boolean queue, boolean noLocal, int deliveryMode, int priority, long timeToLive, boolean localSession, Class<? extends ru.bitel.bgbilling.kernel.event.common.Event>... clazz) throws javax.jms.JMSException, javax.xml.bind.JAXBException - Throws:
javax.jms.JMSException
javax.xml.bind.JAXBException
-
-
Method Details
-
onMessage0
protected boolean onMessage0(javax.jms.Message message, EventListenerContext eventListenerContext, EventListener<ru.bitel.bgbilling.kernel.event.common.Event> listener) throws javax.jms.JMSException, javax.xml.bind.JAXBException, ru.bitel.bgbilling.common.BGException - Throws:
javax.jms.JMSException
javax.xml.bind.JAXBException
ru.bitel.bgbilling.common.BGException
-
onMessage
public void onMessage(javax.jms.Message message) - Specified by:
onMessage
in interfacejavax.jms.MessageListener
-
createConsumer
protected javax.jms.MessageConsumer createConsumer(String destination, String query, boolean noLocal, boolean topic) throws javax.jms.JMSException - Throws:
javax.jms.JMSException
-
trySendReply
protected final void trySendReply(javax.jms.Message message, ru.bitel.bgbilling.kernel.event.common.Event e, Exception ex) throws javax.jms.JMSException, javax.xml.bind.JAXBException - Throws:
javax.jms.JMSException
javax.xml.bind.JAXBException
-
close
public void close() throws javax.jms.JMSException- Throws:
javax.jms.JMSException
-
destroy
public void destroy() throws javax.jms.JMSException- Throws:
javax.jms.JMSException
-
receive
public <E extends ru.bitel.bgbilling.kernel.event.common.Event> E receive() throws ru.bitel.bgbilling.common.BGException- Throws:
ru.bitel.bgbilling.common.BGException
-
receive
public <E extends ru.bitel.bgbilling.kernel.event.common.Event> E receive(long timeout) throws ru.bitel.bgbilling.common.BGException - Throws:
ru.bitel.bgbilling.common.BGException
-
receiveNoWait
public <E extends ru.bitel.bgbilling.kernel.event.common.Event> E receiveNoWait() throws ru.bitel.bgbilling.common.BGException- Throws:
ru.bitel.bgbilling.common.BGException
-
notify
public void notify(ru.bitel.bgbilling.kernel.event.common.Event e, EventListenerContext ctx) throws ru.bitel.bgbilling.common.BGException - Specified by:
notify
in interfaceEventListener<ru.bitel.bgbilling.kernel.event.common.Event>
- Throws:
ru.bitel.bgbilling.common.BGException
-