org.jboss.soa.esb.helpers
Class NamingContextPool

java.lang.Object
  extended by org.jboss.soa.esb.helpers.NamingContextPool

public class NamingContextPool
extends java.lang.Object

Pool for Naming Contexts.

Author:
Kevin Conner

Method Summary
static javax.naming.Context getNamingContext(java.util.Properties properties)
          Get a Naming Context from the pool.
static void releaseNamingContext(javax.naming.Context context)
          Release the Naming Context back into the pool.
static javax.naming.Context replaceNamingContext(javax.naming.Context context, java.util.Properties env)
          Close the Naming Context and remove from the pool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getNamingContext

public static javax.naming.Context getNamingContext(java.util.Properties properties)
                                             throws NamingContextException
Get a Naming Context from the pool.

Parameters:
properties - The properties of the JNDI environment.
Returns:
the pooled Naming Context.
Throws:
NamingContextException

releaseNamingContext

public static void releaseNamingContext(javax.naming.Context context)
                                 throws NamingContextException
Release the Naming Context back into the pool.

Parameters:
context - The Naming Context to release.
Throws:
NamingContextException

replaceNamingContext

public static javax.naming.Context replaceNamingContext(javax.naming.Context context,
                                                        java.util.Properties env)
                                                 throws NamingContextException
Close the Naming Context and remove from the pool.

Parameters:
context - The Naming Context to close.
env - The JNDI environment parameters for the Naming Context.
Throws:
NamingContextException