org.fusesource.stompjms
Class StompJmsConnection

java.lang.Object
  extended by org.fusesource.stompjms.StompJmsConnection
All Implemented Interfaces:
javax.jms.Connection, javax.jms.QueueConnection, javax.jms.TopicConnection

public class StompJmsConnection
extends java.lang.Object
implements javax.jms.Connection, javax.jms.TopicConnection, javax.jms.QueueConnection

Implementation of a JMS Connection


Constructor Summary
protected StompJmsConnection(java.net.URI brokerURI, java.net.URI localURI, java.lang.String userName, java.lang.String password)
           
 
Method Summary
protected  void addSession(StompJmsSession s, StompChannel c)
           
protected  void checkClosed()
           
 void close()
           
 javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Destination destination, java.lang.String messageSelector, javax.jms.ServerSessionPool sessionPool, int maxMessages)
           
 javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Queue queue, java.lang.String messageSelector, javax.jms.ServerSessionPool sessionPool, int maxMessages)
           
 javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Topic topic, java.lang.String messageSelector, javax.jms.ServerSessionPool sessionPool, int maxMessages)
           
 javax.jms.ConnectionConsumer createDurableConnectionConsumer(javax.jms.Topic topic, java.lang.String subscriptionName, java.lang.String messageSelector, javax.jms.ServerSessionPool sessionPool, int maxMessages)
           
 javax.jms.QueueSession createQueueSession(boolean transacted, int acknowledgeMode)
           
 javax.jms.Session createSession(boolean transacted, int acknowledgeMode)
           
 javax.jms.TopicSession createTopicSession(boolean transacted, int acknowledgeMode)
           
protected  StompChannel getChannel()
           
 java.lang.String getClientID()
           
 javax.jms.ExceptionListener getExceptionListener()
           
 javax.jms.ConnectionMetaData getMetaData()
           
protected  int getSessionAcknowledgeMode(boolean transacted, int acknowledgeMode)
           
 void onException(java.lang.Exception ex)
           
 void onException(javax.jms.JMSException ex)
           
protected  void removeSession(StompJmsSession s)
           
 void setClientID(java.lang.String clientID)
           
 void setExceptionListener(javax.jms.ExceptionListener listener)
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StompJmsConnection

protected StompJmsConnection(java.net.URI brokerURI,
                             java.net.URI localURI,
                             java.lang.String userName,
                             java.lang.String password)
                      throws javax.jms.JMSException
Parameters:
brokerURI -
localURI -
userName -
password -
Throws:
javax.jms.JMSException
Method Detail

close

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

createConnectionConsumer

public javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Destination destination,
                                                             java.lang.String messageSelector,
                                                             javax.jms.ServerSessionPool sessionPool,
                                                             int maxMessages)
                                                      throws javax.jms.JMSException
Specified by:
createConnectionConsumer in interface javax.jms.Connection
Parameters:
destination -
messageSelector -
sessionPool -
maxMessages -
Returns:
ConnectionConsumer
Throws:
javax.jms.JMSException
See Also:
Connection.createConnectionConsumer(javax.jms.Destination, java.lang.String, javax.jms.ServerSessionPool, int)

createDurableConnectionConsumer

public javax.jms.ConnectionConsumer createDurableConnectionConsumer(javax.jms.Topic topic,
                                                                    java.lang.String subscriptionName,
                                                                    java.lang.String messageSelector,
                                                                    javax.jms.ServerSessionPool sessionPool,
                                                                    int maxMessages)
                                                             throws javax.jms.JMSException
Specified by:
createDurableConnectionConsumer in interface javax.jms.Connection
Specified by:
createDurableConnectionConsumer in interface javax.jms.TopicConnection
Parameters:
topic -
subscriptionName -
messageSelector -
sessionPool -
maxMessages -
Returns:
ConnectionConsumer
Throws:
javax.jms.JMSException
See Also:
Connection.createDurableConnectionConsumer(javax.jms.Topic, java.lang.String, java.lang.String, javax.jms.ServerSessionPool, int)

createSession

public javax.jms.Session createSession(boolean transacted,
                                       int acknowledgeMode)
                                throws javax.jms.JMSException
Specified by:
createSession in interface javax.jms.Connection
Parameters:
transacted -
acknowledgeMode -
Returns:
Session
Throws:
javax.jms.JMSException
See Also:
Connection.createSession(boolean, int)

getClientID

public java.lang.String getClientID()
Specified by:
getClientID in interface javax.jms.Connection
Returns:
clientId
See Also:
Connection.getClientID()

getExceptionListener

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

getMetaData

public javax.jms.ConnectionMetaData getMetaData()
Specified by:
getMetaData in interface javax.jms.Connection
Returns:
ConnectionMetaData
See Also:
Connection.getMetaData()

setClientID

public void setClientID(java.lang.String clientID)
                 throws javax.jms.JMSException
Specified by:
setClientID in interface javax.jms.Connection
Parameters:
clientID -
Throws:
javax.jms.JMSException
See Also:
Connection.setClientID(java.lang.String)

setExceptionListener

public void setExceptionListener(javax.jms.ExceptionListener listener)
Specified by:
setExceptionListener in interface javax.jms.Connection
Parameters:
listener -
See Also:
Connection.setExceptionListener(javax.jms.ExceptionListener)

start

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

stop

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

createConnectionConsumer

public javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Topic topic,
                                                             java.lang.String messageSelector,
                                                             javax.jms.ServerSessionPool sessionPool,
                                                             int maxMessages)
                                                      throws javax.jms.JMSException
Specified by:
createConnectionConsumer in interface javax.jms.TopicConnection
Parameters:
topic -
messageSelector -
sessionPool -
maxMessages -
Returns:
ConnectionConsumer
Throws:
javax.jms.JMSException
See Also:
TopicConnection.createConnectionConsumer(javax.jms.Topic, java.lang.String, javax.jms.ServerSessionPool, int)

createTopicSession

public javax.jms.TopicSession createTopicSession(boolean transacted,
                                                 int acknowledgeMode)
                                          throws javax.jms.JMSException
Specified by:
createTopicSession in interface javax.jms.TopicConnection
Parameters:
transacted -
acknowledgeMode -
Returns:
TopicSession
Throws:
javax.jms.JMSException
See Also:
TopicConnection.createTopicSession(boolean, int)

createConnectionConsumer

public javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Queue queue,
                                                             java.lang.String messageSelector,
                                                             javax.jms.ServerSessionPool sessionPool,
                                                             int maxMessages)
                                                      throws javax.jms.JMSException
Specified by:
createConnectionConsumer in interface javax.jms.QueueConnection
Parameters:
queue -
messageSelector -
sessionPool -
maxMessages -
Returns:
ConnectionConsumer
Throws:
javax.jms.JMSException
See Also:
QueueConnection.createConnectionConsumer(javax.jms.Queue, java.lang.String, javax.jms.ServerSessionPool, int)

createQueueSession

public javax.jms.QueueSession createQueueSession(boolean transacted,
                                                 int acknowledgeMode)
                                          throws javax.jms.JMSException
Specified by:
createQueueSession in interface javax.jms.QueueConnection
Parameters:
transacted -
acknowledgeMode -
Returns:
QueueSession
Throws:
javax.jms.JMSException
See Also:
QueueConnection.createQueueSession(boolean, int)

onException

public void onException(java.lang.Exception ex)
Parameters:
ex -

onException

public void onException(javax.jms.JMSException ex)
Parameters:
ex -

getSessionAcknowledgeMode

protected int getSessionAcknowledgeMode(boolean transacted,
                                        int acknowledgeMode)
                                 throws javax.jms.JMSException
Throws:
javax.jms.JMSException

getChannel

protected StompChannel getChannel()
                           throws javax.jms.JMSException
Throws:
javax.jms.JMSException

removeSession

protected void removeSession(StompJmsSession s)
                      throws javax.jms.JMSException
Throws:
javax.jms.JMSException

addSession

protected void addSession(StompJmsSession s,
                          StompChannel c)

checkClosed

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


Copyright © 2010-2011 FuseSource, Corp.. All Rights Reserved.