public class JndiLoader extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
COLON_REPLACE
char(s) to replace with ":" in filenames and directories.
|
private static ConverterRegistry |
converterRegistry |
static String |
DELIMITER |
private static Properties |
EMPTY_PROPERTIES |
private Properties |
envAsProperties |
(package private) Hashtable |
environment |
static String |
FILENAME_TO_CONTEXT |
private org.slf4j.Logger |
LOGGER |
| Constructor and Description |
|---|
JndiLoader(Hashtable env) |
| Modifier and Type | Method and Description |
|---|---|
private static Object |
callConverter(Properties properties,
String type,
String converterClassName) |
private Object |
convert(Properties properties) |
(package private) Context |
createSubContexts(Name name,
Context parentContext) |
(package private) Name |
extractContextName(String path)
If the attribute name is namespaced as in "my/context/objectName", the returned Name is "my/context", because objectName is interpreted not as a context name but as the name of the object to be bound to "my/context".
|
private String |
extractDelimiter(String key)
Incompletely implemented: Let DELIMITER be a regular expression, e.g.
|
(package private) String |
extractObjectName(String path) |
private String |
extractTypeDeclaration(String key) |
(package private) Map<String,Properties> |
extractTypedProperties(Properties properties)
Scan for pseudo-nodes, aka "type" in foo.type.
|
private static String |
getLastElement(String str,
String delimiter) |
(package private) String |
getTypeDefinition(Properties properties) |
(package private) String |
handleColonReplacement(String name)
Replaces
COLON_REPLACE with ":" for building a ENC like "java:comp/env". |
(package private) boolean |
isNotNamespacedTypeDefinition(Properties properties)
For example a DataSource definition file with properties without namespace, e.
|
protected boolean |
isSupportedFile(File file) |
private void |
jndiPut(Context ctxt,
String key,
Object value)
Creates contexts defined by namespaced property names, e.g.
|
void |
load(Properties properties,
Context ctxt)
Loads a properties object into a context.
|
(package private) void |
load(Properties properties,
Context subContext,
Context parentCtxt,
String subName) |
(package private) Object |
processType(Properties properties,
String type,
Object obj) |
private void |
processTypedProperty(Properties properties,
Context subContext,
String subName) |
private static String |
removeLastElement(String str,
String delimiter) |
(package private) CompoundName |
toCompoundName(String path) |
public static final String DELIMITER
public static final String COLON_REPLACE
handleColonReplacement(String)private static final Properties EMPTY_PROPERTIES
private static ConverterRegistry converterRegistry
private final Properties envAsProperties
Hashtable environment
private org.slf4j.Logger LOGGER
public static final String FILENAME_TO_CONTEXT
public JndiLoader(Hashtable env)
boolean isNotNamespacedTypeDefinition(Properties properties)
String handleColonReplacement(String name)
COLON_REPLACE with ":" for building a ENC like "java:comp/env".public void load(Properties properties, Context ctxt) throws NamingException
NamingExceptionvoid load(Properties properties, Context subContext, Context parentCtxt, String subName) throws NamingException
NamingException@NotNull Map<String,Properties> extractTypedProperties(Properties properties) throws InvalidNameException
InvalidNameExceptionprivate void processTypedProperty(Properties properties, Context subContext, String subName) throws NamingException
NamingException@Nullable String getTypeDefinition(@NotNull Properties properties)
@Nullable Name extractContextName(String path) throws InvalidNameException
InvalidNameException@NotNull String extractObjectName(String path) throws InvalidNameException
path - one component ("object") or several components ("my/ctx/object").InvalidNameException@NotNull CompoundName toCompoundName(@NotNull String path) throws InvalidNameException
DELIMITER.InvalidNameExceptionprivate String extractDelimiter(String key)
DELIMITER.@Nullable private String extractTypeDeclaration(@NotNull String key) throws InvalidNameException
InvalidNameExceptionprivate void jndiPut(Context ctxt, String key, Object value) throws NamingException
NamingExceptionContext createSubContexts(Name name, Context parentContext) throws NamingException
name - Name of the contexts to be created in parentContext.NamingException@Nullable private Object convert(Properties properties)
@Nullable Object processType(Properties properties, String type, Object obj)
private static Object callConverter(Properties properties, String type, String converterClassName)
protected boolean isSupportedFile(@NotNull
File file)
Copyright © 2020. All rights reserved.