Class Consumer

java.lang.Object
ru.bitel.bgbilling.kernel.base.server.logger.BGLogger
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>

public final class Consumer extends MessageAdapter implements javax.jms.MessageListener
Обработчик сообщения.
  • Field Details

    • eventProcessor

      protected final EventProcessor eventProcessor
    • applicationName

      protected final String applicationName
    • eventListenerContext

      protected final EventListenerContext 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, jakarta.xml.bind.JAXBException
      Throws:
      javax.jms.JMSException
      jakarta.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, jakarta.xml.bind.JAXBException
      Throws:
      javax.jms.JMSException
      jakarta.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, jakarta.xml.bind.JAXBException, ru.bitel.bgbilling.common.BGException
      Throws:
      javax.jms.JMSException
      jakarta.xml.bind.JAXBException
      ru.bitel.bgbilling.common.BGException
    • onMessage

      public void onMessage(javax.jms.Message message)
      Specified by:
      onMessage in interface javax.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, jakarta.xml.bind.JAXBException
      Throws:
      javax.jms.JMSException
      jakarta.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 Exception
      Specified by:
      notify in interface EventListener<ru.bitel.bgbilling.kernel.event.common.Event>
      Throws:
      Exception