Apache JMeter

org.apache.jmeter.protocol.jms.client
Class ReceiveSubscriber

java.lang.Object
  extended byorg.apache.jmeter.protocol.jms.client.ReceiveSubscriber
All Implemented Interfaces:
Runnable

public class ReceiveSubscriber
extends Object
implements Runnable


Constructor Summary
ReceiveSubscriber()
           
ReceiveSubscriber(boolean useProps, String jndi, String url, String connfactory, String topic, String useAuth, String user, String pwd)
           
 
Method Summary
 void clear()
          Clear will set the buffer to zero and the result objects to null.
 void close()
          close() will stop the connection first.
 int count(int increment)
          Increment the count and return the new value
 byte[] getByteResult()
          Get the message(s) as an array of byte[]
 String getMessage()
          Get the message as a string
 void initConnection(Context ctx, String connfactory, String topic)
          Create the connection, session and topic subscriber
 Context initJNDI(boolean useProps, String jndi, String url, String useAuth, String user, String pwd)
          Initialize the JNDI initial context
protected  void listen()
          Listen for inbound messages
 int resetCount()
          Reset will reset the counter and prepare for the next sample() call.
 void resume()
          Resume will call Connection.start() and begin receiving messages from the JMS provider.
 void run()
          run calls listen to begin listening for inboud messages from the provider.
 void setLoop(int loop)
          Set the number of iterations for each call to sample()
 void start()
          start will create a new thread and pass this class. once the thread is created, it calls Thread.start().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReceiveSubscriber

public ReceiveSubscriber()

ReceiveSubscriber

public ReceiveSubscriber(boolean useProps,
                         String jndi,
                         String url,
                         String connfactory,
                         String topic,
                         String useAuth,
                         String user,
                         String pwd)
Method Detail

initJNDI

public Context initJNDI(boolean useProps,
                        String jndi,
                        String url,
                        String useAuth,
                        String user,
                        String pwd)
Initialize the JNDI initial context

Parameters:
useProps -
jndi -
url -
useAuth -
user -
pwd -
Returns:
the JNDI initial context or null

initConnection

public void initConnection(Context ctx,
                           String connfactory,
                           String topic)
Create the connection, session and topic subscriber

Parameters:
ctx -
connfactory -
topic -

setLoop

public void setLoop(int loop)
Set the number of iterations for each call to sample()

Parameters:
loop -

resume

public void resume()
Resume will call Connection.start() and begin receiving messages from the JMS provider.


getMessage

public String getMessage()
Get the message as a string


getByteResult

public byte[] getByteResult()
Get the message(s) as an array of byte[]


close

public void close()
close() will stop the connection first. Then it closes the subscriber, session and connection and sets them to null.


clear

public void clear()
Clear will set the buffer to zero and the result objects to null. Clear should be called at the end of a sample.


count

public int count(int increment)
Increment the count and return the new value

Parameters:
increment -

resetCount

public int resetCount()
Reset will reset the counter and prepare for the next sample() call.


start

public void start()
start will create a new thread and pass this class. once the thread is created, it calls Thread.start().


run

public void run()
run calls listen to begin listening for inboud messages from the provider.

Specified by:
run in interface Runnable

listen

protected void listen()
Listen for inbound messages


Apache JMeter

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