org.exolab.jms.server.net
Class RemoteServerConnection

java.lang.Object
  |
  +--org.exolab.jms.net.orb.UnicastObject
        |
        +--org.exolab.jms.server.net.RemoteServerConnection
All Implemented Interfaces:
org.exolab.jms.net.connector.CallerListener, ServerConnection

public class RemoteServerConnection
extends org.exolab.jms.net.orb.UnicastObject
implements ServerConnection, org.exolab.jms.net.connector.CallerListener

Implementation of the to make it remotable.

Version:
$Revision: 1.3 $ $Date: 2005/08/30 05:51:03 $
Author:
Tim Anderson
See Also:
ServerConnectionImpl

Constructor Summary
RemoteServerConnection(ServerConnection connection, org.exolab.jms.net.orb.ORB orb)
          Construct a new RemoteServerConnection.
 
Method Summary
 void close()
          Closes the connection.
 void closed(RemoteServerSession session)
          Notify closure of a session.
 ServerSession createSession(int acknowledgeMode, boolean transacted)
          Create a new session.
 void disconnected(org.exolab.jms.net.connector.Caller caller)
          Notifies that a caller has been disconnected.
 java.lang.String getClientID()
          Returns the client identifier.
 long getConnectionId()
          Returns the connection identifier.
 void setClientID(java.lang.String clientID)
          Sets the client identifier for this connection.
 
Methods inherited from class org.exolab.jms.net.orb.UnicastObject
getORB, getProxy, getURI, unexportObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteServerConnection

public RemoteServerConnection(ServerConnection connection,
                              org.exolab.jms.net.orb.ORB orb)
                       throws java.rmi.RemoteException
Construct a new RemoteServerConnection.
Parameters:
connection - the connection to delegate calls to
orb - the ORB to export this with
Throws:
java.rmi.RemoteException - if this can't be exported
Method Detail

getConnectionId

public long getConnectionId()
                     throws javax.jms.JMSException
Returns the connection identifier.
Specified by:
getConnectionId in interface ServerConnection
Returns:
the connection identifier
Throws:
javax.jms.JMSException - for any JMS error

getClientID

public java.lang.String getClientID()
                             throws javax.jms.JMSException
Returns the client identifier.
Specified by:
getClientID in interface ServerConnection
Returns:
the client identifier
Throws:
javax.jms.JMSException - for any JMS error

setClientID

public void setClientID(java.lang.String clientID)
                 throws javax.jms.JMSException
Sets the client identifier for this connection.
Specified by:
setClientID in interface ServerConnection
Parameters:
clientID - the unique client identifier
Throws:
javax.jms.JMSException - if the JMS provider fails to set the client ID for this connection due to some internal error.
javax.jms.InvalidClientIDException - if the JMS client specifies an invalid or duplicate client ID.
java.lang.IllegalStateException - if the JMS client attempts to set a connection's client ID at the wrong time or when it has been administratively configured.

createSession

public ServerSession createSession(int acknowledgeMode,
                                   boolean transacted)
                            throws javax.jms.JMSException
Create a new session.
Specified by:
createSession in interface ServerConnection
Parameters:
acknowledgeMode - indicates whether the consumer or the client will acknowledge any messages it receives; ignored if the session is transacted. Legal values are Session.AUTO_ACKNOWLEDGE, Session.CLIENT_ACKNOWLEDGE, and Session.DUPS_OK_ACKNOWLEDGE.
transacted - indicates whether the session is transacted
Returns:
a newly created session
Throws:
javax.jms.JMSException - for any JMS error

close

public void close()
           throws javax.jms.JMSException
Closes the connection.
Specified by:
close in interface ServerConnection
Throws:
javax.jms.JMSException - for any JMS error

disconnected

public void disconnected(org.exolab.jms.net.connector.Caller caller)
Notifies that a caller has been disconnected. This implementation invokes close().
Specified by:
disconnected in interface org.exolab.jms.net.connector.CallerListener
Parameters:
caller - the caller that was disconnected

closed

public void closed(RemoteServerSession session)
Notify closure of a session.
Parameters:
session - the closed session


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