org.exolab.jms.net.connector
Class ConnectionContext

java.lang.Object
  |
  +--org.exolab.jms.net.connector.ConnectionContext

public final class ConnectionContext
extends java.lang.Object

ConnectionContext enables connectors to associate a Connection and ConnectionFactory with th current thread, to enable deserialized Proxy instances to resolve a Connection back to the server.

Version:
$Revision: 1.5 $ $Date: 2005/12/01 13:44:38 $
Author:
Tim Anderson

Method Summary
static Connection getConnection(URI uri)
          Returns a connection using the principal and connection factory associated with the current thread.
static ConnectionFactory getConnectionFactory()
          Returns the connection factory for the current thread.
static void pop()
          Removes the last-pushed context for the current thread.
static void push(java.security.Principal principal, ConnectionFactory factory)
          Adds the connection context for the current thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

push

public static void push(java.security.Principal principal,
                        ConnectionFactory factory)
Adds the connection context for the current thread.
Parameters:
principal - the security principal
factory - the connection factory

pop

public static void pop()
Removes the last-pushed context for the current thread.

getConnection

public static Connection getConnection(URI uri)
Returns a connection using the principal and connection factory associated with the current thread.
Parameters:
uri - the URI
Returns:
a new connection, or null if a connection can't be established

getConnectionFactory

public static ConnectionFactory getConnectionFactory()
Returns the connection factory for the current thread.
Returns:
the connection factory for the current thread, or null if no factory is set


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