org.skyscreamer.nevado.jms
Class NevadoConnection

java.lang.Object
  extended by org.skyscreamer.nevado.jms.NevadoConnection
All Implemented Interfaces:
javax.jms.Connection
Direct Known Subclasses:
NevadoQueueConnection, NevadoTopicConnection

public class NevadoConnection
extends Object
implements javax.jms.Connection

Nevado's implementation of JMS Connection.

Author:
Carter Page

Field Summary
protected  boolean _inUse
           
static int DEFAULT_MAX_POLL_WAIT_MS
           
 
Constructor Summary
NevadoConnection(SQSConnector sqsConnector)
           
 
Method Summary
protected  void checkClosed()
           
 void close()
           
 javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Destination destination, String s, javax.jms.ServerSessionPool serverSessionPool, int i)
           
 javax.jms.ConnectionConsumer createDurableConnectionConsumer(javax.jms.Topic topic, String s, String s1, javax.jms.ServerSessionPool serverSessionPool, int i)
           
 NevadoSession createSession(boolean transacted, int acknowledgeMode)
           
protected  NevadoTemporaryQueue createTemporaryQueue()
           
protected  NevadoTemporaryTopic createTemporaryTopic()
           
protected  void deleteQueue(NevadoQueue queue)
           
 void deleteTemporaryQueue(NevadoTemporaryQueue temporaryQueue)
           
 void deleteTemporaryTopic(NevadoTemporaryTopic temporaryTopic)
           
 void deleteTopic(NevadoTopic topic)
           
 Collection<NevadoTemporaryQueue> deleteUnusedTemporaryQueues(String suffix)
           
 Collection<NevadoTemporaryTopic> deleteUnusedTemporaryTopics(String suffix)
           
 String getClientID()
           
 String getConnectionID()
           
 javax.jms.ExceptionListener getExceptionListener()
           
protected  long getMaxPollWaitMs()
           
 NevadoConnectionMetaData getMetaData()
           
 SQSConnector getSQSConnector()
           
protected  void initializeSession(NevadoSession nevadoSession)
           
 boolean isClosed()
          Tell whether the connection is closed.
 boolean isRunning()
           
 Collection<NevadoTemporaryQueue> listAllTemporaryQueues()
           
 Collection<NevadoTemporaryTopic> listAllTemporaryTopics()
           
protected  boolean ownsTemporaryDestination(javax.jms.Destination temporaryDestination)
           
 void setClientID(String clientID)
           
 void setExceptionListener(javax.jms.ExceptionListener exceptionListener)
           
 void setMaxPollWaitMs(long maxPollWaitMs)
           
 void setOverrideJMSDeliveryMode(Integer jmsDeliveryMode)
           
 void setOverrideJMSPriority(Integer jmsPriority)
           
 void setOverrideJMSTTL(Long jmsTTL)
           
 void setTemporaryQueueSuffix(String temporaryQueueSuffix)
           
 void setTemporaryTopicSuffix(String temporaryTopicSuffix)
           
 void start()
           
 void stop()
           
 String subscribe(NevadoTopic topic, NevadoQueue topicEndpoint)
           
 void unsubscribe(NevadoTopic topic)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MAX_POLL_WAIT_MS

public static final int DEFAULT_MAX_POLL_WAIT_MS
See Also:
Constant Field Values

_inUse

protected volatile boolean _inUse
Constructor Detail

NevadoConnection

public NevadoConnection(SQSConnector sqsConnector)
                 throws javax.jms.JMSException
Throws:
javax.jms.JMSException
Method Detail

createSession

public NevadoSession createSession(boolean transacted,
                                   int acknowledgeMode)
                            throws javax.jms.JMSException
Specified by:
createSession in interface javax.jms.Connection
Throws:
javax.jms.JMSException

initializeSession

protected void initializeSession(NevadoSession nevadoSession)

getMetaData

public NevadoConnectionMetaData getMetaData()
                                     throws javax.jms.JMSException
Specified by:
getMetaData in interface javax.jms.Connection
Throws:
javax.jms.JMSException

getExceptionListener

public javax.jms.ExceptionListener getExceptionListener()
Specified by:
getExceptionListener in interface javax.jms.Connection

setExceptionListener

public void setExceptionListener(javax.jms.ExceptionListener exceptionListener)
                          throws javax.jms.IllegalStateException
Specified by:
setExceptionListener in interface javax.jms.Connection
Throws:
javax.jms.IllegalStateException

start

public void start()
           throws javax.jms.JMSException
Specified by:
start in interface javax.jms.Connection
Throws:
javax.jms.JMSException

stop

public void stop()
          throws javax.jms.JMSException
Specified by:
stop in interface javax.jms.Connection
Throws:
javax.jms.JMSException

close

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

createConnectionConsumer

public javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Destination destination,
                                                             String s,
                                                             javax.jms.ServerSessionPool serverSessionPool,
                                                             int i)
                                                      throws javax.jms.JMSException
Specified by:
createConnectionConsumer in interface javax.jms.Connection
Throws:
javax.jms.JMSException

createDurableConnectionConsumer

public javax.jms.ConnectionConsumer createDurableConnectionConsumer(javax.jms.Topic topic,
                                                                    String s,
                                                                    String s1,
                                                                    javax.jms.ServerSessionPool serverSessionPool,
                                                                    int i)
                                                             throws javax.jms.JMSException
Specified by:
createDurableConnectionConsumer in interface javax.jms.Connection
Throws:
javax.jms.JMSException

createTemporaryTopic

protected NevadoTemporaryTopic createTemporaryTopic()
                                             throws javax.jms.JMSException
Throws:
javax.jms.JMSException

deleteTemporaryTopic

public void deleteTemporaryTopic(NevadoTemporaryTopic temporaryTopic)
                          throws javax.jms.JMSException
Throws:
javax.jms.JMSException

deleteTopic

public void deleteTopic(NevadoTopic topic)
                 throws javax.jms.JMSException
Throws:
javax.jms.JMSException

createTemporaryQueue

protected NevadoTemporaryQueue createTemporaryQueue()
                                             throws javax.jms.JMSException
Throws:
javax.jms.JMSException

deleteTemporaryQueue

public void deleteTemporaryQueue(NevadoTemporaryQueue temporaryQueue)
                          throws javax.jms.JMSException
Throws:
javax.jms.JMSException

deleteQueue

protected void deleteQueue(NevadoQueue queue)
                    throws javax.jms.JMSException
Throws:
javax.jms.JMSException

ownsTemporaryDestination

protected boolean ownsTemporaryDestination(javax.jms.Destination temporaryDestination)

listAllTemporaryQueues

public Collection<NevadoTemporaryQueue> listAllTemporaryQueues()
                                                        throws javax.jms.JMSException
Throws:
javax.jms.JMSException

listAllTemporaryTopics

public Collection<NevadoTemporaryTopic> listAllTemporaryTopics()
                                                        throws javax.jms.JMSException
Throws:
javax.jms.JMSException

deleteUnusedTemporaryQueues

public Collection<NevadoTemporaryQueue> deleteUnusedTemporaryQueues(String suffix)
                                                             throws javax.jms.JMSException
Throws:
javax.jms.JMSException

deleteUnusedTemporaryTopics

public Collection<NevadoTemporaryTopic> deleteUnusedTemporaryTopics(String suffix)
                                                             throws javax.jms.JMSException
Throws:
javax.jms.JMSException

subscribe

public String subscribe(NevadoTopic topic,
                        NevadoQueue topicEndpoint)
                 throws javax.jms.JMSException
Throws:
javax.jms.JMSException

unsubscribe

public void unsubscribe(NevadoTopic topic)
                 throws javax.jms.JMSException
Throws:
javax.jms.JMSException

getSQSConnector

public SQSConnector getSQSConnector()

getClientID

public String getClientID()
Specified by:
getClientID in interface javax.jms.Connection

setClientID

public void setClientID(String clientID)
                 throws javax.jms.JMSException
Specified by:
setClientID in interface javax.jms.Connection
Throws:
javax.jms.JMSException

setOverrideJMSDeliveryMode

public void setOverrideJMSDeliveryMode(Integer jmsDeliveryMode)
                                throws javax.jms.IllegalStateException
Throws:
javax.jms.IllegalStateException

setOverrideJMSPriority

public void setOverrideJMSPriority(Integer jmsPriority)
                            throws javax.jms.IllegalStateException
Throws:
javax.jms.IllegalStateException

setOverrideJMSTTL

public void setOverrideJMSTTL(Long jmsTTL)
                       throws javax.jms.IllegalStateException
Throws:
javax.jms.IllegalStateException

setTemporaryQueueSuffix

public void setTemporaryQueueSuffix(String temporaryQueueSuffix)

setTemporaryTopicSuffix

public void setTemporaryTopicSuffix(String temporaryTopicSuffix)

setMaxPollWaitMs

public void setMaxPollWaitMs(long maxPollWaitMs)

getMaxPollWaitMs

protected long getMaxPollWaitMs()

isRunning

public boolean isRunning()

isClosed

public boolean isClosed()
Tell whether the connection is closed. If the connection is in the process of closing, this will return true until complete.

Returns:
true if closed, otherwise false

checkClosed

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

getConnectionID

public String getConnectionID()


Copyright © 2013. All Rights Reserved.