Joram 5.0.6

org.objectweb.joram.client.jms
Class Session

java.lang.Object
  extended by org.objectweb.joram.client.jms.Session
All Implemented Interfaces:
java.lang.Runnable, javax.jms.Session
Direct Known Subclasses:
QueueSession, TopicSession

public class Session
extends java.lang.Object
implements javax.jms.Session

Implements the javax.jms.Session interface.


Field Summary
static org.objectweb.util.monolog.api.Logger logger
           
protected  javax.jms.MessageListener messageListener
          The message listener of the session, if any.
static java.lang.String RECEIVE_ACK
           
static boolean receiveAck
           
 
Fields inherited from interface javax.jms.Session
AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, SESSION_TRANSACTED
 
Method Summary
protected  void addConsumer(MessageConsumer mc)
          Called here and by sub-classes.
protected  void addProducer(MessageProducer mp)
          Called here and by sub-classes.
protected  void checkClosed()
          Checks if the session is closed.
 void close()
          Closes the session.
 void commit()
          API method.
 javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue)
          API method
 javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue, java.lang.String selector)
          API method
 javax.jms.BytesMessage createBytesMessage()
          Creates a BytesMessage object.
 javax.jms.MessageConsumer createConsumer(javax.jms.Destination dest)
          Creates a MessageConsumer for the specified destination.
 javax.jms.MessageConsumer createConsumer(javax.jms.Destination dest, java.lang.String selector)
          Creates a MessageConsumer for the specified destination using a message selector.
 javax.jms.MessageConsumer createConsumer(javax.jms.Destination dest, java.lang.String selector, boolean noLocal)
          Creates a MessageConsumer for the specified destination using a message selector.
 javax.jms.TopicSubscriber createDurableSubscriber(javax.jms.Topic topic, java.lang.String name)
          API method.
 javax.jms.TopicSubscriber createDurableSubscriber(javax.jms.Topic topic, java.lang.String name, java.lang.String selector, boolean noLocal)
          API method.
 javax.jms.MapMessage createMapMessage()
          Creates a MapMessage object.
 javax.jms.Message createMessage()
          Creates a Message object.
 javax.jms.ObjectMessage createObjectMessage()
          Creates a ObjectMessage object.
 javax.jms.ObjectMessage createObjectMessage(java.io.Serializable obj)
          Creates a ObjectMessage object.
 javax.jms.MessageProducer createProducer(javax.jms.Destination dest)
          Creates a MessageProducer to send messages to the specified destination.
 javax.jms.Queue createQueue(java.lang.String queueName)
          API method.
 javax.jms.StreamMessage createStreamMessage()
          Creates a StreamMessage object.
 javax.jms.TemporaryQueue createTemporaryQueue()
          API method.
 javax.jms.TemporaryTopic createTemporaryTopic()
          API method.
 javax.jms.TextMessage createTextMessage()
          Creates a TextMessage object.
 javax.jms.TextMessage createTextMessage(java.lang.String text)
          Creates a TextMessage object with the specified text.
 javax.jms.Topic createTopic(java.lang.String topicName)
          API method.
 int getAcknowledgeMode()
          API method.
 javax.jms.MessageListener getMessageListener()
          API method.
 int getQueueMessageReadMax()
          Get queueMessageReadMax for this Session.
 int getTopicAckBufferMax()
          Get topicAckBufferMax for this session.
 int getTopicActivationThreshold()
          Get topicActivationThreshold for this session.
 int getTopicPassivationThreshold()
          Get topicPassivationThreshold for this session.
 boolean getTransacted()
          API method.
 boolean isAutoAck()
           
 void recover()
          API method.
 void rollback()
          API method.
 void run()
          API method.
 void setAsyncSend(boolean b)
          Set asyncSend for this Session.
 void setMessageListener(javax.jms.MessageListener messageListener)
          API method.
 void setQueueMessageReadMax(int i)
          Set queueMessageReadMax for this Session.
 void setTopicAckBufferMax(int i)
          Set topicAckBufferMax for this session.
 void setTopicActivationThreshold(int i)
          Set topicActivationThreshold for this session.
 void setTopicPassivationThreshold(int i)
          Set topicPassivationThreshold for this session.
 void setTransacted(boolean t)
          set transacted.
 java.lang.String toString()
          Returns a String image of this session.
 void unsubscribe(java.lang.String name)
          API method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

public static org.objectweb.util.monolog.api.Logger logger

RECEIVE_ACK

public static final java.lang.String RECEIVE_ACK
See Also:
Constant Field Values

receiveAck

public static boolean receiveAck

messageListener

protected javax.jms.MessageListener messageListener
The message listener of the session, if any.

Method Detail

checkClosed

protected void checkClosed()
                    throws javax.jms.IllegalStateException
Checks if the session is closed. If true, an IllegalStateException is raised.

Throws:
javax.jms.IllegalStateException

toString

public java.lang.String toString()
Returns a String image of this session.

Overrides:
toString in class java.lang.Object

getAcknowledgeMode

public final int getAcknowledgeMode()
                             throws javax.jms.JMSException
API method.

Specified by:
getAcknowledgeMode in interface javax.jms.Session
Throws:
javax.jms.JMSException - Actually never thrown.

getTransacted

public final boolean getTransacted()
                            throws javax.jms.JMSException
API method.

Specified by:
getTransacted in interface javax.jms.Session
Throws:
javax.jms.IllegalStateException - If the session is closed.
javax.jms.JMSException

setTransacted

public void setTransacted(boolean t)
set transacted. see connector ManagedConnectionImpl (Connector).


setMessageListener

public void setMessageListener(javax.jms.MessageListener messageListener)
                        throws javax.jms.JMSException
API method.

Specified by:
setMessageListener in interface javax.jms.Session
Throws:
javax.jms.JMSException - Actually never thrown.

getMessageListener

public javax.jms.MessageListener getMessageListener()
                                             throws javax.jms.JMSException
API method.

Specified by:
getMessageListener in interface javax.jms.Session
Throws:
javax.jms.JMSException - Actually never thrown.

createMessage

public javax.jms.Message createMessage()
                                throws javax.jms.JMSException
Creates a Message object. API method.

Specified by:
createMessage in interface javax.jms.Session
Throws:
javax.jms.IllegalStateException - If the session is closed.
javax.jms.JMSException

createTextMessage

public javax.jms.TextMessage createTextMessage()
                                        throws javax.jms.JMSException
Creates a TextMessage object. API method.

Specified by:
createTextMessage in interface javax.jms.Session
Throws:
javax.jms.IllegalStateException - If the session is closed.
javax.jms.JMSException

createTextMessage

public javax.jms.TextMessage createTextMessage(java.lang.String text)
                                        throws javax.jms.JMSException
Creates a TextMessage object with the specified text. API method.

Specified by:
createTextMessage in interface javax.jms.Session
Throws:
javax.jms.IllegalStateException - If the session is closed.
javax.jms.JMSException

createBytesMessage

public javax.jms.BytesMessage createBytesMessage()
                                          throws javax.jms.JMSException
Creates a BytesMessage object. API method.

Specified by:
createBytesMessage in interface javax.jms.Session
Throws:
javax.jms.IllegalStateException - If the session is closed.
javax.jms.JMSException

createMapMessage

public javax.jms.MapMessage createMapMessage()
                                      throws javax.jms.JMSException
Creates a MapMessage object. API method.

Specified by:
createMapMessage in interface javax.jms.Session
Throws:
javax.jms.IllegalStateException - If the session is closed.
javax.jms.JMSException

createObjectMessage

public javax.jms.ObjectMessage createObjectMessage()
                                            throws javax.jms.JMSException
Creates a ObjectMessage object. API method.

Specified by:
createObjectMessage in interface javax.jms.Session
Throws:
javax.jms.IllegalStateException - If the session is closed.
javax.jms.JMSException

createObjectMessage

public javax.jms.ObjectMessage createObjectMessage(java.io.Serializable obj)
                                            throws javax.jms.JMSException
Creates a ObjectMessage object. API method.

Specified by:
createObjectMessage in interface javax.jms.Session
Throws:
javax.jms.IllegalStateException - If the session is closed.
javax.jms.JMSException

createStreamMessage

public javax.jms.StreamMessage createStreamMessage()
                                            throws javax.jms.JMSException
Creates a StreamMessage object. API method.

Specified by:
createStreamMessage in interface javax.jms.Session
Throws:
javax.jms.IllegalStateException - If the session is closed.
javax.jms.JMSException

createBrowser

public javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue,
                                            java.lang.String selector)
                                     throws javax.jms.JMSException
API method

Specified by:
createBrowser in interface javax.jms.Session
Throws:
javax.jms.IllegalStateException - If the session is closed.
javax.jms.JMSException

createBrowser

public javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue)
                                     throws javax.jms.JMSException
API method

Specified by:
createBrowser in interface javax.jms.Session
Throws:
javax.jms.IllegalStateException - If the session is closed.
javax.jms.JMSException

createProducer

public javax.jms.MessageProducer createProducer(javax.jms.Destination dest)
                                         throws javax.jms.JMSException
Creates a MessageProducer to send messages to the specified destination. API method.

Specified by:
createProducer in interface javax.jms.Session
Throws:
javax.jms.IllegalStateException - If the session is closed or if the connection is broken.
javax.jms.JMSException - If the creation fails for any other reason.

createConsumer

public javax.jms.MessageConsumer createConsumer(javax.jms.Destination dest,
                                                java.lang.String selector,
                                                boolean noLocal)
                                         throws javax.jms.JMSException
Creates a MessageConsumer for the specified destination using a message selector. API method.

Specified by:
createConsumer in interface javax.jms.Session
Throws:
javax.jms.IllegalStateException - If the session is closed or if the connection is broken.
javax.jms.JMSException - If the creation fails for any other reason.

createConsumer

public javax.jms.MessageConsumer createConsumer(javax.jms.Destination dest,
                                                java.lang.String selector)
                                         throws javax.jms.JMSException
Creates a MessageConsumer for the specified destination using a message selector. API method.

Specified by:
createConsumer in interface javax.jms.Session
Throws:
javax.jms.IllegalStateException - If the session is closed or if the connection is broken.
javax.jms.JMSException - If the creation fails for any other reason.

createConsumer

public javax.jms.MessageConsumer createConsumer(javax.jms.Destination dest)
                                         throws javax.jms.JMSException
Creates a MessageConsumer for the specified destination. API method.

Specified by:
createConsumer in interface javax.jms.Session
Throws:
javax.jms.IllegalStateException - If the session is closed or if the connection is broken.
javax.jms.JMSException - If the creation fails for any other reason.

createDurableSubscriber

public javax.jms.TopicSubscriber createDurableSubscriber(javax.jms.Topic topic,
                                                         java.lang.String name,
                                                         java.lang.String selector,
                                                         boolean noLocal)
                                                  throws javax.jms.JMSException
API method.

Specified by:
createDurableSubscriber in interface javax.jms.Session
Throws:
javax.jms.IllegalStateException - If the session is closed or if the connection is broken.
javax.jms.JMSException - If the creation fails for any other reason.

createDurableSubscriber

public javax.jms.TopicSubscriber createDurableSubscriber(javax.jms.Topic topic,
                                                         java.lang.String name)
                                                  throws javax.jms.JMSException
API method.

Specified by:
createDurableSubscriber in interface javax.jms.Session
Throws:
javax.jms.IllegalStateException - If the session is closed or if the connection is broken.
javax.jms.JMSException - If the creation fails for any other reason.

createQueue

public javax.jms.Queue createQueue(java.lang.String queueName)
                            throws javax.jms.JMSException
API method.

Specified by:
createQueue in interface javax.jms.Session
Throws:
javax.jms.IllegalStateException - If the session is closed.
javax.jms.JMSException

createTopic

public javax.jms.Topic createTopic(java.lang.String topicName)
                            throws javax.jms.JMSException
API method.

Specified by:
createTopic in interface javax.jms.Session
Throws:
javax.jms.IllegalStateException - If the session is closed.
javax.jms.JMSException - If the topic creation failed.

createTemporaryQueue

public javax.jms.TemporaryQueue createTemporaryQueue()
                                              throws javax.jms.JMSException
API method.

Specified by:
createTemporaryQueue in interface javax.jms.Session
Throws:
javax.jms.IllegalStateException - If the session is closed or if the connection is broken.
javax.jms.JMSException - If the request fails for any other reason.

createTemporaryTopic

public javax.jms.TemporaryTopic createTemporaryTopic()
                                              throws javax.jms.JMSException
API method.

Specified by:
createTemporaryTopic in interface javax.jms.Session
Throws:
javax.jms.IllegalStateException - If the session is closed or if the connection is broken.
javax.jms.JMSException - If the request fails for any other reason.

run

public void run()
API method.

Specified by:
run in interface java.lang.Runnable
Specified by:
run in interface javax.jms.Session

commit

public void commit()
            throws javax.jms.JMSException
API method.

Specified by:
commit in interface javax.jms.Session
Throws:
javax.jms.IllegalStateException - If the session is closed, or not transacted, or if the connection is broken.
javax.jms.JMSException

rollback

public void rollback()
              throws javax.jms.JMSException
API method.

Specified by:
rollback in interface javax.jms.Session
Throws:
javax.jms.IllegalStateException - If the session is closed, or not transacted.
javax.jms.JMSException

recover

public void recover()
             throws javax.jms.JMSException
API method.

Specified by:
recover in interface javax.jms.Session
Throws:
javax.jms.IllegalStateException - If the session is closed, or transacted.
javax.jms.JMSException

unsubscribe

public void unsubscribe(java.lang.String name)
                 throws javax.jms.JMSException
API method.

Specified by:
unsubscribe in interface javax.jms.Session
Throws:
javax.jms.IllegalStateException - If the session is closed or if the connection is broken.
InvalidDestinationException - If the subscription does not exist.
javax.jms.JMSException - If the request fails for any other reason.

close

public void close()
           throws javax.jms.JMSException
Closes the session. API method.

Specified by:
close in interface javax.jms.Session
Throws:
javax.jms.JMSException

addConsumer

protected void addConsumer(MessageConsumer mc)
Called here and by sub-classes.


addProducer

protected void addProducer(MessageProducer mp)
Called here and by sub-classes.


isAutoAck

public final boolean isAutoAck()

setAsyncSend

public void setAsyncSend(boolean b)
Set asyncSend for this Session. Indicates whether the messages produced are asynchronously sent or not (without or with acknowledgement).

Parameters:
b -

setQueueMessageReadMax

public void setQueueMessageReadMax(int i)
Set queueMessageReadMax for this Session.

Parameters:
i - The maximum number of messages that can be read at once from a queue.
See Also:
queueMessageReadMax, getQueueMessageReadMax

getQueueMessageReadMax

public final int getQueueMessageReadMax()
Get queueMessageReadMax for this Session.

Returns:
The maximum number of messages that can be read at once from a queue.
See Also:
queueMessageReadMax, setQueueMessageReadMax

getTopicAckBufferMax

public final int getTopicAckBufferMax()
Get topicAckBufferMax for this session.

Returns:
The Maximum number of acknowledgements that can be buffered in Session.DUPS_OK_ACKNOWLEDGE mode, default is 0.
See Also:
topicAckBufferMax, setTopicAckBufferMax

setTopicAckBufferMax

public void setTopicAckBufferMax(int i)
Set topicAckBufferMax for this session.

Parameters:
i - The Maximum number of acknowledgements that can be buffered in Session.DUPS_OK_ACKNOWLEDGE mode, default is 0.
See Also:
topicAckBufferMax, getTopicAckBufferMax

getTopicActivationThreshold

public final int getTopicActivationThreshold()
Get topicActivationThreshold for this session.

Returns:
The minimum messages number below which the subscription is activated.
See Also:
topicActivationThreshold, setTopicActivationThreshold

setTopicActivationThreshold

public void setTopicActivationThreshold(int i)
Set topicActivationThreshold for this session.

Parameters:
i - The minimum messages number below which the subscription is activated.
See Also:
topicActivationThreshold, getTopicActivationThreshold

getTopicPassivationThreshold

public final int getTopicPassivationThreshold()
Get topicPassivationThreshold for this session.

Returns:
The maximum messages number over which the subscription is passivated.
See Also:
topicPassivationThreshold, setTopicPassivationThreshold

setTopicPassivationThreshold

public void setTopicPassivationThreshold(int i)
Set topicPassivationThreshold for this session.

Parameters:
i - The maximum messages number over which the subscription is passivated.
See Also:
topicPassivationThreshold, getTopicPassivationThreshold

Joram 5.0.6

Copyright © 2005 Scalagent - All rights reserved