org.apache.jmeter.protocol.jms.client
Class OnMessageSubscriber
public class OnMessageSubscriber
OnMessageSubscriber is designed to create the connection, session and
subscriber. The sampler is responsible for implementing
javax.jms.MessageListener interface and onMessage(Message msg) method.
The implementation provides a close() method to clean up the client at the
end of a test. This is important to make sure there aren't any zombie threads
or odd memory leaks.
OnMessageSubscriber()
|
OnMessageSubscriber(boolean useProps, String jndi, String url, String connfactory, String topic, boolean useAuth, String user, String pwd) - Constructor takes the necessary JNDI related parameters to create a
connection and begin receiving messages.
|
void | close() - close will close all the objects and set them to null.
|
void | initConnection(Context ctx, String connfactory, String topic) - Initialize the connection, session and subscriber
|
Context | initJNDI(boolean useProps, String jndi, String url, boolean useAuth, String user, String pwd) - initialize the JNDI intial context
|
void | resume() - resume will call Connection.start() to begin receiving inbound messages.
|
void | setMessageListener(MessageListener listener) - The sample uses this method to set itself as the listener.
|
OnMessageSubscriber
public OnMessageSubscriber()
OnMessageSubscriber
public OnMessageSubscriber(boolean useProps,
String jndi,
String url,
String connfactory,
String topic,
boolean useAuth,
String user,
String pwd)
Constructor takes the necessary JNDI related parameters to create a
connection and begin receiving messages.
useProps
- jndi
- url
- connfactory
- topic
- useAuth
- user
- pwd
-
close
public void close()
close will close all the objects and set them to null.
initConnection
public void initConnection(Context ctx,
String connfactory,
String topic)
Initialize the connection, session and subscriber
ctx
- connfactory
- topic
-
initJNDI
public Context initJNDI(boolean useProps,
String jndi,
String url,
boolean useAuth,
String user,
String pwd)
initialize the JNDI intial context
useProps
- jndi
- url
- useAuth
- user
- pwd
-
resume
public void resume()
resume will call Connection.start() to begin receiving inbound messages.
setMessageListener
public void setMessageListener(MessageListener listener)
The sample uses this method to set itself as the listener. That means the
sampler need to implement MessageListener interface.
Copyright © 1998-2010 Apache Software Foundation. All Rights Reserved.