org.apache.jmeter.protocol.jms.client

## Class ClientPool

- java.lang.Object
- - org.apache.jmeter.protocol.jms.client.ClientPool

-     public class ClientPool
      extends java.lang.Object

  ClientPool holds the client instances in an ArrayList. The main purpose of this is to make it easier to clean up all the instances at the end of a test. If we didn't do this, threads might become zombie. N.B. This class is thread safe as it is called from sample threads and the thread that runs testEnded() methods.

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `addClient(java.io.Closeable client)` Add a ReceiveClient to the ClientPool.
    `static void` | `clearClient()` Clear all the clients created by either Publish or Subscribe sampler.
    `static void` | `removeClient(Publisher publisher)` Remove publisher from clients

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

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

- - ### Method Detail

    - #### addClient

          public static void addClient(java.io.Closeable client)

      Add a ReceiveClient to the ClientPool. This is so that we can make sure to close all clients and make sure all threads are destroyed.
      Parameters:
        `client` - the ReceiveClient to add

    - #### removeClient

          public static void removeClient(Publisher publisher)

      Remove publisher from clients
      Parameters:
        `publisher` - `Publisher`

    - #### clearClient

          public static void clearClient()

      Clear all the clients created by either Publish or Subscribe sampler. We need to do this to make sure all the threads created during the test are destroyed and cleaned up. In some cases, the client provided by the manufacturer of the JMS server may have bugs and some threads may become zombie. In those cases, it is not JMeter's responsibility.

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