jrun.jms.core.server.rmi
Class RmiJmsServerConnection

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--jrun.jms.core.server.rmi.RmiJmsServerConnection
All Implemented Interfaces:
java.rmi.Remote, RemoteJmsServerConnectionIfc, SchedulableEventListener, java.io.Serializable

public class RmiJmsServerConnection
extends java.rmi.server.UnicastRemoteObject
implements RemoteJmsServerConnectionIfc, SchedulableEventListener

This is an implementation of the RemoteJmsServerConnectionIfc interface which wraps the JmsConnection class. It basically delegates to an instance of JmsConnection.

Version:
$Revision: 1.9 $ $Date: 2001/06/08 06:44:02 $ created by Jim Alateras
See Also:
org.exolab.jms.server.JmsServerConnection, Serialized Form

Field Summary
protected  JmsServerConnection delegate_
          This is the object that the RMI connection object delegates too.
protected  int interval_
          This is the interval, in milliseconds, between subsequent ping events
protected  BaseLease lease_
          This is the lease on this object
protected  int m_port
           
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
RmiJmsServerConnection(JmsServerConnection connection, int interval, int port)
          Instantiae an instance of this class with a JmsServerConnection instance.
 
Method Summary
 void close()
          Close all the sessions allocated to this collection.
 RemoteJmsServerSessionIfc createSession(int ackMode, boolean transacted)
          Create and return a sesion for this connection Assign the connection's clientId to the sessions.
 void deleteSession(RemoteJmsServerSessionIfc session)
          Delete the specified session from the server.
 java.lang.String getConnectionId()
          Retrieve the identity of this conection.
protected  Logger getLogger()
          Return a reference to the logger
protected  int getPort()
           
 int getSessionCount()
          Return the number of session objects currently allocated to this connection.
 java.util.Enumeration getSessions()
          Return an enumeration of RemoteJmsServerSessionIfc objects currently allocated to this session.
 void onSchedulableEvent(java.lang.Object eventContext, int EventType)
          This method is called whenever a schedulableEvent gets fired.
 void ping()
          Send a ping to the server.
 void start()
          Start all the sessions allocated to this connection.
 void stop()
          Stop all the sessions allocated to this collection.
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

delegate_

protected JmsServerConnection delegate_
This is the object that the RMI connection object delegates too. It must be non-null and assigned during object construction

interval_

protected int interval_
This is the interval, in milliseconds, between subsequent ping events

m_port

protected int m_port

lease_

protected BaseLease lease_
This is the lease on this object
Constructor Detail

RmiJmsServerConnection

public RmiJmsServerConnection(JmsServerConnection connection,
                              int interval,
                              int port)
                       throws javax.jms.JMSException,
                              java.rmi.RemoteException
Instantiae an instance of this class with a JmsServerConnection instance. This class will simply delegate requests to the JmsServerConnection object. If a null connection is specified then throw JMSException.
Parameters:
connection - delegate connection object 2param interval the interval for ping requests
Throws:
JMSException -  
java.rmi.RemoteException -  
Method Detail

createSession

public RemoteJmsServerSessionIfc createSession(int ackMode,
                                               boolean transacted)
                                        throws javax.jms.JMSException,
                                               java.rmi.RemoteException
Description copied from interface: RemoteJmsServerConnectionIfc
Create and return a sesion for this connection Assign the connection's clientId to the sessions.

The created session represents an endpoint with the JmsServer where you can create consumers, producers and destinations. If there is an error creating the session then RemoteException is thrown

Specified by:
createSession in interface RemoteJmsServerConnectionIfc
Following copied from interface: jrun.jms.core.server.rmi.RemoteJmsServerConnectionIfc
Parameters:
ackMode - the ack mode for the session
Returns:
JmsSession created session
Throws:
JMSException -  
java.rmi.RemoteException -  

deleteSession

public void deleteSession(RemoteJmsServerSessionIfc session)
                   throws javax.jms.JMSException,
                          java.rmi.RemoteException
Description copied from interface: RemoteJmsServerConnectionIfc
Delete the specified session from the server. This will destroy all associated consumers and producers.

If there is a problem completing this request then throw RemoteException exception

Specified by:
deleteSession in interface RemoteJmsServerConnectionIfc
Following copied from interface: jrun.jms.core.server.rmi.RemoteJmsServerConnectionIfc
Parameters:
session - session to delete
Throws:
JMSException -  
java.rmi.RemoteException -  

getSessionCount

public int getSessionCount()
                    throws javax.jms.JMSException,
                           java.rmi.RemoteException
Description copied from interface: RemoteJmsServerConnectionIfc
Return the number of session objects currently allocated to this connection.

If there is a problem completing this request then throw RemoteException exception

Specified by:
getSessionCount in interface RemoteJmsServerConnectionIfc
Following copied from interface: jrun.jms.core.server.rmi.RemoteJmsServerConnectionIfc
Returns:
int
Throws:
JMSException -  
java.rmi.RemoteException -  

getSessions

public java.util.Enumeration getSessions()
                                  throws javax.jms.JMSException,
                                         java.rmi.RemoteException
Description copied from interface: RemoteJmsServerConnectionIfc
Return an enumeration of RemoteJmsServerSessionIfc objects currently allocated to this session.

If there is a problem completing this request then throw RemoteException exception

Specified by:
getSessions in interface RemoteJmsServerConnectionIfc
Following copied from interface: jrun.jms.core.server.rmi.RemoteJmsServerConnectionIfc
Returns:
Enumeration
Throws:
JMSException -  
java.rmi.RemoteException -  

start

public void start()
           throws javax.jms.JMSException,
                  java.rmi.RemoteException
Description copied from interface: RemoteJmsServerConnectionIfc
Start all the sessions allocated to this connection.

If there is a problem completing this request then throw RemoteException exception

Specified by:
start in interface RemoteJmsServerConnectionIfc
Following copied from interface: jrun.jms.core.server.rmi.RemoteJmsServerConnectionIfc
Throws:
JMSException -  
java.rmi.RemoteException -  

stop

public void stop()
          throws javax.jms.JMSException,
                 java.rmi.RemoteException
Description copied from interface: RemoteJmsServerConnectionIfc
Stop all the sessions allocated to this collection. Do not reemove the session

If there is a problem completing this request then throw RemoteException exception

Specified by:
stop in interface RemoteJmsServerConnectionIfc
Following copied from interface: jrun.jms.core.server.rmi.RemoteJmsServerConnectionIfc
Throws:
JMSException -  
java.rmi.RemoteException -  

close

public void close()
           throws javax.jms.JMSException,
                  java.rmi.RemoteException
Description copied from interface: RemoteJmsServerConnectionIfc
Close all the sessions allocated to this collection. This will also remove the session from the allocated list of sessions

If there is a problem completing this request then throw RemoteException exception

Specified by:
close in interface RemoteJmsServerConnectionIfc
Following copied from interface: jrun.jms.core.server.rmi.RemoteJmsServerConnectionIfc
Throws:
JMSException -  
java.rmi.RemoteException -  

getConnectionId

public java.lang.String getConnectionId()
                                 throws java.rmi.RemoteException
Description copied from interface: RemoteJmsServerConnectionIfc
Retrieve the identity of this conection.
Specified by:
getConnectionId in interface RemoteJmsServerConnectionIfc
Following copied from interface: jrun.jms.core.server.rmi.RemoteJmsServerConnectionIfc
Returns:
String
Throws:
java.rmi.RemoteException -  

ping

public void ping()
          throws java.rmi.RemoteException
Description copied from interface: RemoteJmsServerConnectionIfc
Send a ping to the server.
Specified by:
ping in interface RemoteJmsServerConnectionIfc
Following copied from interface: jrun.jms.core.server.rmi.RemoteJmsServerConnectionIfc
Throws:
java.rmi.RemoteException -  

onSchedulableEvent

public void onSchedulableEvent(java.lang.Object eventContext,
                               int EventType)
Description copied from interface: SchedulableEventListener
This method is called whenever a schedulableEvent gets fired. It passes the object associated with event.
Specified by:
onSchedulableEvent in interface SchedulableEventListener

getPort

protected int getPort()

getLogger

protected Logger getLogger()
Return a reference to the logger
Returns:
LoggerIfc


Copyright � 2002 Macromedia Corporation. All Rights Reserved.