public class GSTopicConnectionImpl extends Object
javax.jms.TopicConnection interface.
GigaSpaces implementation of the JMS TopicConnection Inerface.
It also extends the GSConnectionImpl and overwrites most of its methods. - It holds the list of the sessions that attached to this conn. - It returns a LocalTransaction instance - It starts, stops and closes the Connection
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
closed
true if the connection is closed. |
protected boolean |
closing
true if the connection is closing. |
protected boolean |
stopped
This flag indicates whether the connection is in the started or stopped state
|
| Constructor and Description |
|---|
GSTopicConnectionImpl(GSConnectionFactoryImpl _connFacParent)
Constructor: Calling super com.j_spaces.jms.GSConnectionImpl.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
API method for closing the connection; even if the connection appears to be broken, closes
the sessions.
|
javax.jms.ConnectionConsumer |
createConnectionConsumer(javax.jms.Destination destination,
String messageSelector,
javax.jms.ServerSessionPool sessionPool,
int maxMessages) |
javax.jms.ConnectionConsumer |
createConnectionConsumer(javax.jms.Queue queue,
String messageSelector,
javax.jms.ServerSessionPool sessionPool,
int maxMessages) |
javax.jms.ConnectionConsumer |
createConnectionConsumer(javax.jms.Topic topic,
String messageSelector,
javax.jms.ServerSessionPool sessionPool,
int maxMessages) |
javax.jms.ConnectionConsumer |
createDurableConnectionConsumer(javax.jms.Topic topic,
String subscriptionName,
String messageSelector,
javax.jms.ServerSessionPool sessionPool,
int maxMessages) |
javax.jms.QueueSession |
createQueueSession(boolean transacted,
int acknowledgeMode) |
javax.jms.Session |
createSession(boolean transacted,
int acknowledgeMode)
Use the extended methods, from GSTopicConnectionImpl for Topic and from GSQueueConnectionImpl
for Queue.
|
javax.jms.TopicSession |
createTopicSession(boolean transacted,
int acknowledgeMode) |
protected void |
ensureOpen()
Verifies that the connection is open
|
String |
getClientID()
The connection client ID contains the space name together with the Destination name, "space
name_destination name" e.g.
|
protected String |
getCnxKey() |
int |
getCompressionMinSize() |
protected GSConnectionFactoryImpl |
getConnFacParent() |
javax.jms.ExceptionListener |
getExceptionListener() |
javax.jms.ConnectionMetaData |
getMetaData() |
Transaction |
getTransaction(boolean localTransaction,
long leaseTime)
create a new local transaction instance and use it in case of a transacted JMS session.
|
protected boolean |
isStopped()
Return the running state of the connection
|
void |
setClientID(String clientID)
The connection client ID contains the random connection Key + hostname + space name +
destination name "space name_destination name" e.g.
|
protected void |
setCnxKey(String string) |
void |
setExceptionListener(javax.jms.ExceptionListener listener) |
protected void |
setModified()
Flags this connection as being modified.
|
void |
start()
Overwrite of the API method for starting the Topic connection.
|
void |
stop()
Overwrite of the API method for stoping the Topic connection.
|
String |
toString() |
protected void |
updateClientIDInternally(String updatedClientID)
This method called internally by the GSSessionImpl and GSTopicConnectionImpl and
GSQueueConnectionImpl in order to append another string to the existing clientID to have the
final clientID, in which after that no more client modifications can be done from outside.
|
protected boolean closing
true if the connection is closing.protected boolean closed
true if the connection is closed.protected boolean stopped
public GSTopicConnectionImpl(GSConnectionFactoryImpl _connFacParent) throws javax.jms.JMSException
_connFacParent - connection factoryjavax.jms.JMSExceptionpublic javax.jms.Session createSession(boolean transacted,
int acknowledgeMode)
throws javax.jms.JMSException
createSession in interface javax.jms.Connectionjavax.jms.JMSExceptionConnection.createSession(boolean, int)public String getClientID() throws javax.jms.JMSException
getClientID in interface javax.jms.Connectionjavax.jms.JMSExceptionConnection.getClientID()public void setClientID(String clientID) throws javax.jms.JMSException
setClientID in interface javax.jms.Connectionjavax.jms.JMSExceptionConnection.setClientID(String)protected void updateClientIDInternally(String updatedClientID) throws javax.jms.JMSException
javax.jms.JMSExceptionprotected void setModified()
setClientID(java.lang.String)will result in an IllegalStateException being thrownpublic javax.jms.ConnectionMetaData getMetaData()
throws javax.jms.JMSException
getMetaData in interface javax.jms.Connectionjavax.jms.JMSExceptionConnection.getMetaData(),
GSConnectionMetaDataImplpublic javax.jms.ExceptionListener getExceptionListener()
throws javax.jms.JMSException
getExceptionListener in interface javax.jms.Connectionjavax.jms.JMSExceptionConnection.getExceptionListener()public void setExceptionListener(javax.jms.ExceptionListener listener)
throws javax.jms.JMSException
setExceptionListener in interface javax.jms.Connectionjavax.jms.JMSExceptionConnection.setExceptionListener(ExceptionListener)public void start()
throws javax.jms.JMSException
start in interface javax.jms.Connectionjavax.jms.IllegalStateException - If the connection is closed or broken.javax.jms.JMSExceptionpublic void stop()
throws javax.jms.JMSException
stop in interface javax.jms.Connectionjavax.jms.IllegalStateException - If the connection is closed or broken.javax.jms.JMSExceptionConnection.stop()public void close()
throws javax.jms.JMSException
close in interface javax.jms.Connectionjavax.jms.JMSException - Actually never thrown.protected boolean isStopped()
true if stopped, else started state.protected void ensureOpen()
throws javax.jms.IllegalStateException
javax.jms.IllegalStateException - if the connection is closedpublic javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Destination destination,
String messageSelector,
javax.jms.ServerSessionPool sessionPool,
int maxMessages)
throws javax.jms.JMSException
createConnectionConsumer in interface javax.jms.Connectionjavax.jms.JMSExceptionConnection.createConnectionConsumer(Destination, String, ServerSessionPool, int)public javax.jms.ConnectionConsumer createDurableConnectionConsumer(javax.jms.Topic topic,
String subscriptionName,
String messageSelector,
javax.jms.ServerSessionPool sessionPool,
int maxMessages)
throws javax.jms.JMSException
createDurableConnectionConsumer in interface javax.jms.ConnectioncreateDurableConnectionConsumer in interface javax.jms.TopicConnectionjavax.jms.JMSExceptionConnection.createDurableConnectionConsumer(Topic, String, String, ServerSessionPool,
int)public Transaction getTransaction(boolean localTransaction, long leaseTime) throws com.j_spaces.jms.TransactionCreateException
com.j_spaces.jms.TransactionCreateExceptionprotected String getCnxKey()
protected void setCnxKey(String string)
string - protected GSConnectionFactoryImpl getConnFacParent()
public int getCompressionMinSize()
public javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Queue queue,
String messageSelector,
javax.jms.ServerSessionPool sessionPool,
int maxMessages)
throws javax.jms.JMSException
createConnectionConsumer in interface javax.jms.QueueConnectionjavax.jms.JMSExceptionQueueConnection.createConnectionConsumer(Queue, String, ServerSessionPool, int)public javax.jms.QueueSession createQueueSession(boolean transacted,
int acknowledgeMode)
throws javax.jms.JMSException
createQueueSession in interface javax.jms.QueueConnectionjavax.jms.JMSExceptionQueueConnection.createQueueSession(boolean, int)public javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Topic topic,
String messageSelector,
javax.jms.ServerSessionPool sessionPool,
int maxMessages)
throws javax.jms.JMSException
createConnectionConsumer in interface javax.jms.TopicConnectionjavax.jms.JMSExceptionTopicConnection.createConnectionConsumer(Topic, String, ServerSessionPool, int)public javax.jms.TopicSession createTopicSession(boolean transacted,
int acknowledgeMode)
throws javax.jms.JMSException
createTopicSession in interface javax.jms.TopicConnectionjavax.jms.JMSExceptionTopicConnection.createTopicSession(boolean, int)Copyright © GigaSpaces.