# Class JMSSampler

java.lang.Object
org.apache.jmeter.testelement.AbstractTestElement
org.apache.jmeter.samplers.AbstractSampler
org.apache.jmeter.protocol.jms.sampler.JMSSampler

All Implemented Interfaces:
  `Serializable, Cloneable, ConfigMergabilityIndicator, Searchable, Sampler, TestElement, ThreadListener`

public class JMSSampler extends AbstractSampler implements ThreadListener
This class implements the JMS Point-to-Point sampler

See Also:
  - Serialized Form

## Field Summary

### Fields inherited from interface TestElement

`COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS`

## Constructor Summary

Constructors
Constructor
Description
`JMSSampler()`

## Method Summary

Modifier and Type
Method
Description
`Arguments`
`getArguments(String name)`
`String`
`getContent()`
`String`
`getContextProvider()`
`String`
`getExpiration()`
`String`
`getInitialContextFactory()`
`JMSProperties`
`getJMSProperties()`
`String`
`getJMSSelector()`
`Arguments`
`getJNDIProperties()`
`String`
`getPriority()`
`String`
`getQueueConnectionFactory()`
`String`
`getReceiveQueue()`
`String`
`getSendQueue()`
`String`
`getTimeout()`
`boolean`
`isNonPersistent()`
`boolean`
`isOneway()`
`boolean`
`isUseReqMsgIdAsCorrelId()`
Which request field to use for correlation?
`boolean`
`isUseResMsgIdAsCorrelId()`
Which response field to use for correlation?
`SampleResult`
`sample(Entry entry)`
Obtains statistics about the given Entry, and packages the information into a SampleResult.
`void`
`setArguments(Arguments args)`
`void`
`setContent(String content)`
`void`
`setContextProvider(String string)`
`void`
`setExpiration(String s)`
`void`
`setInitialContextFactory(String string)`
`void`
`setIsOneway(boolean isOneway)`
`void`
`setJMSProperties(JMSProperties jmsProperties)`
`void`
`setJMSSelector(String selector)`
`void`
`setJNDIProperties(Arguments args)`
`void`
`setNonPersistent(boolean value)`
`void`
`setPriority(String s)`
`void`
`setQueueConnectionFactory(String qcf)`
`void`
`setReceiveQueue(String name)`
`void`
`setSendQueue(String name)`
`void`
`setTimeout(String s)`
`void`
`setUseReqMsgIdAsCorrelId(boolean value)`
`void`
`setUseResMsgIdAsCorrelId(boolean value)`
`void`
`threadFinished()`
Called for each thread after all samples have been processed.
`void`
`threadStarted()`
Called for each thread before starting sampling.
`String`
`toString()`

### Methods inherited from class AbstractSampler

`applies`

### Methods inherited from class AbstractTestElement

`addPropertiesValues, addProperty, addProperty, addTestElement, canRemove, clear, clearTemporary, clearTestElementChildren, clone, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getSearchableTokens, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, logProperties, mergeIn, propertyIterator, recoverRunningVersion, removeProperty, setComment, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse, traverseCollection, traverseMap, traverseProperty`

### Methods inherited from class Object

`finalize, getClass, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface 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, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse`

## Constructor Details

### JMSSampler

public JMSSampler()

## Method Details

### sample

public SampleResult sample(Entry entry)
Obtains statistics about the given Entry, and packages the information into a SampleResult.

Specified by:
  `sample` in interface `Sampler`
Parameters:
  `entry` - the Entry (TODO seems to be unused)
Returns:
  information about the sample

### getJMSProperties

public JMSProperties getJMSProperties()

Returns:
  `JMSProperties` JMS Properties

### setJMSProperties

public void setJMSProperties(JMSProperties jmsProperties)

Parameters:
  `jmsProperties` - JMS Properties

### getJNDIProperties

public Arguments getJNDIProperties()

### setJNDIProperties

public void setJNDIProperties(Arguments args)

### getQueueConnectionFactory

public String getQueueConnectionFactory()

### setQueueConnectionFactory

public void setQueueConnectionFactory(String qcf)

### getSendQueue

public String getSendQueue()

### setSendQueue

public void setSendQueue(String name)

### getReceiveQueue

public String getReceiveQueue()

### setReceiveQueue

public void setReceiveQueue(String name)

### getContent

public String getContent()

### setContent

public void setContent(String content)

### isOneway

public boolean isOneway()

### isNonPersistent

public boolean isNonPersistent()

### isUseReqMsgIdAsCorrelId

public boolean isUseReqMsgIdAsCorrelId()
Which request field to use for correlation?

Returns:
  true if correlation should use the request JMSMessageID rather than JMSCorrelationID

### isUseResMsgIdAsCorrelId

public boolean isUseResMsgIdAsCorrelId()
Which response field to use for correlation?

Returns:
  true if correlation should use the response JMSMessageID rather than JMSCorrelationID

### getInitialContextFactory

public String getInitialContextFactory()

### getContextProvider

public String getContextProvider()

### setIsOneway

public void setIsOneway(boolean isOneway)

### setNonPersistent

public void setNonPersistent(boolean value)

### setUseReqMsgIdAsCorrelId

public void setUseReqMsgIdAsCorrelId(boolean value)

### setUseResMsgIdAsCorrelId

public void setUseResMsgIdAsCorrelId(boolean value)

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### threadStarted

public void threadStarted()
Description copied from interface: `ThreadListener`
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()`

### getTimeout

public String getTimeout()

### getExpiration

public String getExpiration()

### getPriority

public String getPriority()

### threadFinished

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

Specified by:
  `threadFinished` in interface `ThreadListener`
See Also:
  - `JMeterThread.threadFinished(org.apache.jmeter.engine.event.LoopIterationListener)`

### setArguments

public void setArguments(Arguments args)

### getArguments

public Arguments getArguments(String name)

### setTimeout

public void setTimeout(String s)

### setPriority

public void setPriority(String s)

### setExpiration

public void setExpiration(String s)

### getJMSSelector

public String getJMSSelector()

Returns:
  String JMS Selector

### setJMSSelector

public void setJMSSelector(String selector)

Parameters:
  `selector` - String selector

### setInitialContextFactory

public void setInitialContextFactory(String string)

Parameters:
  `string` - name of the initial context factory to use

### setContextProvider

public void setContextProvider(String string)

Parameters:
  `string` - url of the provider