ru.bitel.bgbilling.kernel.event

## Class Producer

- java.lang.Object
- - ru.bitel.bgbilling.kernel.event.MessageAdapter
  - - ru.bitel.bgbilling.kernel.event.Producer

- All Implemented Interfaces:
    javax.jms.MessageListener

      public final class Producer
      extends MessageAdapter
      implements javax.jms.MessageListener

  Отсыльщик сообщения.
  Author:
    amir

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected boolean` | `autoAcknowledge`
    `protected int` | `deliveryMode`
    `protected int` | `priority`
    `protected javax.jms.TemporaryQueue` | `replyQueue`
    `protected long` | `timeToLive`

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

      `session`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Producer(javax.jms.Session session, java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.Object> requestMap, java.util.concurrent.ConcurrentMap<java.lang.String,javax.jms.Message> responseMap, java.lang.Class<? extends Event> clazz, javax.jms.MessageProducer producer, boolean topic)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `void` | `onMessage(javax.jms.Message message)`
    `java.lang.Object` | `request(java.lang.String correlationId, javax.jms.Message message)`
    `java.lang.Object` | `request(java.lang.String correlationId, javax.jms.Message message, long timeout)`
    `<Q extends Event> java.util.concurrent.Future<Q>` | `requestAsync(java.lang.String correlationId, javax.jms.Message message, long timeout)` Выполнение запроса асинхронно.
    `void` | `send(javax.jms.Message message)`
    `void` | `send(javax.jms.Message message, int priority, long timeToLive)`
    `void` | `send(javax.jms.Message message, long timeToLive)`

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

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

- - ### Field Detail

    - #### replyQueue

          protected final javax.jms.TemporaryQueue replyQueue

    - #### deliveryMode

          protected final int deliveryMode

    - #### priority

          protected final int priority

    - #### timeToLive

          protected final long timeToLive

    - #### autoAcknowledge

          protected final boolean autoAcknowledge

  - ### Constructor Detail

    - #### Producer

          public Producer(javax.jms.Session session,
                          java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.Object> requestMap,
                          java.util.concurrent.ConcurrentMap<java.lang.String,javax.jms.Message> responseMap,
                          java.lang.Class<? extends Event> clazz,
                          javax.jms.MessageProducer producer,
                          boolean topic)
                   throws javax.jms.JMSException,
                          javax.xml.bind.JAXBException

      Throws:
        `javax.jms.JMSException`
        `javax.xml.bind.JAXBException`

  - ### Method Detail

    - #### onMessage

          public void onMessage(javax.jms.Message message)

      Specified by:
        `onMessage` in interface `javax.jms.MessageListener`

    - #### close

          public void close()
                     throws javax.jms.JMSException

      Throws:
        `javax.jms.JMSException`

    - #### send

          public void send(javax.jms.Message message)
                    throws javax.jms.JMSException

      Throws:
        `javax.jms.JMSException`

    - #### send

          public void send(javax.jms.Message message,
                           long timeToLive)
                    throws javax.jms.JMSException

      Throws:
        `javax.jms.JMSException`

    - #### send

          public void send(javax.jms.Message message,
                           int priority,
                           long timeToLive)
                    throws javax.jms.JMSException

      Throws:
        `javax.jms.JMSException`

    - #### request

          public java.lang.Object request(java.lang.String correlationId,
                                          javax.jms.Message message)
                                   throws javax.jms.JMSException,
                                          java.lang.InterruptedException,
                                          javax.xml.bind.JAXBException,
                                          EventProcessorException

      Throws:
        `javax.jms.JMSException`
        `java.lang.InterruptedException`
        `javax.xml.bind.JAXBException`
        `EventProcessorException`

    - #### request

          public java.lang.Object request(java.lang.String correlationId,
                                          javax.jms.Message message,
                                          long timeout)
                                   throws javax.jms.JMSException,
                                          javax.xml.bind.JAXBException,
                                          java.lang.InterruptedException,
                                          EventProcessorException

      Throws:
        `javax.jms.JMSException`
        `javax.xml.bind.JAXBException`
        `java.lang.InterruptedException`
        `EventProcessorException`

    - #### requestAsync

          public <Q extends Event> java.util.concurrent.Future<Q> requestAsync(java.lang.String correlationId,
                                                                               javax.jms.Message message,
                                                                               long timeout)
                                                                        throws javax.jms.JMSException,
                                                                               javax.xml.bind.JAXBException,
                                                                               java.lang.InterruptedException,
                                                                               EventProcessorException

      Выполнение запроса асинхронно.
      Если ответ не пришел, обязательно должен быть обязательно вызван `Future.cancel(boolean)`!!!
      Type Parameters:
        `Q` -
      Parameters:
        `correlationId` -
        `message` -
        `timeout` -
      Returns:
      Throws:
        `javax.jms.JMSException`
        `javax.xml.bind.JAXBException`
        `java.lang.InterruptedException`
        `EventProcessorException`