|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.j_spaces.jms.GSSessionImpl com.j_spaces.jms.GSQueueSessionImpl
public class GSQueueSessionImpl
GigaSpaces implementation of the javax.jms.QueueSession
interface.
A QueueSession
object provides methods for creating
QueueReceiver
, QueueSender
,
TBD --
QueueBrowser
, and TemporaryQueue
objects.
If there are messages that have been received but not acknowledged
when a QueueSession
terminates, these messages will be retained
and redelivered when a consumer next accesses the queue.
A QueueSession
is used for creating Point-to-Point specific
objects. In general, use the Session
object.
The QueueSession
is used to support
existing code. Using the Session
object simplifies the
programming model, and allows transactions to be used across the two
messaging domains.
A QueueSession
cannot be used to create objects specific to the
publish/subscribe domain. The following methods inherit from
Session
, but must throw an
IllegalStateException
if they are used from QueueSession
:
createDurableSubscriber
createTemporaryTopic
createTopic
unsubscribe
Session
,
QueueConnection.createQueueSession(boolean, int)
,
XAQueueSession.getQueueSession()
Field Summary |
---|
Fields inherited from class com.j_spaces.jms.GSSessionImpl |
---|
ackLeaseTime, invalidSelectorIdentifiers, JMSX_CLIENT_NAMES, m_sessionID, reservedSelectorIdentifiers, txLeaseTime |
Fields inherited from interface javax.jms.Session |
---|
AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, SESSION_TRANSACTED |
Constructor Summary | |
---|---|
GSQueueSessionImpl(com.j_spaces.jms.GSConnectionImpl connection,
boolean transacted,
int acknowledgeMode,
Transaction transaction)
Constructs a queue session. |
Method Summary | |
---|---|
QueueBrowser |
createBrowser(Queue queue)
|
QueueBrowser |
createBrowser(Queue queue,
String messageSelector)
|
TopicSubscriber |
createDurableSubscriber(Topic topic,
String name)
API method. |
TopicSubscriber |
createDurableSubscriber(Topic topic,
String name,
String selector,
boolean noLocal)
API method. |
Queue |
createQueue(String queueName)
|
QueueReceiver |
createReceiver(Queue queue)
Creates a GSQueueReceiverImpl object to receive messages from the
specified queue. |
QueueReceiver |
createReceiver(Queue queue,
String messageSelector)
Not An API method, it is a GS implementation which uses a hashtable msg selector instead of a String. |
QueueSender |
createSender(Queue queue)
Creates a QueueSender object to send messages to the
specified queue. |
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()
|
Topic |
createTopic(String topicName)
API method. |
void |
unsubscribe(String name)
API method. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface javax.jms.Session |
---|
close, commit, createBytesMessage, createConsumer, createConsumer, createConsumer, createMapMessage, createMessage, createObjectMessage, createObjectMessage, createProducer, createStreamMessage, createTextMessage, createTextMessage, getAcknowledgeMode, getMessageListener, getTransacted, recover, rollback, run, setMessageListener |
Constructor Detail |
---|
public GSQueueSessionImpl(com.j_spaces.jms.GSConnectionImpl connection, boolean transacted, int acknowledgeMode, Transaction transaction) throws JMSException
connection
- The connection the session belongs to.transacted
- true
for a transacted session.acknowledgeMode
- 1 (auto), 2 (client) or 3 (dups ok).transaction
- transaction
JMSException
- In case of an invalid acknowledge mode.Method Detail |
---|
public QueueReceiver createReceiver(Queue queue) throws JMSException
GSQueueReceiverImpl
object to receive messages from the
specified queue.
We assure that one and only one QueueReceiver is been
created, using writing a JMSSessionDataEntry to the space.
createReceiver
in interface QueueSession
queue
- the Queue
to access
JMSException
- if the session fails to create a receiver
due to some internal error.
InvalidDestinationException
- if an invalid queue is specified.
IllegalStateException
- if the session is m_closedQueueSession.createReceiver(javax.jms.Queue)
public QueueReceiver createReceiver(Queue queue, String messageSelector) throws JMSException
GSQueueReceiverImpl
object to receive messages from the
specified queue using a message selector.
We assure that one and only one QueueReceiver is been
created, using writing to space.
createReceiver
in interface QueueSession
queue
- the Queue
to accessmessageSelector
- only messages with properties matching the
message selector expression are delivered. A value of null or
an empty string indicates that there is no message selector
for the message consumer.
JMSException
- if the session fails to create a receiver
due to some internal error.
InvalidDestinationException
- if an invalid queue is specified.
InvalidSelectorException
- if the message selector is invalid.QueueSession.createReceiver(javax.jms.Queue, java.lang.String)
public QueueSender createSender(Queue queue) throws JMSException
QueueSender
object to send messages to the
specified queue.
We let the client create more then a single QueueSender, but we write its instance id
into the space, same as we do with the Receiver.
createSender
in interface QueueSession
queue
- the Queue
to access, or null if this is an
unidentified producer
JMSException
- if the session fails to create a sender
due to some internal error.
InvalidDestinationException
- if an invalid queue is specified.QueueSession.createSender(javax.jms.Queue)
public TopicSubscriber createDurableSubscriber(Topic topic, String name, String selector, boolean noLocal) throws JMSException
createDurableSubscriber
in interface Session
createDurableSubscriber
in class GSSessionImpl
IllegalStateException
- Systematically.
JMSException
public TopicSubscriber createDurableSubscriber(Topic topic, String name) throws JMSException
createDurableSubscriber
in interface Session
createDurableSubscriber
in class GSSessionImpl
IllegalStateException
- Systematically.
JMSException
public Topic createTopic(String topicName) throws JMSException
createTopic
in interface Session
createTopic
in class GSSessionImpl
IllegalStateException
- Systematically.
JMSException
public Queue createQueue(String queueName) throws JMSException
createQueue
in interface QueueSession
createQueue
in interface Session
createQueue
in class GSSessionImpl
JMSException
Session.createQueue(java.lang.String)
public QueueBrowser createBrowser(Queue queue) throws JMSException
createBrowser
in interface QueueSession
createBrowser
in interface Session
createBrowser
in class GSSessionImpl
JMSException
Session.createBrowser(javax.jms.Queue)
public QueueBrowser createBrowser(Queue queue, String messageSelector) throws JMSException
createBrowser
in interface QueueSession
createBrowser
in interface Session
createBrowser
in class GSSessionImpl
JMSException
Session.createBrowser(javax.jms.Queue, java.lang.String)
public TemporaryQueue createTemporaryQueue() throws JMSException
createTemporaryQueue
in interface QueueSession
createTemporaryQueue
in interface Session
createTemporaryQueue
in class GSSessionImpl
JMSException
Session.createTemporaryQueue()
public void unsubscribe(String name) throws JMSException
unsubscribe
in interface Session
unsubscribe
in class GSSessionImpl
IllegalStateException
- Systematically.
JMSException
public TemporaryTopic createTemporaryTopic() throws JMSException
createTemporaryTopic
in interface Session
createTemporaryTopic
in class GSSessionImpl
JMSException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |