org.apache.jmeter.protocol.jms.sampler

## Class MessageAdmin

- java.lang.Object
- - org.apache.jmeter.protocol.jms.sampler.MessageAdmin

-     public class MessageAdmin
      extends Object

  Administration of messages.

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `javax.jms.Message` | `get(String id)` Get the reply message.
    `static MessageAdmin` | `getAdmin()` Get the singleton MessageAdmin object
    `void` | `putReply(String id, javax.jms.Message reply)` Try to associate a reply to a previously stored request.
    `void` | `putRequest(String id, javax.jms.Message request, CountDownLatch latch)` Store a request under the given id, so that an arriving reply can be associated with this request and the waiting party can be signaled by means of a `CountDownLatch`

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

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

- - ### Method Detail

    - #### getAdmin

          public static MessageAdmin getAdmin()

      Get the singleton MessageAdmin object
      Returns:
        singleton instance

    - #### putRequest

          public void putRequest(String id,
                                 javax.jms.Message request,
                                 CountDownLatch latch)

      Store a request under the given id, so that an arriving reply can be associated with this request and the waiting party can be signaled by means of a `CountDownLatch`
      Parameters:
        `id` - id of the request
        `request` - request object to store under id
        `latch` - communication latch to signal when a reply for this request was received

    - #### putReply

          public void putReply(String id,
                               javax.jms.Message reply)

      Try to associate a reply to a previously stored request. If a matching request is found, the owner of the request will be notified with the registered `CountDownLatch`
      Parameters:
        `id` - id of the request
        `reply` - object with the reply

    - #### get

          public javax.jms.Message get(String id)

      Get the reply message.
      Parameters:
        `id` - the id of the message
      Returns:
        the received message or `null`

Copyright © 1998-2022 Apache Software Foundation. All Rights Reserved.