|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.caucho.jms.connection.JmsSession
public class JmsSession
Manages the JMS session.
| Field Summary | |
|---|---|
protected static L10N |
L
|
protected static java.util.logging.Logger |
log
|
| Fields inherited from interface javax.jms.Session |
|---|
AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, SESSION_TRANSACTED |
| Fields inherited from interface javax.transaction.xa.XAResource |
|---|
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY |
| Constructor Summary | |
|---|---|
JmsSession(ConnectionImpl connection,
boolean isTransacted,
int ackMode,
boolean isXA)
|
|
| Method Summary | |
|---|---|
void |
acknowledge()
Acknowledge received |
protected void |
addConsumer(MessageConsumerImpl consumer)
|
void |
checkOpen()
Checks that the session is open. |
void |
close()
Closes the session |
void |
commit()
Commits the messages. |
void |
commit(Xid xid,
boolean onePhase)
Called to commit. |
QueueBrowser |
createBrowser(Queue queue)
Creates a QueueBrowser to browse messages in the queue. |
QueueBrowser |
createBrowser(Queue queue,
java.lang.String messageSelector)
Creates a QueueBrowser to browse messages in the queue. |
BytesMessage |
createBytesMessage()
Creates a new byte[] message. |
MessageConsumer |
createConsumer(Destination destination)
Creates a consumer to receive messages. |
MessageConsumer |
createConsumer(Destination destination,
java.lang.String messageSelector)
Creates a consumer to receive messages. |
MessageConsumer |
createConsumer(Destination destination,
java.lang.String messageSelector,
boolean noLocal)
Creates a consumer to receive messages. |
TopicSubscriber |
createDurableSubscriber(Topic topic,
java.lang.String name)
Creates a durable subscriber to receive messages. |
TopicSubscriber |
createDurableSubscriber(Topic topic,
java.lang.String name,
java.lang.String messageSelector,
boolean noLocal)
Creates a subscriber to receive messages. |
MapMessage |
createMapMessage()
Creates a new map message. |
Message |
createMessage()
Creates a message. |
ObjectMessage |
createObjectMessage()
Creates an object message. |
ObjectMessage |
createObjectMessage(java.io.Serializable obj)
Creates an object message. |
MessageProducer |
createProducer(Destination destination)
Creates a producer to produce messages. |
Queue |
createQueue(java.lang.String queueName)
Creates a new queue. |
StreamMessage |
createStreamMessage()
Creates a stream message. |
TemporaryQueue |
createTemporaryQueue()
Creates a temporary queue. |
TemporaryTopic |
createTemporaryTopic()
Creates a temporary topic. |
TextMessage |
createTextMessage()
Creates a text message. |
TextMessage |
createTextMessage(java.lang.String message)
Creates a text message. |
Topic |
createTopic(java.lang.String topicName)
Creates a new topic. |
void |
end(Xid xid,
int flags)
Called when the resource is is done with a transaction. |
void |
forget(Xid xid)
Called to forget an Xid that had a heuristic commit. |
int |
getAcknowledgeMode()
Returns the acknowledge mode for the session. |
java.lang.String |
getClientID()
Returns the connection's clientID |
MessageListener |
getMessageListener()
Returns the message listener |
Session |
getSession()
|
boolean |
getTransacted()
Returns true if the session is in a transaction. |
int |
getTransactionTimeout()
Gets the transaction timeout in seconds. |
XAResource |
getXAResource()
|
boolean |
isActive()
Returns true if the connection is active. |
boolean |
isClosed()
|
boolean |
isSameRM(XAResource xa)
Returns true if the specified resource has the same RM. |
int |
prepare(Xid xid)
Called to start the first phase of the commit. |
void |
recover()
Recovers the messages. |
Xid[] |
recover(int flag)
Called to find Xid's that need recovery. |
protected void |
removeConsumer(MessageConsumerImpl consumer)
|
void |
rollback()
Rollsback the messages. |
void |
rollback(Xid xid)
Called to roll back. |
void |
rollbackImpl()
Rollsback the messages. |
void |
run()
Called to synchronously receive messages |
void |
send(AbstractDestination queue,
Message appMessage,
int deliveryMode,
int priority,
long timeout)
Adds a message to the session message queue. |
void |
setMessageListener(MessageListener listener)
Sets the message listener |
boolean |
setTransactionTimeout(int timeout)
Sets the transaction timeout in seconds. |
void |
start(Xid xid,
int flags)
Called when the resource is associated with a transaction. |
java.lang.String |
toString()
|
void |
unsubscribe(java.lang.String name)
Unsubscribe from a durable subscription. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final java.util.logging.Logger log
protected static final L10N L
| Constructor Detail |
|---|
public JmsSession(ConnectionImpl connection,
boolean isTransacted,
int ackMode,
boolean isXA)
throws JMSException
JMSException| Method Detail |
|---|
public java.lang.String getClientID()
throws JMSException
JMSExceptionpublic boolean isActive()
public boolean getTransacted()
throws JMSException
getTransacted in interface SessiongetTransacted in interface XASessionJMSException
public int getAcknowledgeMode()
throws JMSException
getAcknowledgeMode in interface SessionJMSException
public MessageListener getMessageListener()
throws JMSException
getMessageListener in interface SessionJMSException
public void setMessageListener(MessageListener listener)
throws JMSException
setMessageListener in interface SessionJMSException
public BytesMessage createBytesMessage()
throws JMSException
createBytesMessage in interface SessionJMSException
public MapMessage createMapMessage()
throws JMSException
createMapMessage in interface SessionJMSException
public Message createMessage()
throws JMSException
createMessage in interface SessionJMSException
public ObjectMessage createObjectMessage()
throws JMSException
createObjectMessage in interface SessionJMSException
public ObjectMessage createObjectMessage(java.io.Serializable obj)
throws JMSException
createObjectMessage in interface Sessionobj - a serializable message.
JMSException
public StreamMessage createStreamMessage()
throws JMSException
createStreamMessage in interface SessionJMSException
public TextMessage createTextMessage()
throws JMSException
createTextMessage in interface SessionJMSException
public TextMessage createTextMessage(java.lang.String message)
throws JMSException
createTextMessage in interface SessionJMSException
public MessageConsumer createConsumer(Destination destination)
throws JMSException
createConsumer in interface Sessiondestination - the destination to receive messages from.
JMSException
public MessageConsumer createConsumer(Destination destination,
java.lang.String messageSelector)
throws JMSException
createConsumer in interface Sessiondestination - the destination to receive messages from.messageSelector - query to restrict the messages.
JMSException
public MessageConsumer createConsumer(Destination destination,
java.lang.String messageSelector,
boolean noLocal)
throws JMSException
createConsumer in interface Sessiondestination - the destination to receive messages from.messageSelector - query to restrict the messages.
JMSException
public MessageProducer createProducer(Destination destination)
throws JMSException
createProducer in interface Sessiondestination - the destination to send messages from.
JMSException
public QueueBrowser createBrowser(Queue queue)
throws JMSException
createBrowser in interface Sessionqueue - the queue to send messages to.
JMSException
public QueueBrowser createBrowser(Queue queue,
java.lang.String messageSelector)
throws JMSException
createBrowser in interface Sessionqueue - the queue to send messages to.
JMSException
public Queue createQueue(java.lang.String queueName)
throws JMSException
createQueue in interface SessionJMSException
public TemporaryQueue createTemporaryQueue()
throws JMSException
createTemporaryQueue in interface SessionJMSException
public Topic createTopic(java.lang.String topicName)
throws JMSException
createTopic in interface SessionJMSException
public TemporaryTopic createTemporaryTopic()
throws JMSException
createTemporaryTopic in interface SessionJMSException
public TopicSubscriber createDurableSubscriber(Topic topic,
java.lang.String name)
throws JMSException
createDurableSubscriber in interface Sessiontopic - the topic to receive messages from.
JMSException
public TopicSubscriber createDurableSubscriber(Topic topic,
java.lang.String name,
java.lang.String messageSelector,
boolean noLocal)
throws JMSException
createDurableSubscriber in interface Sessiontopic - the topic to receive messages from.messageSelector - topic to restrict the messages.noLocal - if true, don't receive messages we've sent
JMSException
public void unsubscribe(java.lang.String name)
throws JMSException
unsubscribe in interface SessionJMSException
public void commit()
throws JMSException
commit in interface Sessioncommit in interface XASessionJMSException
public void acknowledge()
throws JMSException
JMSException
public void recover()
throws JMSException
recover in interface SessionJMSException
public void rollback()
throws JMSException
rollback in interface Sessionrollback in interface XASessionJMSException
public void rollbackImpl()
throws JMSException
JMSException
public void close()
throws JMSException
close in interface SessionJMSExceptionprotected void addConsumer(MessageConsumerImpl consumer)
protected void removeConsumer(MessageConsumerImpl consumer)
public void send(AbstractDestination queue,
Message appMessage,
int deliveryMode,
int priority,
long timeout)
throws JMSException
JMSExceptionpublic Session getSession()
getSession in interface XASessionpublic XAResource getXAResource()
getXAResource in interface XASession
public boolean isSameRM(XAResource xa)
throws XAException
isSameRM in interface XAResourceXAException
public boolean setTransactionTimeout(int timeout)
throws XAException
setTransactionTimeout in interface XAResourceXAException
public int getTransactionTimeout()
throws XAException
getTransactionTimeout in interface XAResourceXAException
public void start(Xid xid,
int flags)
throws XAException
start in interface XAResourceXAException
public void end(Xid xid,
int flags)
throws XAException
end in interface XAResourceXAException
public int prepare(Xid xid)
throws XAException
prepare in interface XAResourceXAException
public void commit(Xid xid,
boolean onePhase)
throws XAException
commit in interface XAResourceXAException
public void rollback(Xid xid)
throws XAException
rollback in interface XAResourceXAException
public void forget(Xid xid)
throws XAException
forget in interface XAResourceXAException
public Xid[] recover(int flag)
throws XAException
recover in interface XAResourceXAExceptionpublic void run()
run in interface ThreadTaskrun in interface java.lang.Runnablerun in interface Sessionpublic boolean isClosed()
public void checkOpen()
throws IllegalStateException
IllegalStateExceptionpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||