public class ThreadAwareContext extends Object
Constructor and Description |
---|
ThreadAwareContext() |
Modifier and Type | Method and Description |
---|---|
void |
assertNotCompletionListenerThread()
|
void |
assertNotCompletionListenerThreadRuntime()
Asserts a
CompletionListener is not calling from its own JMSContext . |
void |
assertNotMessageListenerThread()
|
void |
assertNotMessageListenerThreadRuntime()
Asserts a
MessageListener is not calling from its own JMSContext . |
void |
clearCurrentThread(boolean isCompletionListener)
Clear current thread from the context
|
void |
setCurrentThread(boolean isCompletionListener)
Sets current thread to the context
|
public void setCurrentThread(boolean isCompletionListener)
Meant to inform an JMSContext which is the thread that CANNOT call some of its methods.
isCompletionListener
- : indicating whether current thread is from CompletionListener
or from MessageListener.public void clearCurrentThread(boolean isCompletionListener)
isCompletionListener
- : indicating whether current thread is from CompletionListener
or from MessageListener.public void assertNotCompletionListenerThreadRuntime()
CompletionListener
is not calling from its own JMSContext
.
Note that the code must work without any need for further synchronization, as there is the requirement that only one CompletionListener be called at a time. In other words, CompletionListener calling is single-threaded.
public void assertNotCompletionListenerThread() throws IllegalStateException
CompletionListener
is not calling from its own Connection
or from
a MessageProducer
.
Note that the code must work without any need for further synchronization, as there is the requirement that only one CompletionListener be called at a time. In other words, CompletionListener calling is single-threaded.
IllegalStateException
Connection.close()
,
MessageProducer.close()
public void assertNotMessageListenerThreadRuntime()
MessageListener
is not calling from its own JMSContext
.
Note that the code must work without any need for further synchronization, as there is the requirement that only one MessageListener be called at a time. In other words, MessageListener calling is single-threaded.
JMSContext.close()
,
JMSContext.stop()
public void assertNotMessageListenerThread() throws IllegalStateException
MessageListener
is not calling from its own Connection
or
MessageConsumer
.
Note that the code must work without any need for further synchronization, as there is the requirement that only one MessageListener be called at a time. In other words, MessageListener calling is single-threaded.
IllegalStateException
Connection.close()
,
MessageConsumer.close()
Copyright © 2021 JBoss by Red Hat. All rights reserved.