Apache JMeter

org.apache.jmeter.protocol.jms.sampler
Class SubscriberSampler

java.lang.Object
  extended by org.apache.jmeter.testelement.AbstractTestElement
      extended by org.apache.jmeter.samplers.AbstractSampler
          extended by org.apache.jmeter.protocol.jms.sampler.BaseJMSSampler
              extended by org.apache.jmeter.protocol.jms.sampler.SubscriberSampler
All Implemented Interfaces:
Serializable, Cloneable, Interruptible, Sampler, TestElement, ThreadListener

public class SubscriberSampler
extends BaseJMSSampler
implements Interruptible, ThreadListener

This class implements the JMS Subscriber sampler. It supports both receive and onMessage strategies via the ReceiveSubscriber class.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.apache.jmeter.testelement.TestElement
COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS
 
Constructor Summary
SubscriberSampler()
           
 
Method Summary
 String getClientChoice()
          Return the client choice.
 String getDurableSubscriptionId()
           
 String getTimeout()
           
 long getTimeoutAsLong()
           
 boolean interrupt()
          Handle an interrupt of the test.
 boolean isStopBetweenSamples()
           
 SampleResult sample()
          sample method will check which client it should use and call the appropriate client specific sample method.
 void setClientChoice(String choice)
          Set the client choice.
 void setDurableSubscriptionId(String durableSubscriptionId)
           
 void setStopBetweenSamples(boolean selected)
           
 void setTimeout(String timeout)
           
 void threadFinished()
          Close subscriber.
 void threadFinished(boolean wts)
           
 void threadStarted()
          Initialise the thread-local variables.
 void threadStarted(boolean wts)
           
 
Methods inherited from class org.apache.jmeter.protocol.jms.sampler.BaseJMSSampler
getConnectionFactory, getDestination, getIterationCount, getIterations, getJNDIInitialContextFactory, getMessageHeaders, getPassword, getProviderUrl, getReadResponse, getReadResponseAsBoolean, getUseJNDIProperties, getUseJNDIPropertiesAsBoolean, getUsername, isDestinationStatic, isUseAuth, sample, setConnectionFactory, setDestination, setDestinationStatic, setIterations, setJNDIIntialContextFactory, setPassword, setProviderUrl, setReadResponse, setUseAuth, setUseJNDIProperties, setUsername
 
Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement
addProperty, addTestElement, canRemove, clear, clearTemporary, clearTestElementChildren, clone, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, logProperties, mergeIn, propertyIterator, recoverRunningVersion, removeProperty, setComment, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse, traverseCollection, traverseMap, traverseProperty
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.jmeter.testelement.TestElement
addTestElement, canRemove, clear, clearTestElementChildren, clone, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getThreadContext, getThreadName, isEnabled, isRunningVersion, isTemporary, propertyIterator, recoverRunningVersion, removeProperty, setComment, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse
 

Constructor Detail

SubscriberSampler

public SubscriberSampler()
Method Detail

sample

public SampleResult sample()
sample method will check which client it should use and call the appropriate client specific sample method.

Specified by:
sample in class BaseJMSSampler
Returns:
the appropriate sample result

threadStarted

public void threadStarted()
Initialise the thread-local variables.
Called for each thread before starting sampling. WARNING: this is called before any Config test elements are processed, so any properties they define will not have been merged in yet.

Specified by:
threadStarted in interface ThreadListener
See Also:
JMeterThread.threadStarted()

threadStarted

public void threadStarted(boolean wts)

threadFinished

public void threadFinished()
Close subscriber.
Called for each thread after all samples have been processed.

Specified by:
threadFinished in interface ThreadListener
See Also:
JMeterThread.threadFinished()

threadFinished

public void threadFinished(boolean wts)

interrupt

public boolean interrupt()
Handle an interrupt of the test.

Specified by:
interrupt in interface Interruptible
Returns:
true if there was an operation to interrupt.

setClientChoice

public void setClientChoice(String choice)
Set the client choice. There are two options: ReceiveSusbscriber and OnMessageSubscriber.


getClientChoice

public String getClientChoice()
Return the client choice.

Returns:
the client choice, either RECEIVE_RSC or ON_MESSAGE_RSC

getTimeout

public String getTimeout()

getTimeoutAsLong

public long getTimeoutAsLong()

setTimeout

public void setTimeout(String timeout)

getDurableSubscriptionId

public String getDurableSubscriptionId()

setDurableSubscriptionId

public void setDurableSubscriptionId(String durableSubscriptionId)

isStopBetweenSamples

public boolean isStopBetweenSamples()

setStopBetweenSamples

public void setStopBetweenSamples(boolean selected)

Apache JMeter

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