|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.j_spaces.jms.GSSessionImpl
public class GSSessionImpl
GigaSpaces implementation of the javax.jms.Session
interface.
Limitations:
- Sessions support only a single MessageConsumer
.
- Durable subscribers are not supported.
- StreamMessage is not supported.
Session
Field Summary | |
---|---|
static long |
txLeaseTime
|
Fields inherited from interface javax.jms.Session |
---|
AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, SESSION_TRANSACTED |
Fields inherited from interface javax.jms.Session |
---|
AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, SESSION_TRANSACTED |
Fields inherited from interface javax.jms.Session |
---|
AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, SESSION_TRANSACTED |
Constructor Summary | |
---|---|
GSSessionImpl(com.j_spaces.jms.GSConnectionImpl conn,
boolean isTransacted,
int acknowledgeMode)
Creates a session. |
Method Summary | |
---|---|
void |
close()
|
void |
commit()
Commits all messages done in this transaction and releases any locks currently held. |
QueueBrowser |
createBrowser(Queue queue)
|
QueueBrowser |
createBrowser(Queue queue,
String messageSelector)
|
BytesMessage |
createBytesMessage()
Creates a GSBytesMessageImpl object. |
BytesMessage |
createBytesMessage(byte[] bytesArrayBody)
Creates a GSBytesMessageImpl object. |
MessageConsumer |
createConsumer(Destination destination)
|
MessageConsumer |
createConsumer(Destination destination,
String messageSelector)
|
MessageConsumer |
createConsumer(Destination destination,
String messageSelector,
boolean noLocal)
|
TopicSubscriber |
createDurableSubscriber(Topic topic,
String name)
Currently not supported. |
TopicSubscriber |
createDurableSubscriber(Topic topic,
String name,
String messageSelector,
boolean noLocal)
Currently not supported. |
MapMessage |
createMapMessage()
Creates a GSMapMessageImpl object. |
Message |
createMessage()
|
ObjectMessage |
createObjectMessage()
Creates a GSObjectMessageImpl object. |
ObjectMessage |
createObjectMessage(Serializable object)
Creates a GSObjectMessageImpl object. |
MessageProducer |
createProducer(Destination destination)
|
TopicPublisher |
createPublisher(Topic topic)
|
Queue |
createQueue(String queueName)
|
QueueReceiver |
createReceiver(Queue queue)
|
QueueReceiver |
createReceiver(Queue queue,
String messageSelector)
|
QueueSender |
createSender(Queue queue)
|
StreamMessage |
createStreamMessage()
Creates a StreamMessage object. |
TopicSubscriber |
createSubscriber(Topic topic)
|
TopicSubscriber |
createSubscriber(Topic topic,
String messageSelector,
boolean noLocal)
|
TemporaryQueue |
createTemporaryQueue()
We use the same space proxy we obtained in the session and we write another External Entry, which will have a class name of 'TempQueue'. |
TemporaryTopic |
createTemporaryTopic()
Creates a TemporaryTopic object. |
TextMessage |
createTextMessage()
Creates an initialized TextMessage object. |
TextMessage |
createTextMessage(String text)
Creates an initialized TextMessage object. |
Topic |
createTopic(String topicName)
|
int |
getAcknowledgeMode()
JMS 1.1 API |
int |
getConsumersC()
|
String |
getJMSProviderName()
|
MessageListener |
getMessageListener()
|
int |
getMessagesC()
|
int |
getNumOfConsumedMsg()
|
int |
getNumOfProducedMsg()
|
int |
getProducersC()
|
String |
getSessionID()
|
boolean |
getTransacted()
|
void |
recover()
|
void |
rollback()
API method for m_tx rollback Calling the space LocalTransactionManager m_tx.abort() |
void |
run()
|
void |
setConsumersC(int i)
|
void |
setMessageListener(MessageListener listener)
|
void |
setMessagesC(int i)
|
void |
setProducersC(int i)
|
void |
setSessionID(String string)
|
String |
toString()
|
void |
unsubscribe(String subscriptionName)
Currently not supported. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final long txLeaseTime
Constructor Detail |
---|
public GSSessionImpl(com.j_spaces.jms.GSConnectionImpl conn, boolean isTransacted, int acknowledgeMode) throws JMSException
conn
- The connection the session belongs to.isTransacted
- true
for a transacted session.acknowledgeMode
- 1 (auto), 2 (client) or 3 (dups ok).
JMSException
- In case of an invalid acknowledge mode.Method Detail |
---|
public String getJMSProviderName()
public BytesMessage createBytesMessage() throws JMSException
GSBytesMessageImpl
object. A BytesMessage
object is used to send a message containing a stream of
uninterpreted bytes.
createBytesMessage
in interface Session
JMSException
- if the JMS provider fails to create this message due to
some internal error.
IllegalStateException
- If the session is closed.Session.createBytesMessage()
public BytesMessage createBytesMessage(byte[] bytesArrayBody) throws JMSException
GSBytesMessageImpl
object. A BytesMessage
object is used to send a message containing a stream of
uninterpreted bytes. This method is used in MessageConsumer.recieve()
when the JMSMessageID is known already.
bytesArrayBody
-
JMSException
- if the JMS provider fails to create this message due to
some internal error.
IllegalStateException
- If the session is closed.Session.createBytesMessage()
public MapMessage createMapMessage() throws JMSException
GSMapMessageImpl
object. A
GSMapMessageImpl
object is used to send a self-defining set of
name-value pairs, where names are String
objects and
values are primitive values in the Java programming language.
createMapMessage
in interface Session
JMSException
- if the JMS provider fails to create this message due to
some internal error.
IllegalStateException
- If the session is closed.Session.createMapMessage()
public Message createMessage() throws JMSException
createMessage
in interface Session
IllegalStateException
- If the session is closed.
JMSException
Session.createMessage()
public ObjectMessage createObjectMessage() throws JMSException
GSObjectMessageImpl
object. A
GSObjectMessageImpl
object is used to send a Serializable java
object.
createObjectMessage
in interface Session
IllegalStateException
- If the session is closed.
JMSException
Session.createObjectMessage()
public ObjectMessage createObjectMessage(Serializable object) throws JMSException
GSObjectMessageImpl
object. A
GSObjectMessageImpl
object is used to send a Serializable java
object.
createObjectMessage
in interface Session
object
-
IllegalStateException
- If the session is closed.
JMSException
Session.createObjectMessage(java.io.Serializable)
public StreamMessage createStreamMessage() throws JMSException
StreamMessage
object. A StreamMessage
object is used to send a
self-defining stream of primitive values in the Java programming language.
createStreamMessage
in interface Session
IllegalStateException
- If the session is closed.
JMSException
Session.createStreamMessage()
public TextMessage createTextMessage() throws JMSException
TextMessage
object. A
TextMessage
object is used to send a message containing a
String
.
createTextMessage
in interface Session
JMSException
- if the JMS provider fails to create this message due to
some internal error.
IllegalStateException
- If the session is closed.Session.createTextMessage()
public TextMessage createTextMessage(String text) throws JMSException
TextMessage
object. A
TextMessage
object is used to send a message containing a
String
.
createTextMessage
in interface Session
text
- the string used to initialize this message
JMSException
- if the JMS provider fails to create this message due to
some internal error.
IllegalStateException
- If the session is closed.Session.createTextMessage(java.lang.String)
public boolean getTransacted() throws JMSException
getTransacted
in interface Session
JMSException
Session.getTransacted()
public int getAcknowledgeMode() throws IllegalStateException
getAcknowledgeMode
in interface Session
IllegalStateException
Session.getAcknowledgeMode()
public void commit() throws JMSException
commit
in interface Session
IllegalStateException
- If the session is m_closed or it is NOT transacted
JMSException
Session.commit()
public void rollback() throws JMSException
rollback
in interface Session
IllegalStateException
- If the session is closed.
JMSException
Session.rollback()
public void recover() throws JMSException
recover
in interface Session
JMSException
Session.recover()
public void close() throws JMSException
close
in interface Session
JMSException
Session.close()
public MessageListener getMessageListener() throws JMSException
getMessageListener
in interface Session
JMSException
public void setMessageListener(MessageListener listener) throws JMSException
setMessageListener
in interface Session
JMSException
public void run()
run
in interface Runnable
run
in interface Session
public MessageProducer createProducer(Destination destination) throws JMSException
createProducer
in interface Session
JMSException
Session.createProducer(javax.jms.Destination)
public MessageConsumer createConsumer(Destination destination) throws JMSException
createConsumer
in interface Session
JMSException
Session.createConsumer(Destination)
public MessageConsumer createConsumer(Destination destination, String messageSelector) throws JMSException
createConsumer
in interface Session
JMSException
Session.createConsumer(Destination, String)
public MessageConsumer createConsumer(Destination destination, String messageSelector, boolean noLocal) throws JMSException
createConsumer
in interface Session
JMSException
Session.createConsumer(Destination, String, boolean)
public String getSessionID()
public void setSessionID(String string)
string
- public int getConsumersC()
public int getMessagesC()
public int getProducersC()
public void setConsumersC(int i)
public void setMessagesC(int i)
public void setProducersC(int i)
public String toString()
toString
in class Object
public int getNumOfConsumedMsg()
public int getNumOfProducedMsg()
public void unsubscribe(String subscriptionName) throws JMSException
unsubscribe
in interface Session
unsubscribe
in interface TopicSession
JMSException
Session.unsubscribe(String)
public TopicSubscriber createDurableSubscriber(Topic topic, String name, String messageSelector, boolean noLocal) throws JMSException
createDurableSubscriber
in interface Session
createDurableSubscriber
in interface TopicSession
JMSException
Session.createDurableSubscriber(Topic, String, String, boolean)
public TopicSubscriber createDurableSubscriber(Topic topic, String name) throws JMSException
createDurableSubscriber
in interface Session
createDurableSubscriber
in interface TopicSession
JMSException
Session.createDurableSubscriber(Topic, String)
public TemporaryTopic createTemporaryTopic() throws JMSException
TemporaryTopic
object. Its lifetime will be that
of the TopicConnection
unless it is deleted earlier.
We use the same space proxy we obtained in the session and we write
another External Entry, which will have a class name of 'TempQueue_ < >.
The only message m_consumers that can consume from a temporary
destination are those created by the same connection that created the
destination. Any message producer can send to the temporary destination.
If you close the connection that a temporary destination belongs to, the
destination is closed and its contents lost. You can use temporary
destinations to implement a simple request/reply mechanism. If you create
a temporary destination and specify it as the value of the JMSReplyTo
message header field when you send a message, the consumer of the message
can use the value of the JMSReplyTo field as the destination to which it
sends a reply and can also reference the original request by setting the
JMSCorrelationID header field of the reply message to the value of the
JMSMessageID header field of the request.
createTemporaryTopic
in interface Session
createTemporaryTopic
in interface TopicSession
JMSException
Session.createTemporaryQueue()
public Topic createTopic(String topicName) throws JMSException
createTopic
in interface Session
createTopic
in interface TopicSession
JMSException
Session.createTopic(java.lang.String)
public Queue createQueue(String queueName) throws JMSException
createQueue
in interface QueueSession
createQueue
in interface Session
JMSException
Session.createQueue(java.lang.String)
public QueueBrowser createBrowser(Queue queue) throws JMSException
createBrowser
in interface QueueSession
createBrowser
in interface Session
JMSException
Session.createBrowser(javax.jms.Queue)
public QueueBrowser createBrowser(Queue queue, String messageSelector) throws JMSException
createBrowser
in interface QueueSession
createBrowser
in interface Session
JMSException
Session.createBrowser(javax.jms.Queue, java.lang.String)
public TemporaryQueue createTemporaryQueue() throws JMSException
createTemporaryQueue
in interface QueueSession
createTemporaryQueue
in interface Session
JMSException
Session.createTemporaryQueue()
public TopicPublisher createPublisher(Topic topic) throws JMSException
createPublisher
in interface TopicSession
JMSException
TopicSession.createPublisher(Topic)
public TopicSubscriber createSubscriber(Topic topic) throws JMSException
createSubscriber
in interface TopicSession
JMSException
TopicSession.createSubscriber(Topic)
public TopicSubscriber createSubscriber(Topic topic, String messageSelector, boolean noLocal) throws JMSException
createSubscriber
in interface TopicSession
JMSException
TopicSession.createSubscriber(Topic, String, boolean)
public QueueReceiver createReceiver(Queue queue) throws JMSException
createReceiver
in interface QueueSession
JMSException
QueueSession.createReceiver(Queue)
public QueueReceiver createReceiver(Queue queue, String messageSelector) throws JMSException
createReceiver
in interface QueueSession
JMSException
QueueSession.createReceiver(Queue, String)
public QueueSender createSender(Queue queue) throws JMSException
createSender
in interface QueueSession
JMSException
QueueSession.createSender(Queue)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |