org.apache.jmeter.protocol.jms.sampler

Class SubscriberSampler

Implemented Interfaces:
Cloneable, MessageListener, Sampler, Serializable, TestElement, TestListener

public class SubscriberSampler
extends BaseJMSSampler
implements TestListener, MessageListener

This class implements the JMS Subcriber sampler

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.
void
onMessage(Message message)
The sampler implements MessageListener directly and sets itself as the listener with the TopicSubscriber.
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
testEnded()
testEnded is called by Jmeter's engine.
void
testEnded(String test)
void
testIterationStart(LoopIterationEvent event)
void
testStarted()
void
testStarted(String test)

Methods inherited from class org.apache.jmeter.protocol.jms.sampler.BaseJMSSampler

getConnectionFactory, getIterationCount, getIterations, getJNDIInitialContextFactory, getPassword, getProviderUrl, getReadResponse, getReadResponseAsBoolean, getTopic, getUseJNDIProperties, getUseJNDIPropertiesAsBoolean, getUsername, isUseAuth, sample, sample, setConnectionFactory, setIterations, setJNDIIntialContextFactory, setPassword, setProviderUrl, setReadResponse, setTopic, setUseAuth, setUseJNDIProperties, setUsername

Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement

addProperty, addTestElement, canRemove, clear, clearTemporary, clone, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, 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

Constructor Details

SubscriberSampler

public SubscriberSampler()

Method Details

getClientChoice

public String getClientChoice()
Return the client choice.
Returns:
the client choice, either RECEIVE_RSC or ON_MESSAGE_RSC

onMessage

public void onMessage(Message message)
The sampler implements MessageListener directly and sets itself as the listener with the TopicSubscriber.

sample

public SampleResult sample()
sample method will check which client it should use and call the appropriate client specific sample method.
Overrides:
sample in interface BaseJMSSampler
Returns:
the appropriate sample result

setClientChoice

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

testEnded

public void testEnded()
testEnded is called by Jmeter's engine. Clears the client pool.
Specified by:
testEnded in interface TestListener

testEnded

public void testEnded(String test)
Specified by:
testEnded in interface TestListener

testIterationStart

public void testIterationStart(LoopIterationEvent event)
Specified by:
testIterationStart in interface TestListener

testStarted

public void testStarted()
Specified by:
testStarted in interface TestListener

testStarted

public void testStarted(String test)
Specified by:
testStarted in interface TestListener

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