|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbitronix.tm.resource.common.AbstractXAStatefulHolder
bitronix.tm.resource.common.AbstractXAResourceHolder
bitronix.tm.resource.jms.DualSessionWrapper
public class DualSessionWrapper
JMS Session wrapper that will send calls to either a XASession or to a non-XA Session depending on the calling context.
Field Summary |
---|
Fields inherited from interface javax.jms.Session |
---|
AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, SESSION_TRANSACTED |
Fields inherited from interface bitronix.tm.resource.common.XAStatefulHolder |
---|
STATE_ACCESSIBLE, STATE_CLOSED, STATE_IN_POOL, STATE_NOT_ACCESSIBLE |
Constructor Summary | |
---|---|
DualSessionWrapper(JmsPooledConnection pooledConnection,
boolean transacted,
int acknowledgeMode)
|
Method Summary | |
---|---|
void |
close()
Close the physical connection that this XAStatefulHolder represents. |
void |
commit()
|
javax.jms.QueueBrowser |
createBrowser(javax.jms.Queue queue)
|
javax.jms.QueueBrowser |
createBrowser(javax.jms.Queue queue,
String messageSelector)
|
javax.jms.BytesMessage |
createBytesMessage()
|
javax.jms.MessageConsumer |
createConsumer(javax.jms.Destination destination)
|
javax.jms.MessageConsumer |
createConsumer(javax.jms.Destination destination,
String messageSelector)
|
javax.jms.MessageConsumer |
createConsumer(javax.jms.Destination destination,
String messageSelector,
boolean noLocal)
|
javax.jms.TopicSubscriber |
createDurableSubscriber(javax.jms.Topic topic,
String name)
|
javax.jms.TopicSubscriber |
createDurableSubscriber(javax.jms.Topic topic,
String name,
String messageSelector,
boolean noLocal)
|
javax.jms.MapMessage |
createMapMessage()
|
javax.jms.Message |
createMessage()
|
javax.jms.ObjectMessage |
createObjectMessage()
|
javax.jms.ObjectMessage |
createObjectMessage(Serializable serializable)
|
javax.jms.MessageProducer |
createProducer(javax.jms.Destination destination)
|
javax.jms.Queue |
createQueue(String queueName)
|
javax.jms.StreamMessage |
createStreamMessage()
|
javax.jms.TemporaryQueue |
createTemporaryQueue()
|
javax.jms.TemporaryTopic |
createTemporaryTopic()
|
javax.jms.TextMessage |
createTextMessage()
|
javax.jms.TextMessage |
createTextMessage(String text)
|
javax.jms.Topic |
createTopic(String topicName)
|
protected void |
enlistResource()
Enlist this session into the current transaction if automaticEnlistingEnabled = true for this resource. |
int |
getAcknowledgeMode()
|
Object |
getConnectionHandle()
Create a disposable handler used to drive a pooled instance of XAStatefulHolder . |
Date |
getLastReleaseDate()
Get the date at which this object was last released to the pool. |
javax.jms.MessageListener |
getMessageListener()
|
PoolingConnectionFactory |
getPoolingConnectionFactory()
|
ResourceBean |
getResourceBean()
Get the ResourceBean which created this XAResourceHolder. |
javax.jms.Session |
getSession()
|
javax.jms.Session |
getSession(boolean forceXa)
|
boolean |
getTransacted()
|
XAResource |
getXAResource()
Get the vendor's XAResource implementation of the wrapped resource. |
List<XAResourceHolder> |
getXAResourceHolders()
Get the list of XAResourceHolder s created by this
XAStatefulHolder that are still open. |
void |
recover()
|
void |
rollback()
|
void |
run()
|
void |
setMessageListener(javax.jms.MessageListener listener)
|
void |
stateChanged(XAStatefulHolder source,
int oldState,
int newState)
Fired when the internal state of a XAStatefulHolder has changed. |
void |
stateChanging(XAStatefulHolder source,
int currentState,
int futureState)
Fired before the internal state of a XAStatefulHolder has changed. |
String |
toString()
|
void |
unsubscribe(String name)
|
Methods inherited from class bitronix.tm.resource.common.AbstractXAResourceHolder |
---|
getXAResourceHolderStateGtrids, getXAResourceHolderStatesForGtrid, hasStateForXAResource, isParticipatingInActiveGlobalTransaction, putXAResourceHolderState, removeXAResourceHolderState |
Methods inherited from class bitronix.tm.resource.common.AbstractXAStatefulHolder |
---|
addStateChangeEventListener, getState, removeStateChangeEventListener, setState |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface bitronix.tm.resource.common.XAStatefulHolder |
---|
addStateChangeEventListener, getState, removeStateChangeEventListener, setState |
Constructor Detail |
---|
public DualSessionWrapper(JmsPooledConnection pooledConnection, boolean transacted, int acknowledgeMode)
Method Detail |
---|
public PoolingConnectionFactory getPoolingConnectionFactory()
public javax.jms.Session getSession() throws javax.jms.JMSException
javax.jms.JMSException
public javax.jms.Session getSession(boolean forceXa) throws javax.jms.JMSException
javax.jms.JMSException
public String toString()
toString
in class Object
public void close() throws javax.jms.JMSException
XAStatefulHolder
XAStatefulHolder
represents.
close
in interface XAStatefulHolder
close
in interface javax.jms.Session
javax.jms.JMSException
public Date getLastReleaseDate()
XAStatefulHolder
getLastReleaseDate
in interface XAStatefulHolder
public void stateChanged(XAStatefulHolder source, int oldState, int newState)
StateChangeListener
XAStatefulHolder
has changed.
stateChanged
in interface StateChangeListener
source
- the XAStatefulHolder
changing state.oldState
- the old state of the XAStatefulHolder
.newState
- the new state of the XAStatefulHolder
.public void stateChanging(XAStatefulHolder source, int currentState, int futureState)
StateChangeListener
XAStatefulHolder
has changed.
stateChanging
in interface StateChangeListener
source
- the XAStatefulHolder
changing state.currentState
- the current state of the XAStatefulHolder
.futureState
- the future state of the XAStatefulHolder
.public javax.jms.MessageProducer createProducer(javax.jms.Destination destination) throws javax.jms.JMSException
createProducer
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.MessageConsumer createConsumer(javax.jms.Destination destination) throws javax.jms.JMSException
createConsumer
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.MessageConsumer createConsumer(javax.jms.Destination destination, String messageSelector) throws javax.jms.JMSException
createConsumer
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.MessageConsumer createConsumer(javax.jms.Destination destination, String messageSelector, boolean noLocal) throws javax.jms.JMSException
createConsumer
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.TopicSubscriber createDurableSubscriber(javax.jms.Topic topic, String name) throws javax.jms.JMSException
createDurableSubscriber
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.TopicSubscriber createDurableSubscriber(javax.jms.Topic topic, String name, String messageSelector, boolean noLocal) throws javax.jms.JMSException
createDurableSubscriber
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.MessageListener getMessageListener() throws javax.jms.JMSException
getMessageListener
in interface javax.jms.Session
javax.jms.JMSException
public void setMessageListener(javax.jms.MessageListener listener) throws javax.jms.JMSException
setMessageListener
in interface javax.jms.Session
javax.jms.JMSException
public void run()
run
in interface Runnable
run
in interface javax.jms.Session
public XAResource getXAResource()
XAResourceHolder
XAResource
implementation of the wrapped resource.
getXAResource
in interface XAResourceHolder
public ResourceBean getResourceBean()
XAResourceHolder
getResourceBean
in interface XAResourceHolder
public List<XAResourceHolder> getXAResourceHolders()
XAStatefulHolder
XAResourceHolder
s created by this
XAStatefulHolder
that are still open.
This method is thread-safe.
getXAResourceHolders
in interface XAStatefulHolder
XAResourceHolder
s created by this
XAStatefulHolder
that are still open.public Object getConnectionHandle() throws Exception
XAStatefulHolder
XAStatefulHolder
.
This method is thread-safe.
getConnectionHandle
in interface XAStatefulHolder
Exception
- a resource-specific exception thrown when the disaposable connection cannot be created.public boolean getTransacted() throws javax.jms.JMSException
getTransacted
in interface javax.jms.Session
javax.jms.JMSException
public int getAcknowledgeMode() throws javax.jms.JMSException
getAcknowledgeMode
in interface javax.jms.Session
javax.jms.JMSException
public void commit() throws javax.jms.JMSException
commit
in interface javax.jms.Session
javax.jms.JMSException
public void rollback() throws javax.jms.JMSException
rollback
in interface javax.jms.Session
javax.jms.JMSException
public void recover() throws javax.jms.JMSException
recover
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue) throws javax.jms.JMSException
createBrowser
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue, String messageSelector) throws javax.jms.JMSException
createBrowser
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.BytesMessage createBytesMessage() throws javax.jms.JMSException
createBytesMessage
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.MapMessage createMapMessage() throws javax.jms.JMSException
createMapMessage
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.Message createMessage() throws javax.jms.JMSException
createMessage
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.ObjectMessage createObjectMessage() throws javax.jms.JMSException
createObjectMessage
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.ObjectMessage createObjectMessage(Serializable serializable) throws javax.jms.JMSException
createObjectMessage
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.StreamMessage createStreamMessage() throws javax.jms.JMSException
createStreamMessage
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.TextMessage createTextMessage() throws javax.jms.JMSException
createTextMessage
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.TextMessage createTextMessage(String text) throws javax.jms.JMSException
createTextMessage
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.Queue createQueue(String queueName) throws javax.jms.JMSException
createQueue
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.Topic createTopic(String topicName) throws javax.jms.JMSException
createTopic
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.TemporaryQueue createTemporaryQueue() throws javax.jms.JMSException
createTemporaryQueue
in interface javax.jms.Session
javax.jms.JMSException
public javax.jms.TemporaryTopic createTemporaryTopic() throws javax.jms.JMSException
createTemporaryTopic
in interface javax.jms.Session
javax.jms.JMSException
public void unsubscribe(String name) throws javax.jms.JMSException
unsubscribe
in interface javax.jms.Session
javax.jms.JMSException
protected void enlistResource() throws javax.jms.JMSException
javax.jms.JMSException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |