|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--jrun.jms.core.server.JmsServerSession
A session represents a server side endpoint to the JMSServer. A client can create producers, consumers and destinations through the session in addi- tion to other functions. A session has a unique identifer which is a comb- ination of clientId-connectionId-sessionId.
A session represents a single-threaded context which implies that it cannot be used with more than one thread concurrently. Threads registered with this session are synchronized.
Finally, instances of this object can only be created by classes within the same package.
org.exolab.jms.server.JmsConnection| Method Summary | |
void |
acknowledgeMessage(long clientId,
java.lang.String id)
Acknowledge that the message with the following id has been processed |
void |
close()
Close and release any resource allocated to this session. |
void |
commit()
Commit this session, which will acknowledge all sent messages for all consumers. |
void |
commit(java.lang.String[] messages)
Commit this session, which will acknowledge all sent messages for all consumers. |
boolean |
containsUnackedHandle(MessageHandle handle)
Check if the specified message handle is in the session's list of unacked messages |
void |
createBrowser(JmsQueue queue,
long clientId,
java.lang.String selector)
Create a queue browser for this session. |
void |
createPublisher(JmsTopic topic)
This should be a no operation. |
void |
createQueue(JmsQueue queue)
Create an amdinistered queue, through the message manager admin interface. |
void |
createReceiver(JmsQueue queue,
long clientId,
java.lang.String selector)
Create a receiver endpoint for this session. |
void |
createSender(JmsQueue queue)
This is a noop |
void |
createSubscriber(JmsTopic topic,
java.lang.String name,
long clientId,
java.lang.String selector,
boolean noLocal)
Create a subscriber endpoint for this session. |
void |
createTopic(JmsTopic topic)
Create an administered topic, through the message manager admin interface. |
void |
deleteBrowser(long clientId)
Delete the queue browser associated with the specified queue from the session. |
void |
deletePublisher(JmsTopic topic)
Delete the publisher associated with the specified topic from the session. |
void |
deleteReceiver(long clientId)
Delete the receiver with the specified identity and clean up all associated resources. |
void |
deleteSender(long clientId)
Delete the sender associated with the specified queue from the session If the corresponding sender does not exist or it cannot delete it then throw the JMSException. |
void |
deleteSubscriber(long clientId)
This function deletes a persistent subsrciber and its history from the database. |
void |
enableAsynchronousDelivery(long clientId,
long id,
boolean enable)
Check whether to enable asynchronous message delivery for a particular consumer |
java.lang.String |
getClientId()
Return a reference to the client id |
protected Logger |
getLogger()
Return an instance of the logger |
java.lang.String |
getSessionId()
Return a reference to the session id |
boolean |
isClientEndpointActive()
This will send a null message down the connection to the client to test whether the client endpoint is alive. |
void |
onMessage(MessageHandle handle,
boolean ack)
When consumers register message listeners then all messages for all consumers for that session will be sent through this method. |
void |
onMessages(java.util.Vector handles)
This call is currently on used for the QueueBrowserEndpoint. |
javax.jms.Message |
receiveMessage(long clientId,
long wait)
Return the next message for the specified client. |
java.util.Vector |
receiveMessages(long clientId,
int count)
Return upto count messages from the endpoint with the specified client identity. |
void |
recover()
Call recover on all registered consumers. |
void |
rollback()
Abort, will return all unacked messages to their respective endpoints, if they are still active. |
void |
rollback(java.lang.String[] messages)
Abort, will return group of unacked messages to their respective endpoints, if they are still active. |
void |
sendMessage(javax.jms.Message message)
Send the specified message to the server. |
void |
sendMessages(java.util.Vector messages)
Send the specified messages to the server. |
void |
setMessageListener(JmsMessageListener listener)
Set a message listener for the session. |
void |
start()
Start the message delivery for the session. |
void |
startMessageDelivery()
Start message delivery to this session. |
void |
stop()
Stop message delivery for the session |
void |
stopMessageDelivery()
Stop message delivery to this session. |
void |
unsubscribe(java.lang.String name)
Unsubscribe a durable subscription. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public java.lang.String getClientId()
public java.lang.String getSessionId()
public void start()
public void stop()
public void close()
throws javax.jms.JMSException
JMSException -
public void acknowledgeMessage(long clientId,
java.lang.String id)
throws javax.jms.JMSException
clientId - - the clientId that sent the message to the clientid - - message to ackJMSException - - if method does not complete
public void sendMessage(javax.jms.Message message)
throws javax.jms.JMSException
message - message to sendJMSException -
public void sendMessages(java.util.Vector messages)
throws javax.jms.JMSException
messages - messages to sendJMSException -
public javax.jms.Message receiveMessage(long clientId,
long wait)
throws javax.jms.JMSException
wait
parameter indicates how long many milliseconds to wait for a message
before returning. If wait is 0 then do not wait at all. If
wait is -1 then wait indefinitely for the next messageclientId - the client identitywait - number of ms to waitJMSException - if there is an app level problem
public java.util.Vector receiveMessages(long clientId,
int count)
throws javax.jms.JMSException
QueueBrowserEndpoint then do not process the request and
throw a JMSException exception. The reason for this is that this
method does not take into account any acking policy. The messages
are not placed on any sent list.clientId - the client identitycount - the maximum number of messages retrieveJMSException - if there is an app level problem
public void createQueue(JmsQueue queue)
throws javax.jms.JMSException
queue - - administered queue to createJMSException -
public void createTopic(JmsTopic topic)
throws javax.jms.JMSException
topic - - administered topic to createJMSException -
public void createReceiver(JmsQueue queue,
long clientId,
java.lang.String selector)
throws javax.jms.JMSException
You cannot create more than one receiver for the same destination
queue - receiver destinationconsumerId - the client session allocated
identifier of the consumerselector - the selector to filter messages.
This may be null.JMSException. -
public void createSender(JmsQueue queue)
throws javax.jms.JMSException
public void createBrowser(JmsQueue queue,
long clientId,
java.lang.String selector)
throws javax.jms.JMSException
You cannot create more than one queue browser for the same queue in a single session.
queue - queue to browseclientId - the client identityselector - message selector. This may be nullJMSException. -
public void deleteReceiver(long clientId)
throws javax.jms.JMSException
queue - receiver's queueJMSException. -
public void deleteSender(long clientId)
throws javax.jms.JMSException
clientId - the client identityJMSException. -
public void deleteBrowser(long clientId)
throws javax.jms.JMSException
clientId - identity of the browserJMSException. -
public void createSubscriber(JmsTopic topic,
java.lang.String name,
long clientId,
java.lang.String selector,
boolean noLocal)
throws javax.jms.JMSException
Note that the message manager manages consumers for all server sessions
You cannot create more than one subscriber for the same destination. Currently we don't check this
topic - subscriber destinationname - consumer nameclientId - the client session allocated
identifier of the consumerselector - the selector to filter messages.
This may be null.noLocal - true to inhibit consumption of messages
published on this connection.JMSException. -
public void createPublisher(JmsTopic topic)
throws javax.jms.JMSException
topic - receiver destinationJMSException. -
public void deleteSubscriber(long clientId)
throws javax.jms.JMSException
The data contains information necessary to delete the subscriber
clientId - the client identityJMSException. -
public void deletePublisher(JmsTopic topic)
throws javax.jms.JMSException
topic - sender destinationJMSException. -
public void unsubscribe(java.lang.String name)
throws javax.jms.JMSException
name - the name used to uniquelly identify the
subscriptionJMSException - if the subscription cannot be removed
or any other problem.
public void stopMessageDelivery()
throws javax.jms.JMSException
JMSException -
public void startMessageDelivery()
throws javax.jms.JMSException
JMSException - public boolean containsUnackedHandle(MessageHandle handle)
handle - - the handle to query
public void onMessage(MessageHandle handle,
boolean ack)
onMessage in interface InternalMessageListenerhandle - - message to sendack - - false ignores the acking policypublic boolean isClientEndpointActive()
public void onMessages(java.util.Vector handles)
onMessages in interface InternalMessageListenerhandles - - collection of handlespublic void setMessageListener(JmsMessageListener listener)
listener - message listener
public void enableAsynchronousDelivery(long clientId,
long id,
boolean enable)
throws javax.jms.JMSException
clientId - - the id of the client to checkid - - the last processed messageenable - - true to enable; false to disable
public void recover()
throws javax.jms.JMSException
JMSException - - it will throw JMSException if it cannot
complete this request.
public void commit(java.lang.String[] messages)
throws javax.jms.JMSException
JMSException - - if there are any problems
public void commit()
throws javax.jms.JMSException
JMSException - - if there are any problems
public void rollback(java.lang.String[] messages)
throws javax.jms.JMSException
messages - to be returnedJMSException - - if there are any problems
public void rollback()
throws javax.jms.JMSException
JMSException - - if there are any problemsprotected Logger getLogger()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||