org.apache.myfaces.extensions.cdi.core.impl.util
Class JndiUtils

java.lang.Object
  extended by org.apache.myfaces.extensions.cdi.core.impl.util.JndiUtils

@Typed
public abstract class JndiUtils
extends Object

This is the internal helper class for low level access to JNDI


Method Summary
static void bind(String name, Object object)
          Binds a given instance to a given name
static InitialContext getInitialContext()
          Exposes the current InitialContext
static
<T> T
lookup(String name, Class<? extends T> expectedClass)
          Resolves an instance for the given name.
static void unbind(String name)
          Unbinds a given name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInitialContext

public static InitialContext getInitialContext()
Exposes the current InitialContext

Returns:
current initial-context

bind

public static void bind(String name,
                        Object object)
Binds a given instance to a given name

Parameters:
name - current name
object - current instance

unbind

public static void unbind(String name)
Unbinds a given name

Parameters:
name - current name

lookup

public static <T> T lookup(String name,
                           Class<? extends T> expectedClass)
Resolves an instance for the given name.

Type Parameters:
T - type
Parameters:
name - current name
expectedClass - target type
Returns:
the found instance, null otherwise


Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.