Package com.sun.ts.tests.jms.common
Class SessionThread
java.lang.Object
java.lang.Thread
com.sun.ts.tests.jms.common.SessionThread
- All Implemented Interfaces:
- Runnable
Class Declaration.
- 
Nested Class SummaryNested classes/interfaces inherited from class java.lang.ThreadThread.State, Thread.UncaughtExceptionHandler
- 
Field SummaryFields inherited from class java.lang.ThreadMAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
- 
Constructor SummaryConstructorsConstructorDescriptionSessionThread(jakarta.jms.QueueConnection qC, jakarta.jms.TopicConnection tC) Default constructor creates Session Thread with connections specified.
- 
Method SummaryModifier and TypeMethodDescriptionvoidcreateConsumer(jakarta.jms.Destination dest) Create message consumersvoidcreateProducer(jakarta.jms.Destination dest) Create message producersintGet the number of messages that have been received by this thread.jakarta.jms.QueueSessionReturn the current QueueSessionjakarta.jms.TopicSessionReturn the current TopicSessionvoidReset the number of messages that have been received by this thread.voidrun()Run methodvoidsetQueueSession(boolean transacted, int mode) Method for specifying the QueueSession attributes.voidsetReplyToMessages(boolean boo) Set to true to have SessionThread reply automatically to messages.voidsetStayAlive(boolean boo) Set to true to have SessionThread keep receiving messages indefinitely.voidsetTopicSession(boolean transacted, int mode) Method for specifying the TopicSession attributes..voidUsed to start the Queue and Topic Connections when they are not the default Connections.voidUsed to start only the specified Connection.voidUsed to start only the specified Connection.voidStop itMethods inherited from class java.lang.ThreadactiveCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
- 
Constructor Details- 
SessionThreadpublic SessionThread(jakarta.jms.QueueConnection qC, jakarta.jms.TopicConnection tC) throws jakarta.jms.JMSException Default constructor creates Session Thread with connections specified.- Parameters:
- QueueConnection- for creating QueueSessions
- TopicConnection- for creating TopicSessions
- Throws:
- jakarta.jms.JMSException
 
 
- 
- 
Method Details- 
setQueueSessionpublic void setQueueSession(boolean transacted, int mode) throws jakarta.jms.JMSException Method for specifying the QueueSession attributes.- Parameters:
- boolean- transacted
- int- acknowledgement mode
- Throws:
- jakarta.jms.JMSException
 
- 
setTopicSessionpublic void setTopicSession(boolean transacted, int mode) throws jakarta.jms.JMSException Method for specifying the TopicSession attributes..- Parameters:
- boolean- transacted
- int- acknowledgement mode
- Throws:
- jakarta.jms.JMSException
 
- 
getQueueSessionpublic jakarta.jms.QueueSession getQueueSession()Return the current QueueSession- Returns:
- QueueSession the current QueueSession for this client
 
- 
getTopicSessionpublic jakarta.jms.TopicSession getTopicSession()Return the current TopicSession- Returns:
- TopicSession the current TopicSession for this client
 
- 
startConnectionpublic void startConnection() throws jakarta.jms.JMSExceptionUsed to start the Queue and Topic Connections when they are not the default Connections. May also be used in place of someConnection.start() within the main testing method.- Throws:
- jakarta.jms.JMSException
 
- 
startQueueConnectionUsed to start only the specified Connection. Useful when it is not the default Connection.- Throws:
- Exception
 
- 
startTopicConnectionUsed to start only the specified Connection. Useful when it is not the default Connection.- Throws:
- Exception
 
- 
createProducerCreate message producers- Parameters:
- Destination- Queue or Topic
- Throws:
- Exception
 
- 
createConsumerCreate message consumers- Parameters:
- Destination- Queue or Topic
- Throws:
- Exception
 
- 
setReplyToMessagespublic void setReplyToMessages(boolean boo) Set to true to have SessionThread reply automatically to messages.- Parameters:
- boolean- true for automatic request/reply
 
- 
setStayAlivepublic void setStayAlive(boolean boo) Set to true to have SessionThread keep receiving messages indefinitely.- Parameters:
- boolean- true for indefinite receive()
 
- 
getMessagesReceivedCountpublic int getMessagesReceivedCount()Get the number of messages that have been received by this thread.- Returns:
- int number of messages received
 
- 
resetMessagesReceivedCountpublic void resetMessagesReceivedCount()Reset the number of messages that have been received by this thread. Useful once "steady-state" has been reached.
- 
stopWaitingpublic void stopWaiting() throws jakarta.jms.JMSExceptionStop it- Throws:
- jakarta.jms.JMSException
 
- 
runpublic void run()Run method
 
-