Package ru.bitel.bgbilling.kernel.event

# 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 Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final String`
  `applicationName`
  `protected final EventListenerContext`
  `eventListenerContext`
  `MessageListener.onMessage(Message)` выполняется в одном потоке `Session`.
  Поэтому можно использовать один объект `EventListenerContext`, если обработка в одном пакете.
  `protected final EventProcessor`
  `eventProcessor`
  `final boolean`
  `localSession`

  ### Fields inherited from class ru.bitel.bgbilling.kernel.event.MessageAdapter

  `deliveryMode, priority, session, timeToLive`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `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)`
  `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 Type
  Method
  Description
  `void`
  `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>
  E`
  `receive()`
  `<E extends ru.bitel.bgbilling.kernel.event.common.Event>
  E`
  `receive(long timeout)`
  `<E extends ru.bitel.bgbilling.kernel.event.common.Event>
  E`
  `receiveNoWait()`
  `protected final void`
  `trySendReply(javax.jms.Message message, ru.bitel.bgbilling.kernel.event.common.Event e, Exception ex)`

  ### Methods inherited from class ru.bitel.bgbilling.kernel.base.server.logger.BGLogger

  `error, error, error, getLogger, logError, logError`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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`