public class NamingEntryUtil
extends java.lang.Object
Constructor and Description |
---|
NamingEntryUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
bindToENC(java.lang.Object scope,
java.lang.String asName,
java.lang.String mappedName)
Link a name in a webapp's java:/comp/evn namespace to a pre-existing
resource.
|
private static java.lang.String |
canonicalizeScope(java.lang.Object scope) |
static javax.naming.Context |
getContextForNamingEntries(java.lang.Object scope) |
static javax.naming.Context |
getContextForScope(java.lang.Object scope) |
static javax.naming.Name |
getNameForScope(java.lang.Object scope) |
static java.lang.Object |
lookup(java.lang.Object scope,
java.lang.String jndiName) |
private static java.util.List<java.lang.Object> |
lookupNamingEntries(java.util.List<java.lang.Object> list,
javax.naming.Context context,
java.lang.Class<?> clazz)
Build up a list of NamingEntry objects that are of a specific type.
|
static java.util.List<java.lang.Object> |
lookupNamingEntries(java.lang.Object scope,
java.lang.Class<?> clazz)
Get all NameEntries of a certain type in the given naming
environment scope (server-wide names or context-specific names)
|
static NamingEntry |
lookupNamingEntry(java.lang.Object scope,
java.lang.String jndiName)
Find a NamingEntry in the given scope.
|
static javax.naming.Name |
makeNamingEntryName(javax.naming.NameParser parser,
NamingEntry namingEntry) |
static javax.naming.Name |
makeNamingEntryName(javax.naming.NameParser parser,
java.lang.String jndiName) |
private static final Logger LOG
public static boolean bindToENC(java.lang.Object scope, java.lang.String asName, java.lang.String mappedName) throws javax.naming.NamingException
scope
- the scope of the lookupasName
- the name to bind asmappedName
- the name from the environment to link to asNamejavax.naming.NamingException
- if unable to bindpublic static NamingEntry lookupNamingEntry(java.lang.Object scope, java.lang.String jndiName) throws javax.naming.NamingException
scope
- the object scopejndiName
- the jndi namejavax.naming.NamingException
- if unable to lookup naming entrypublic static java.lang.Object lookup(java.lang.Object scope, java.lang.String jndiName) throws javax.naming.NamingException
javax.naming.NamingException
public static java.util.List<java.lang.Object> lookupNamingEntries(java.lang.Object scope, java.lang.Class<?> clazz) throws javax.naming.NamingException
scope
- the object scopeclazz
- the type of the entryjavax.naming.NamingException
- if unable to lookup the naming entriespublic static javax.naming.Name makeNamingEntryName(javax.naming.NameParser parser, NamingEntry namingEntry) throws javax.naming.NamingException
javax.naming.NamingException
public static javax.naming.Name makeNamingEntryName(javax.naming.NameParser parser, java.lang.String jndiName) throws javax.naming.NamingException
javax.naming.NamingException
public static javax.naming.Name getNameForScope(java.lang.Object scope)
public static javax.naming.Context getContextForScope(java.lang.Object scope) throws javax.naming.NamingException
javax.naming.NamingException
public static javax.naming.Context getContextForNamingEntries(java.lang.Object scope) throws javax.naming.NamingException
javax.naming.NamingException
private static java.util.List<java.lang.Object> lookupNamingEntries(java.util.List<java.lang.Object> list, javax.naming.Context context, java.lang.Class<?> clazz) throws javax.naming.NamingException
list
- context
- clazz
- javax.naming.NamingException
private static java.lang.String canonicalizeScope(java.lang.Object scope)