com.j_spaces.jms
Class GSXAQueueConnectionImpl
java.lang.Object
com.j_spaces.jms.GSXAConnectionImpl
com.j_spaces.jms.GSXAQueueConnectionImpl
- All Implemented Interfaces:
- Connection, QueueConnection, TopicConnection, XAConnection, XAQueueConnection, XATopicConnection
public class GSXAQueueConnectionImpl
- extends GSXAConnectionImpl
GigaSpaces implemention of the javax.jms.XAQueueConnection
interface.
Method Summary |
void |
close()
API method for closing the connection; even if the connection appears to
be broken, closes the sessions. |
ConnectionConsumer |
createConnectionConsumer(Destination destination,
String messageSelector,
ServerSessionPool sessionPool,
int maxMessages)
|
ConnectionConsumer |
createConnectionConsumer(Queue queue,
String messageSelector,
ServerSessionPool sessionPool,
int maxMessages)
|
ConnectionConsumer |
createConnectionConsumer(Topic topic,
String messageSelector,
ServerSessionPool sessionPool,
int maxMessages)
|
ConnectionConsumer |
createDurableConnectionConsumer(Topic topic,
String subscriptionName,
String messageSelector,
ServerSessionPool sessionPool,
int maxMessages)
|
QueueSession |
createQueueSession(boolean transacted,
int acknowledgeMode)
|
Session |
createSession(boolean transacted,
int acknowledgeMode)
Use the extended methods, from GSTopicConnectionImpl for Topic and from
GSQueueConnectionImpl for Queue. |
TopicSession |
createTopicSession(boolean transacted,
int acknowledgeMode)
|
String |
getClientID()
The connection client ID contains the space name together with the
Destination name, "space name_destination name" e.g. |
int |
getCompressionMinSize()
|
ExceptionListener |
getExceptionListener()
|
ConnectionMetaData |
getMetaData()
|
Transaction |
getTransaction(boolean localTransaction,
long leaseTime)
create a new local transaction instance and use it in case of a
transacted JMS session. |
void |
setClientID(String clientID)
The connection client ID contains the random connection Key + hostname +
space name + destination name "space name_destination name" e.g. |
void |
setExceptionListener(ExceptionListener listener)
|
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()
|
GSXAQueueConnectionImpl
public GSXAQueueConnectionImpl(GSXAConnectionFactoryImpl factory)
throws JMSException
- Creates an instance of GSXAQueueConnectionImpl.
- Parameters:
factory
- parent factory
- Throws:
JMSException
- if failed to create the connection.
createSession
public Session createSession(boolean transacted,
int acknowledgeMode)
throws JMSException
- Use the extended methods, from GSTopicConnectionImpl for Topic and from
GSQueueConnectionImpl for Queue.
- Specified by:
createSession
in interface Connection
- Returns:
- null
- Throws:
JMSException
- See Also:
Connection.createSession(boolean, int)
getClientID
public String getClientID()
throws JMSException
- The connection client ID contains the space name together with the
Destination name, "space name_destination name" e.g. "JavaSpaces_MyTopic"
- Specified by:
getClientID
in interface Connection
- Returns:
- String m_clientID
- Throws:
JMSException
- See Also:
Connection.getClientID()
setClientID
public void setClientID(String clientID)
throws JMSException
- The connection client ID contains the random connection Key + hostname +
space name + destination name "space name_destination name" e.g.
"JavaSpaces_MyTopic" Client cannot set a clientID more then once.
- Specified by:
setClientID
in interface Connection
- Parameters:
clientID
-
- Throws:
IllegalStateException
JMSException
- See Also:
Connection.setClientID(java.lang.String)
getMetaData
public ConnectionMetaData getMetaData()
throws JMSException
- Specified by:
getMetaData
in interface Connection
- Throws:
JMSException
- See Also:
Connection.getMetaData()
,
GSConnectionMetaDataImpl
getExceptionListener
public ExceptionListener getExceptionListener()
throws JMSException
- Specified by:
getExceptionListener
in interface Connection
- Throws:
JMSException
- See Also:
Connection.getExceptionListener()
setExceptionListener
public void setExceptionListener(ExceptionListener listener)
throws JMSException
- Specified by:
setExceptionListener
in interface Connection
- Throws:
JMSException
- See Also:
Connection.setExceptionListener(javax.jms.ExceptionListener)
start
public void start()
throws JMSException
- Overwrite of the API method for starting the Topic connection. Loops on
all the sessions and starts them.
- Specified by:
start
in interface Connection
- Throws:
IllegalStateException
- If the connection is closed or broken.
JMSException
stop
public void stop()
throws JMSException
- Overwrite of the API method for stoping the Topic connection.
- Specified by:
stop
in interface Connection
- Throws:
IllegalStateException
- If the connection is closed or broken.
JMSException
- See Also:
Connection.stop()
close
public void close()
throws JMSException
- API method for closing the connection; even if the connection appears to
be broken, closes the sessions. Loops on all the sessions and closes
them. If one or more of the connection�s session�s message listeners is
processing a message at the point when connection close is invoked, all
the facilities of the connection and its sessions must remain available
to those listeners until they return control to the JMS provider. When
connection close is invoked it should not return until message processing
has been shut down in an orderly fashion. This means that all message
listeners that may have been running have returned, and that all pending
receives have returned.
- Specified by:
close
in interface Connection
- Throws:
JMSException
- Actually never thrown.
createConnectionConsumer
public ConnectionConsumer createConnectionConsumer(Destination destination,
String messageSelector,
ServerSessionPool sessionPool,
int maxMessages)
throws JMSException
- Specified by:
createConnectionConsumer
in interface Connection
- Throws:
JMSException
- See Also:
Connection.createConnectionConsumer(javax.jms.Destination,
java.lang.String, javax.jms.ServerSessionPool, int)
createDurableConnectionConsumer
public ConnectionConsumer createDurableConnectionConsumer(Topic topic,
String subscriptionName,
String messageSelector,
ServerSessionPool sessionPool,
int maxMessages)
throws JMSException
- Specified by:
createDurableConnectionConsumer
in interface Connection
- Specified by:
createDurableConnectionConsumer
in interface TopicConnection
- Throws:
JMSException
- See Also:
Connection.createDurableConnectionConsumer(javax.jms.Topic,
java.lang.String, java.lang.String, javax.jms.ServerSessionPool,
int)
getTransaction
public Transaction getTransaction(boolean localTransaction,
long leaseTime)
throws com.j_spaces.jms.TransactionCreateException
- create a new local transaction instance and use it in case of a
transacted JMS session.
- Parameters:
leaseTime
-
- Returns:
- tr
- Throws:
JMSException
com.j_spaces.jms.TransactionCreateException
toString
public String toString()
- Overrides:
toString
in class Object
getCompressionMinSize
public int getCompressionMinSize()
- Returns:
- Returns the compressionMinSize.
The minimum size (in bytes) which from where we start to compress all
the message body.
e.g. if a 1 MB Text JMSMessage body is sent, and the compressionMinSize
value is 500000 (0.5MB) then we will compress that message body (only),
otherwise we will send (write) it as is.
TODO Currently this configured via system property
later will be part of the JMS-config.xml
default value is 0.5 MB
createConnectionConsumer
public ConnectionConsumer createConnectionConsumer(Queue queue,
String messageSelector,
ServerSessionPool sessionPool,
int maxMessages)
throws JMSException
- Specified by:
createConnectionConsumer
in interface QueueConnection
- Throws:
JMSException
- See Also:
QueueConnection.createConnectionConsumer(Queue, String, ServerSessionPool, int)
createQueueSession
public QueueSession createQueueSession(boolean transacted,
int acknowledgeMode)
throws JMSException
- Specified by:
createQueueSession
in interface QueueConnection
- Throws:
JMSException
- See Also:
QueueConnection.createQueueSession(boolean, int)
createConnectionConsumer
public ConnectionConsumer createConnectionConsumer(Topic topic,
String messageSelector,
ServerSessionPool sessionPool,
int maxMessages)
throws JMSException
- Specified by:
createConnectionConsumer
in interface TopicConnection
- Throws:
JMSException
- See Also:
TopicConnection.createConnectionConsumer(Topic, String, ServerSessionPool, int)
createTopicSession
public TopicSession createTopicSession(boolean transacted,
int acknowledgeMode)
throws JMSException
- Specified by:
createTopicSession
in interface TopicConnection
- Throws:
JMSException
- See Also:
TopicConnection.createTopicSession(boolean, int)