jrun.jms.core.server
Class JmsServerConnection

java.lang.Object
  |
  +--jrun.jms.core.server.JmsServerConnection

public class JmsServerConnection
extends java.lang.Object

A connection is created for every client connecting to the JmsServer. A connection supports multiple sessions and each session has an independent producer and/or consumer.

A client can create sessions through the connection. The maximum number of sessions that a client can connect is capped at MAX_SESSIONS.

Version:
$Revision: 1.10 $ $Date: 2001/06/26 04:45:48 $ created by Jim Alateras
See Also:
org.exolab.jms.server.JmsConnectionManager

Method Summary
 void close()
          Close all the sessions allocated to this collection.
 JmsServerSession createSession(int ackMode, boolean transacted)
          Create a sesion for the specified connection.
 void deleteSession(JmsServerSession session)
          Delete the specified session.
 java.lang.String getClientId()
          Retrieve the client identity of this conection.
 java.lang.String getConnectionId()
          Retrieve the identity of this conection.
 JmsServerSession getSession(java.lang.String sessionId)
          Retrive the JmsServerSession with the given sessionId.
 int getSessionCount()
          Return the number of sessions currently allocated to this connection.
 java.util.Enumeration getSessions()
          Return an enumeration of all the sessions associated with this connection
 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.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createSession

public JmsServerSession createSession(int ackMode,
                                      boolean transacted)
Create a sesion for the specified connection. Assign the clientId to the sessions. The created session is initially in the stopped mode.

The created session represents an endpoint with the JmsServer where you can create consumers. producers and destinations.

Parameters:
ackMode - the ackmode for the session
transacted - true if the session is transacted
Returns:
JmsSession created session

deleteSession

public void deleteSession(JmsServerSession session)
Delete the specified session. If the session does not exist then fail silently.
Parameters:
session - session to delete
Throws:
JMSException -  

getSessionCount

public int getSessionCount()
Return the number of sessions currently allocated to this connection.
Returns:
int

getSessions

public java.util.Enumeration getSessions()
Return an enumeration of all the sessions associated with this connection
Returns:
Enumeration

start

public void start()
Start all the sessions allocated to this connection.

stop

public void stop()
Stop all the sessions allocated to this collection. Do not reemove the session

close

public void close()
Close all the sessions allocated to this collection. This will also remove the session from the allocated list of sessions

getSession

public JmsServerSession getSession(java.lang.String sessionId)
Retrive the JmsServerSession with the given sessionId. Return null if the session does not exist.
Parameters:
sessionId - The id of the required session.
Returns:
JmsServerSession The requested session if it exists.

getClientId

public java.lang.String getClientId()
Retrieve the client identity of this conection. If this method does not complete successfully then throw JMSException.
Returns:
String

getConnectionId

public java.lang.String getConnectionId()
Retrieve the identity of this conection. If this method does not complete successfully then throw JMSException.
Returns:
String


Copyright � 2002 Macromedia Corporation. All Rights Reserved.