org.exolab.jms.server.rmi
Interface RemoteJmsServerSessionIfc

All Superinterfaces:
java.rmi.Remote
All Known Implementing Classes:
RmiJmsServerSession

public interface RemoteJmsServerSessionIfc
extends java.rmi.Remote

This is an RMI wrapper for the JmsServerSession object. It allows remote access to this object.

For more semantic information on this object refer to org.exolab.jms.server. JmsServerSession.

All the methods throw RemoteException which is used to indicate an RMI specific error.

Version:
$Revision: 1.18 $ $Date: 2003/08/07 13:33:10 $
Author:
Jim Alateras
See Also:
JmsServerSession, RemoteJmsServerConnectionIfc

Method Summary
 void acknowledgeMessage(long clientId, java.lang.String messageId)
          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 the session.
 void commit(javax.transaction.xa.Xid xid, boolean onePhase)
          Commits an XA transaction that is in progress.
 void createBrowser(JmsQueue queue, long clientId, java.lang.String selector)
          Create a queue browser for this session.
 void createPublisher(JmsTopic topic)
          Create a publisher endpoint for this session.
 void createQueue(JmsQueue queue)
          Create a queue with the specified name.
 void createReceiver(JmsQueue queue, long clientId, java.lang.String selector)
          Create a receiver endpoint for this session.
 void createSender(JmsQueue queue)
          Create a sender endpoint for this session.
 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 a topic with the specified name.
 void deleteBrowser(long clientId)
          Delete the queue browser associated with the specified queue from the session.
 void deletePublisher(JmsTopic topic)
          Delete the publisher for the specified topic.
 void deleteReceiver(long clientId)
          Delete the specified receiver
 void deleteSender(long clientId)
          Delete the sender for the specified queue.
 void deleteSubscriber(long clientId)
          Delete the subscriber for the specified topic.
 void enableAsynchronousDelivery(long clientId, java.lang.String id, boolean enable)
          Enable or disable asynchronous message delivery for a particular consumer
 void end(javax.transaction.xa.Xid xid, int flags)
          Ends the work performed on behalf of a transaction branch.
 void forget(javax.transaction.xa.Xid xid)
          Tell the resource manager to forget about a heuristically completed transaction branch.
 java.lang.String getClientId()
          Return a reference to the client id.
 java.lang.String getResourceManagerId()
          Return the resource manager identity
 java.lang.String getSessionId()
          Return a reference to the session id
 int getTransactionTimeout()
          Return the transaction timeout for this instance of the resource manager.
 int prepare(javax.transaction.xa.Xid xid)
          Ask the resource manager to prepare for a transaction commit of the transaction specified in xid
 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()
          Recover the session.
 javax.transaction.xa.Xid[] recover(int flag)
          Obtain a list of prepared transaction branches from a resource manager.
 void rollback()
          Rollback the session.
 void rollback(javax.transaction.xa.Xid xid)
          Inform the resource manager to roll back work done on behalf of a transaction branch
 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(RemoteJmsMessageListenerIfc listener)
          All server side sessions register with the consumer manager for message consumption (i.e push-model).
 boolean setTransactionTimeout(int seconds)
          Set the current transaction timeout value for this XAResource instance.
 void start(javax.transaction.xa.Xid xid, int flags)
          Start work on behalf of a transaction branch specified in xid If TMJOIN is specified, the start is for joining a transaction previously seen by the resource manager
 void startMessageDelivery()
          Start message delivery to this session.
 void stopMessageDelivery()
          Stop message delivery to this session.
 void unsubscribe(java.lang.String name)
          Unsubscribe a durable subscription
 

Method Detail

getClientId

java.lang.String getClientId()
                             throws java.rmi.RemoteException
Return a reference to the client id.

Returns:
String client id
Throws:
java.rmi.RemoteException

getSessionId

java.lang.String getSessionId()
                              throws javax.jms.JMSException,
                                     java.rmi.RemoteException
Return a reference to the session id

Returns:
String session id
Throws:
java.rmi.RemoteException
javax.jms.JMSException

close

void close()
           throws javax.jms.JMSException,
                  java.rmi.RemoteException
Close and release any resource allocated to this session. Throw the JMSException exception is a problem is encountered

Throws:
javax.jms.JMSException
java.rmi.RemoteException

acknowledgeMessage

void acknowledgeMessage(long clientId,
                        java.lang.String messageId)
                        throws javax.jms.JMSException,
                               java.rmi.RemoteException
Acknowledge that the message with the following id has been processed

Parameters:
clientId - the client identity
messageId - id of message to ack
Throws:
javax.jms.JMSException - if method does not complete
java.rmi.RemoteException

sendMessage

void sendMessage(javax.jms.Message message)
                 throws javax.jms.JMSException,
                        java.rmi.RemoteException
Send the specified message to the server. If there is any problem then throw the JMSException exception

Parameters:
message - message to send
Throws:
javax.jms.JMSException
java.rmi.RemoteException

sendMessages

void sendMessages(java.util.Vector messages)
                  throws javax.jms.JMSException,
                         java.rmi.RemoteException
Send the specified messages to the server. If there is any problem then throw the JMSException exception

Parameters:
messages - messages to send
Throws:
javax.jms.JMSException
java.rmi.RemoteException

receiveMessage

javax.jms.Message receiveMessage(long clientId,
                                 long wait)
                                 throws javax.jms.JMSException,
                                        java.rmi.RemoteException
Return the next message for the specified client. The 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 message

Parameters:
clientId - the client identity
wait - number of ms to wait
Returns:
Message the next message or null
Throws:
javax.jms.JMSException - if there is an app level problem
java.rmi.RemoteException - if there is a RMI based exception.

receiveMessages

java.util.Vector receiveMessages(long clientId,
                                 int count)
                                 throws javax.jms.JMSException,
                                        java.rmi.RemoteException
Return upto count messages from the endpoint with the specified client identity.

Parameters:
clientId - the client identity
count - max number of messages to receive
Returns:
Message the next message or null
Throws:
javax.jms.JMSException - if there is an app level problem
java.rmi.RemoteException - if there is a RMI based exception.

createQueue

void createQueue(JmsQueue queue)
                 throws javax.jms.JMSException,
                        java.rmi.RemoteException
Create a queue with the specified name. If the queue already exists then simply return a reference to it. If the queue does not exist then create it. If it cannot create the queue then throw the JMSException exception

Parameters:
queue - queue to create
Throws:
javax.jms.JMSException
java.rmi.RemoteException

createTopic

void createTopic(JmsTopic topic)
                 throws javax.jms.JMSException,
                        java.rmi.RemoteException
Create a topic with the specified name. If the topic already exists then simply return a reference to it. If the topic does not exist then create it. If it cannot create the topic then throw the JMSException exception

Parameters:
topic - topic to create
Throws:
javax.jms.JMSException
java.rmi.RemoteException

createReceiver

void createReceiver(JmsQueue queue,
                    long clientId,
                    java.lang.String selector)
                    throws javax.jms.JMSException,
                           java.rmi.RemoteException
Create a receiver endpoint for this session. A reciever is a message consumer specific to the queue message model. The receiver is associated with a queue.

You cannot create more than one receiver for the same destination

Parameters:
queue - receiver destination
clientId - the session allocated identifier of this consumer
selector - the selector to filter messages. This may be null.
Throws:
JMSException.
java.rmi.RemoteException
javax.jms.JMSException

createSender

void createSender(JmsQueue queue)
                  throws javax.jms.JMSException,
                         java.rmi.RemoteException
Create a sender endpoint for this session. A sender is a message publisher specific to the queue message model. The sender is associated with a queue.

You cannot create more than one receiver for the same destination

Parameters:
queue - receiver destination
Throws:
JMSException.
java.rmi.RemoteException
javax.jms.JMSException

createBrowser

void createBrowser(JmsQueue queue,
                   long clientId,
                   java.lang.String selector)
                   throws javax.jms.JMSException,
                          java.rmi.RemoteException
Create a queue browser for this session. This allows clients to browse a queue without removing any messages.

You cannot create more than one queue browser for the same queue in a single session.

Parameters:
queue - queue to browse
clientId - identity of the client
selector - message selector. This may be null
Throws:
javax.jms.JMSException
java.rmi.RemoteException

deleteReceiver

void deleteReceiver(long clientId)
                    throws javax.jms.JMSException,
                           java.rmi.RemoteException
Delete the specified receiver

Parameters:
clientId - the identity of the receiver
Throws:
JMSException.
java.rmi.RemoteException
javax.jms.JMSException

deleteSender

void deleteSender(long clientId)
                  throws javax.jms.JMSException,
                         java.rmi.RemoteException
Delete the sender for the specified queue. If the sender does not exist or the sender cannot be deleted then throw JMSException

Parameters:
clientId - the unique client identity
Throws:
JMSException.
java.rmi.RemoteException
javax.jms.JMSException

deleteBrowser

void deleteBrowser(long clientId)
                   throws javax.jms.JMSException,
                          java.rmi.RemoteException
Delete the queue browser associated with the specified queue from the session. If the corresponding queue does not exist or it cannot be deleted, then throw a JMSException.

Parameters:
clientId - - the client identity
Throws:
javax.jms.JMSException
java.rmi.RemoteException

createSubscriber

void createSubscriber(JmsTopic topic,
                      java.lang.String name,
                      long clientId,
                      java.lang.String selector,
                      boolean noLocal)
                      throws javax.jms.JMSException,
                             java.rmi.RemoteException
Create a subscriber endpoint for this session. A subscriber is a message consumer specific to the topic message model. The subscriber is associated with a topic. The consumer name is used to identify an endpoint for persistent delivery. If we are using non-persistent delivery then this can be set to null

You cannot create more than one subscriber for the same destination

Parameters:
topic - subscriber destination
name - consumer name
clientId - the session allocated identifier of this consumer
selector - the selector to filter messages. This may be null.
noLocal - inhibit consuming messages on same connection.
Throws:
JMSException.
java.rmi.RemoteException
javax.jms.JMSException

createPublisher

void createPublisher(JmsTopic topic)
                     throws javax.jms.JMSException,
                            java.rmi.RemoteException
Create a publisher endpoint for this session. A publisher is a message publisher specific to the topic message model. The publisher is associated with a topic. Return the unique identity of the publisher

You cannot create more than one publisher for the same destination

Parameters:
topic - receiver destination
Throws:
JMSException.
java.rmi.RemoteException
javax.jms.JMSException

deleteSubscriber

void deleteSubscriber(long clientId)
                      throws javax.jms.JMSException,
                             java.rmi.RemoteException
Delete the subscriber for the specified topic. If this subscriber does not exist or the cannot be deleted then throw JMSException.

Parameters:
clientId - the client identity
Throws:
JMSException.
javax.jms.JMSException
java.rmi.RemoteException

deletePublisher

void deletePublisher(JmsTopic topic)
                     throws javax.jms.JMSException,
                            java.rmi.RemoteException
Delete the publisher for the specified topic. If the publisher does not exist or cannot be deleted then throw JMSException

Parameters:
topic - topic name
Throws:
JMSException.
RemoteException.
javax.jms.JMSException
java.rmi.RemoteException

unsubscribe

void unsubscribe(java.lang.String name)
                 throws javax.jms.JMSException,
                        java.rmi.RemoteException
Unsubscribe a durable subscription

Parameters:
name - the name used to identify the subscription
Throws:
javax.jms.JMSException - if the subscription cannot be removed
java.rmi.RemoteException

stopMessageDelivery

void stopMessageDelivery()
                         throws javax.jms.JMSException,
                                java.rmi.RemoteException
Stop message delivery to this session. If there are any problems completing the request then throw the JMSException exception

Throws:
javax.jms.JMSException
RemoteException.
java.rmi.RemoteException

startMessageDelivery

void startMessageDelivery()
                          throws javax.jms.JMSException,
                                 java.rmi.RemoteException
Start message delivery to this session. If there are any problems completing this request then throw the JMSException exception

Throws:
javax.jms.JMSException
RemoteException.
java.rmi.RemoteException

recover

void recover()
             throws javax.jms.JMSException,
                    java.rmi.RemoteException
Recover the session. If there are any problems completing the request then throw the JMSException exception

Throws:
javax.jms.JMSException
RemoteException.
java.rmi.RemoteException

commit

void commit()
            throws javax.jms.JMSException,
                   java.rmi.RemoteException
Commit the session. If there are any problems completing the request then throw the JMSException exception

Throws:
javax.jms.JMSException
RemoteException.
java.rmi.RemoteException

rollback

void rollback()
              throws javax.jms.JMSException,
                     java.rmi.RemoteException
Rollback the session. If there are any problems completing the request then throw the JMSException exception

Throws:
javax.jms.JMSException
RemoteException.
java.rmi.RemoteException

commit

void commit(javax.transaction.xa.Xid xid,
            boolean onePhase)
            throws javax.transaction.xa.XAException,
                   java.rmi.RemoteException
Commits an XA transaction that is in progress.

Parameters:
xid - - the xa transaction identity
onePhase - - treu if it is a one phase commit
Throws:
javax.transaction.xa.XAException - - if there is a problem completing the call
java.rmi.RemoteException - - communication related error

end

void end(javax.transaction.xa.Xid xid,
         int flags)
         throws javax.transaction.xa.XAException,
                java.rmi.RemoteException
Ends the work performed on behalf of a transaction branch. The resource manager disassociates the XA resource from the transaction branch specified and let the transaction be completedCommits an XA transaction that is in progress.

Parameters:
xid - - the xa transaction identity
flags - - one of TMSUCCESS, TMFAIL, or TMSUSPEND
Throws:
javax.transaction.xa.XAException - - if there is a problem completing the call
java.rmi.RemoteException - - communication related error

forget

void forget(javax.transaction.xa.Xid xid)
            throws javax.transaction.xa.XAException,
                   java.rmi.RemoteException
Tell the resource manager to forget about a heuristically completed transaction branch.

Parameters:
xid - - the xa transaction identity
Throws:
javax.transaction.xa.XAException - - if there is a problem completing the call
java.rmi.RemoteException - - communication related error

getTransactionTimeout

int getTransactionTimeout()
                          throws javax.transaction.xa.XAException,
                                 java.rmi.RemoteException
Return the transaction timeout for this instance of the resource manager.

Returns:
int - the timeout in seconds
Throws:
javax.transaction.xa.XAException - - if there is a problem completing the call
java.rmi.RemoteException - - communication related error

prepare

int prepare(javax.transaction.xa.Xid xid)
            throws javax.transaction.xa.XAException,
                   java.rmi.RemoteException
Ask the resource manager to prepare for a transaction commit of the transaction specified in xid

Parameters:
xid - - the xa transaction identity
Returns:
int - XA_RDONLY or XA_OK
Throws:
javax.transaction.xa.XAException - - if there is a problem completing the call
java.rmi.RemoteException - - communication related error

recover

javax.transaction.xa.Xid[] recover(int flag)
                                   throws javax.transaction.xa.XAException,
                                          java.rmi.RemoteException
Obtain a list of prepared transaction branches from a resource manager. The transaction manager calls this method during recovery to obtain the list of transaction branches that are currently in prepared or heuristically completed states.

Parameters:
flag - - One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS. TMNOFLAGS
Xid[] - - the set of Xids to recover
Throws:
javax.transaction.xa.XAException - - if there is a problem completing the call
java.rmi.RemoteException - - communication related error

rollback

void rollback(javax.transaction.xa.Xid xid)
              throws javax.transaction.xa.XAException,
                     java.rmi.RemoteException
Inform the resource manager to roll back work done on behalf of a transaction branch

Parameters:
xid - - the xa transaction identity
Throws:
javax.transaction.xa.XAException - - if there is a problem completing the call
java.rmi.RemoteException - - communication related error

setTransactionTimeout

boolean setTransactionTimeout(int seconds)
                              throws javax.transaction.xa.XAException,
                                     java.rmi.RemoteException
Set the current transaction timeout value for this XAResource instance.

Parameters:
seconds - - timeout in seconds
Returns:
boolean - true if the new transaction timeout was accepted
Throws:
javax.transaction.xa.XAException - - if there is a problem completing the call
java.rmi.RemoteException - - communication related error

start

void start(javax.transaction.xa.Xid xid,
           int flags)
           throws javax.transaction.xa.XAException,
                  java.rmi.RemoteException
Start work on behalf of a transaction branch specified in xid If TMJOIN is specified, the start is for joining a transaction previously seen by the resource manager

Parameters:
xid - - the xa transaction identity
flags - - One of TMNOFLAGS, TMJOIN, or TMRESUME
Throws:
javax.transaction.xa.XAException - - if there is a problem completing the call
java.rmi.RemoteException - - communication related error

getResourceManagerId

java.lang.String getResourceManagerId()
                                      throws javax.transaction.xa.XAException,
                                             java.rmi.RemoteException
Return the resource manager identity

Returns:
the resource manager identity
Throws:
javax.transaction.xa.XAException - - if there is a problem completing the call
java.rmi.RemoteException - - communication related error

setMessageListener

void setMessageListener(RemoteJmsMessageListenerIfc listener)
                        throws javax.jms.JMSException,
                               java.rmi.RemoteException
All server side sessions register with the consumer manager for message consumption (i.e push-model). When a message arrives this server-side instance will send it down to the client side stub for further processing.

If the listener is null then throw JMSException

Parameters:
listener - listener to delivery messages too.
Throws:
javax.jms.JMSException
RemoteException.
java.rmi.RemoteException

enableAsynchronousDelivery

void enableAsynchronousDelivery(long clientId,
                                java.lang.String id,
                                boolean enable)
                                throws javax.jms.JMSException,
                                       java.rmi.RemoteException
Enable or disable asynchronous message delivery for a particular consumer

Parameters:
clientId - - the id of the client to check
id - - the last message asynchronously delivered
enable - - true to enable; false to disable
Throws:
javax.jms.JMSException
java.rmi.RemoteException


Copyright © 1999-2005 The OpenJMS Group. All Rights Reserved.