org.apache.jmeter.protocol.jms.client

Class ClientPool


public class ClientPool
extends 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 needs to be fully synchronized as it is called from sample threads and the thread that runs testEnded() methods.

Method Summary

static void
addClient(OnMessageSubscriber client)
Add a OnMessageClient to the ClientPool.
static void
addClient(Publisher client)
Add a Publisher to the ClientPool.
static void
addClient(ReceiveSubscriber client)
Add a ReceiveClient to the ClientPool.
static void
clearClient()
Clear all the clients created by either Publish or Subscribe sampler.
static Object
get(Object key)
static void
put(Object key, OnMessageSubscriber client)
static void
put(Object key, Publisher client)

Method Details

addClient

public static void addClient(OnMessageSubscriber client)
Add a OnMessageClient to the ClientPool. This is so that we can make sure to close all clients and make sure all threads are destroyed.
Parameters:
client -

addClient

public static void addClient(Publisher client)
Add a Publisher to the ClientPool. This is so that we can make sure to close all clients and make sure all threads are destroyed.
Parameters:
client -

addClient

public static void addClient(ReceiveSubscriber 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 -

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 creatd 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 the responsibility of JMeter for those bugs.

get

public static Object get(Object key)

put

public static void put(Object key,
                       OnMessageSubscriber client)

put

public static void put(Object key,
                       Publisher client)

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