|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.j_spaces.jms.GSQueueConnectionImpl
public class GSQueueConnectionImpl
Implements the javax.jms.QueueConnection
interface.
GigaSpaces implementation of the JMS QueueConnection 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 </blockquote>
Constructor Summary GSQueueConnectionImpl(GSConnectionFactoryImpl _connFacParent)
Constructor: Calling super com.j_spaces.jms.GSConnectionImpl.
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)
When called on aQueueConnection
it throwsIllegalStateException
.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()
Methods inherited from class java.lang.Object equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Constructor Detail GSQueueConnectionImpl
public GSQueueConnectionImpl(GSConnectionFactoryImpl _connFacParent) throws JMSException
- Constructor: Calling super com.j_spaces.jms.GSConnectionImpl.
- Parameters:
_connFacParent
- connection factory- Throws:
JMSException
Method Detail createDurableConnectionConsumer
public ConnectionConsumer createDurableConnectionConsumer(Topic topic, String subscriptionName, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException
- When called on a
QueueConnection
it throwsIllegalStateException
.
- Specified by:
createDurableConnectionConsumer
in interfaceConnection
- Specified by:
createDurableConnectionConsumer
in interfaceTopicConnection
- Throws:
JMSException
- See Also:
Connection.createDurableConnectionConsumer(Topic, String, String, ServerSessionPool, int)
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 interfaceConnection
- 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 interfaceConnection
- 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 interfaceConnection
- Parameters:
clientID
-- Throws:
IllegalStateException
JMSException
- See Also:
Connection.setClientID(java.lang.String)
getMetaData
public ConnectionMetaData getMetaData() throws JMSException
- Specified by:
getMetaData
in interfaceConnection
- Throws:
JMSException
- See Also:
Connection.getMetaData()
,GSConnectionMetaDataImpl
getExceptionListener
public ExceptionListener getExceptionListener() throws JMSException
- Specified by:
getExceptionListener
in interfaceConnection
- Throws:
JMSException
- See Also:
Connection.getExceptionListener()
setExceptionListener
public void setExceptionListener(ExceptionListener listener) throws JMSException
- Specified by:
setExceptionListener
in interfaceConnection
- 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 interfaceConnection
- 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 interfaceConnection
- 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 interfaceConnection
- Throws:
JMSException
- Actually never thrown.
createConnectionConsumer
public ConnectionConsumer createConnectionConsumer(Destination destination, String messageSelector, ServerSessionPool sessionPool, int maxMessages) throws JMSException
- Specified by:
createConnectionConsumer
in interfaceConnection
- Throws:
JMSException
- See Also:
Connection.createConnectionConsumer(javax.jms.Destination, 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 classObject
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 interfaceQueueConnection
- Throws:
JMSException
- See Also:
QueueConnection.createConnectionConsumer(Queue, String, ServerSessionPool, int)
createQueueSession
public QueueSession createQueueSession(boolean transacted, int acknowledgeMode) throws JMSException
- Specified by:
createQueueSession
in interfaceQueueConnection
- 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 interfaceTopicConnection
- Throws:
JMSException
- See Also:
TopicConnection.createConnectionConsumer(Topic, String, ServerSessionPool, int)
createTopicSession
public TopicSession createTopicSession(boolean transacted, int acknowledgeMode) throws JMSException
- Specified by:
createTopicSession
in interfaceTopicConnection
- Throws:
JMSException
- See Also:
TopicConnection.createTopicSession(boolean, int)
Overview Package Class Tree Deprecated Index Help PREV CLASS NEXT CLASS FRAMES NO FRAMES SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD