org.mortbay.jetty.plus.naming
Class NamingEntryUtil

java.lang.Object
  extended by org.mortbay.jetty.plus.naming.NamingEntryUtil

public class NamingEntryUtil
extends Object


Constructor Summary
NamingEntryUtil()
           
 
Method Summary
static void bindToENC(String asName, String mappedName)
          Link a name in a webapps java:/comp/evn namespace to a pre-existing resource.
static String getMappedName(String localName)
          Check to see if there is a mapping for a local resource name from web.xml.
static List lookupNamingEntries(int scopeType, Class clazz)
          Get all NameEntries of a certain type in either the local or global namespace.
static Object lookupNamingEntry(Context context, String jndiName)
          Find a NamingEntry.
static NamingEntry lookupNamingEntry(String jndiName)
          Find a NamingEntry instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamingEntryUtil

public NamingEntryUtil()
Method Detail

getMappedName

public static String getMappedName(String localName)
                            throws NamingException
Check to see if there is a mapping for a local resource name from web.xml. A mapping links up a name as referenced in web.xml with a name in the environment, represented as an org.mortbay.jetty.plus.naming.Link object, stored in jndi.

Parameters:
localName -
Returns:
Throws:
NamingException

bindToENC

public static void bindToENC(String asName,
                             String mappedName)
                      throws NamingException
Link a name in a webapps java:/comp/evn namespace to a pre-existing resource. The pre-existing resource can be either in the webapp's namespace, or in the container's namespace. Webapp's namespace takes precedence over the global namespace (to allow for overriding).

Parameters:
asName - the name to bind as
mappedName - the name from the environment to link to asName
namingEntryType -
Throws:
NamingException

lookupNamingEntry

public static NamingEntry lookupNamingEntry(String jndiName)
                                     throws NamingException
Find a NamingEntry instance. First the webapp's naming space is searched, and then the container's.

Parameters:
jndiName - name to lookup
Returns:
Throws:
NamingException

lookupNamingEntry

public static Object lookupNamingEntry(Context context,
                                       String jndiName)
                                throws NamingException
Find a NamingEntry.

Parameters:
context - the context to search
clazz - the type of the entry (ie subclass of NamingEntry)
jndiName - the name of the class instance
Returns:
Throws:
NamingException

lookupNamingEntries

public static List lookupNamingEntries(int scopeType,
                                       Class clazz)
                                throws NamingException
Get all NameEntries of a certain type in either the local or global namespace.

Parameters:
scopeType - local or global
clazz - the type of the entry
Returns:
Throws:
NamingException


Copyright © 2008 Mort Bay Consulting. All Rights Reserved.