org.exolab.jms.server
Class JmsServerConnection

java.lang.Object
  |
  +--org.exolab.jms.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.

Version:
$Revision: 1.16 $ $Date: 2003/08/17 01:32:26 $
Author:
Jim Alateras
See Also:
JmsServerConnectionManager

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 getConnectionId()
          Retrieve the identity of this conection.
 java.lang.String getID()
          Returns the client identifier
 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

getID

public java.lang.String getID()
Returns the client identifier
Returns:
the client identifier

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

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.

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 © 1999-2004 The OpenJMS Group. All Rights Reserved.