org.skyscreamer.nevado.jms
Class NevadoSession

java.lang.Object
  extended by org.skyscreamer.nevado.jms.NevadoSession
All Implemented Interfaces:
Runnable, javax.jms.Session
Direct Known Subclasses:
NevadoQueueSession, NevadoTopicSession

public class NevadoSession
extends Object
implements javax.jms.Session

Nevado implementation of the general JMS Session interface.

Author:
Carter Page

Field Summary
protected  boolean _closed
           
 
Fields inherited from interface javax.jms.Session
AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, SESSION_TRANSACTED
 
Constructor Summary
protected NevadoSession(NevadoConnection connection, boolean transacted, int acknowledgeMode)
           
 
Method Summary
 void acknowledgeMessage(NevadoMessage message)
           
protected  void checkClosed()
           
 void close()
           
 void commit()
           
 javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue)
           
 javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue, String s)
           
 NevadoBytesMessage createBytesMessage()
           
 NevadoMessageConsumer createConsumer(javax.jms.Destination destination)
           
 NevadoMessageConsumer createConsumer(javax.jms.Destination destination, String selector)
           
 NevadoMessageConsumer createConsumer(javax.jms.Destination destination, String selector, boolean noLocal)
           
 javax.jms.TopicSubscriber createDurableSubscriber(javax.jms.Topic topic, String name)
           
 javax.jms.TopicSubscriber createDurableSubscriber(javax.jms.Topic topic, String name, String selector, boolean noLocal)
           
protected  NevadoQueue createInternalQueue(String name)
           
 NevadoMapMessage createMapMessage()
           
 NevadoMessage createMessage()
           
 NevadoObjectMessage createObjectMessage()
           
 NevadoObjectMessage createObjectMessage(Serializable serializable)
           
 NevadoMessageProducer createProducer(javax.jms.Destination destination)
           
 NevadoQueue createQueue(String name)
           
 NevadoStreamMessage createStreamMessage()
           
 NevadoTemporaryQueue createTemporaryQueue()
           
 NevadoTemporaryTopic createTemporaryTopic()
           
 NevadoTextMessage createTextMessage()
           
 NevadoTextMessage createTextMessage(String text)
           
 NevadoTopic createTopic(String name)
           
protected  void deleteMessage(NevadoMessage... messages)
           
 void expireMessage(NevadoMessage message)
           
 int getAcknowledgeMode()
           
protected  NevadoConnection getConnection()
           
protected  String getDurableEndpointQueueName(String durableSubscriptionName)
           
 javax.jms.MessageListener getMessageListener()
           
 boolean getTransacted()
           
 boolean isClosed()
           
protected  NevadoMessage receiveMessage(NevadoDestination destination, long timeoutMs, boolean noLocal)
           
 void recover()
           
protected  void resetMessage(NevadoMessage... messages)
           
 void rollback()
           
 void run()
           
protected  void sendMessage(NevadoDestination destination, NevadoMessage message)
           
protected  void setBreakSessionForTesting(boolean value)
           
 void setMessageListener(javax.jms.MessageListener messageListener)
           
 void setOverrideJMSDeliveryMode(Integer jmsDeliveryMode)
           
 void setOverrideJMSPriority(Integer jmsPriority)
           
 void setOverrideJMSTTL(Long jmsTTL)
           
protected  void start()
           
protected  void stop()
           
 void unsubscribe(String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_closed

protected boolean _closed
Constructor Detail

NevadoSession

protected NevadoSession(NevadoConnection connection,
                        boolean transacted,
                        int acknowledgeMode)
Method Detail

createBytesMessage

public NevadoBytesMessage createBytesMessage()
                                      throws javax.jms.JMSException
Specified by:
createBytesMessage in interface javax.jms.Session
Throws:
javax.jms.JMSException

createMapMessage

public NevadoMapMessage createMapMessage()
                                  throws javax.jms.JMSException
Specified by:
createMapMessage in interface javax.jms.Session
Throws:
javax.jms.JMSException

createMessage

public NevadoMessage createMessage()
                            throws javax.jms.JMSException
Specified by:
createMessage in interface javax.jms.Session
Throws:
javax.jms.JMSException

createObjectMessage

public NevadoObjectMessage createObjectMessage()
                                        throws javax.jms.JMSException
Specified by:
createObjectMessage in interface javax.jms.Session
Throws:
javax.jms.JMSException

createObjectMessage

public NevadoObjectMessage createObjectMessage(Serializable serializable)
                                        throws javax.jms.JMSException
Specified by:
createObjectMessage in interface javax.jms.Session
Throws:
javax.jms.JMSException

createStreamMessage

public NevadoStreamMessage createStreamMessage()
                                        throws javax.jms.JMSException
Specified by:
createStreamMessage in interface javax.jms.Session
Throws:
javax.jms.JMSException

createTextMessage

public NevadoTextMessage createTextMessage()
                                    throws javax.jms.JMSException
Specified by:
createTextMessage in interface javax.jms.Session
Throws:
javax.jms.JMSException

createTextMessage

public NevadoTextMessage createTextMessage(String text)
                                    throws javax.jms.JMSException
Specified by:
createTextMessage in interface javax.jms.Session
Throws:
javax.jms.JMSException

getTransacted

public boolean getTransacted()
                      throws javax.jms.JMSException
Specified by:
getTransacted in interface javax.jms.Session
Throws:
javax.jms.JMSException

getAcknowledgeMode

public int getAcknowledgeMode()
                       throws javax.jms.JMSException
Specified by:
getAcknowledgeMode in interface javax.jms.Session
Throws:
javax.jms.JMSException

commit

public void commit()
            throws javax.jms.JMSException
Specified by:
commit in interface javax.jms.Session
Throws:
javax.jms.JMSException

rollback

public void rollback()
              throws javax.jms.JMSException
Specified by:
rollback in interface javax.jms.Session
Throws:
javax.jms.JMSException

close

public void close()
           throws javax.jms.JMSException
Specified by:
close in interface javax.jms.Session
Throws:
javax.jms.JMSException

recover

public void recover()
             throws javax.jms.JMSException
Specified by:
recover in interface javax.jms.Session
Throws:
javax.jms.JMSException

getMessageListener

public javax.jms.MessageListener getMessageListener()
                                             throws javax.jms.JMSException
Specified by:
getMessageListener in interface javax.jms.Session
Throws:
javax.jms.JMSException

setMessageListener

public void setMessageListener(javax.jms.MessageListener messageListener)
                        throws javax.jms.JMSException
Specified by:
setMessageListener in interface javax.jms.Session
Throws:
javax.jms.JMSException

run

public void run()
Specified by:
run in interface Runnable
Specified by:
run in interface javax.jms.Session

createProducer

public NevadoMessageProducer createProducer(javax.jms.Destination destination)
                                     throws javax.jms.JMSException
Specified by:
createProducer in interface javax.jms.Session
Throws:
javax.jms.JMSException

createConsumer

public NevadoMessageConsumer createConsumer(javax.jms.Destination destination)
                                     throws javax.jms.JMSException
Specified by:
createConsumer in interface javax.jms.Session
Throws:
javax.jms.JMSException

createConsumer

public NevadoMessageConsumer createConsumer(javax.jms.Destination destination,
                                            String selector)
                                     throws javax.jms.JMSException
Specified by:
createConsumer in interface javax.jms.Session
Throws:
javax.jms.JMSException

createConsumer

public NevadoMessageConsumer createConsumer(javax.jms.Destination destination,
                                            String selector,
                                            boolean noLocal)
                                     throws javax.jms.JMSException
Specified by:
createConsumer in interface javax.jms.Session
Throws:
javax.jms.JMSException

createBrowser

public javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue)
                                     throws javax.jms.JMSException
Specified by:
createBrowser in interface javax.jms.Session
Throws:
javax.jms.JMSException

createBrowser

public javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue,
                                            String s)
                                     throws javax.jms.JMSException
Specified by:
createBrowser in interface javax.jms.Session
Throws:
javax.jms.JMSException

createTemporaryQueue

public NevadoTemporaryQueue createTemporaryQueue()
                                          throws javax.jms.JMSException
Specified by:
createTemporaryQueue in interface javax.jms.Session
Throws:
javax.jms.JMSException

createQueue

public NevadoQueue createQueue(String name)
                        throws javax.jms.JMSException
Specified by:
createQueue in interface javax.jms.Session
Throws:
javax.jms.JMSException

createInternalQueue

protected NevadoQueue createInternalQueue(String name)
                                   throws javax.jms.JMSException
Throws:
javax.jms.JMSException

createTopic

public NevadoTopic createTopic(String name)
                        throws javax.jms.JMSException
Specified by:
createTopic in interface javax.jms.Session
Throws:
javax.jms.JMSException

createDurableSubscriber

public javax.jms.TopicSubscriber createDurableSubscriber(javax.jms.Topic topic,
                                                         String name)
                                                  throws javax.jms.JMSException
Specified by:
createDurableSubscriber in interface javax.jms.Session
Throws:
javax.jms.JMSException

createDurableSubscriber

public javax.jms.TopicSubscriber createDurableSubscriber(javax.jms.Topic topic,
                                                         String name,
                                                         String selector,
                                                         boolean noLocal)
                                                  throws javax.jms.JMSException
Specified by:
createDurableSubscriber in interface javax.jms.Session
Throws:
javax.jms.JMSException

createTemporaryTopic

public NevadoTemporaryTopic createTemporaryTopic()
                                          throws javax.jms.JMSException
Specified by:
createTemporaryTopic in interface javax.jms.Session
Throws:
javax.jms.JMSException

unsubscribe

public void unsubscribe(String name)
                 throws javax.jms.JMSException
Specified by:
unsubscribe in interface javax.jms.Session
Throws:
javax.jms.JMSException

getDurableEndpointQueueName

protected String getDurableEndpointQueueName(String durableSubscriptionName)

sendMessage

protected void sendMessage(NevadoDestination destination,
                           NevadoMessage message)
                    throws javax.jms.JMSException
Throws:
javax.jms.JMSException

receiveMessage

protected NevadoMessage receiveMessage(NevadoDestination destination,
                                       long timeoutMs,
                                       boolean noLocal)
                                throws javax.jms.JMSException,
                                       InterruptedException
Throws:
javax.jms.JMSException
InterruptedException

acknowledgeMessage

public void acknowledgeMessage(NevadoMessage message)
                        throws javax.jms.JMSException
Throws:
javax.jms.JMSException

expireMessage

public void expireMessage(NevadoMessage message)
                   throws javax.jms.JMSException
Throws:
javax.jms.JMSException

deleteMessage

protected void deleteMessage(NevadoMessage... messages)
                      throws javax.jms.JMSException
Throws:
javax.jms.JMSException

resetMessage

protected void resetMessage(NevadoMessage... messages)

setOverrideJMSDeliveryMode

public void setOverrideJMSDeliveryMode(Integer jmsDeliveryMode)

setOverrideJMSTTL

public void setOverrideJMSTTL(Long jmsTTL)

setOverrideJMSPriority

public void setOverrideJMSPriority(Integer jmsPriority)

isClosed

public boolean isClosed()

getConnection

protected NevadoConnection getConnection()

start

protected void start()

stop

protected void stop()

checkClosed

protected void checkClosed()
                    throws javax.jms.IllegalStateException
Throws:
javax.jms.IllegalStateException

setBreakSessionForTesting

protected void setBreakSessionForTesting(boolean value)


Copyright © 2013. All Rights Reserved.