Package org.osjava.sj.loader
Class JndiLoader
- java.lang.Object
-
- org.osjava.sj.loader.JndiLoader
-
public class JndiLoader extends java.lang.Object
Loads a .properties file into a JNDI server.
-
-
Field Summary
Fields Modifier and Type Field Description private static ConvertRegistry
convertRegistry
static java.lang.String
SIMPLE_COLON_REPLACE
static java.lang.String
SIMPLE_DELIMITER
static java.lang.String
SIMPLE_SHARED
private java.util.Hashtable
table
-
Constructor Summary
Constructors Constructor Description JndiLoader()
JndiLoader(java.util.Hashtable env)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.lang.Object
convert(java.util.Properties properties)
private static java.lang.String
getLastElement(java.lang.String str, java.lang.String delimiter)
java.lang.String
getParameter(java.lang.String key)
private void
jndiPut(javax.naming.Context ctxt, java.lang.String key, java.lang.Object value)
void
load(java.util.Properties properties, javax.naming.Context ctxt)
Loads a properties object into a context.void
load(java.util.Properties properties, javax.naming.Context ctxt, javax.naming.Context parentCtxt, java.lang.String ctxtName)
void
loadDirectory(java.io.File directory, javax.naming.Context ctxt)
Loads all .properties files in a directory into a contextvoid
loadDirectory(java.io.File directory, javax.naming.Context ctxt, javax.naming.Context parentCtxt, java.lang.String ctxtName)
private java.util.Properties
loadFile(java.io.File file)
void
putParameter(java.lang.String key, java.lang.String value)
private static java.lang.String
removeLastElement(java.lang.String str, java.lang.String delimiter)
-
-
-
Field Detail
-
SIMPLE_DELIMITER
public static final java.lang.String SIMPLE_DELIMITER
- See Also:
- Constant Field Values
-
SIMPLE_SHARED
public static final java.lang.String SIMPLE_SHARED
- See Also:
- Constant Field Values
-
SIMPLE_COLON_REPLACE
public static final java.lang.String SIMPLE_COLON_REPLACE
- See Also:
- Constant Field Values
-
convertRegistry
private static ConvertRegistry convertRegistry
-
table
private java.util.Hashtable table
-
-
Method Detail
-
putParameter
public void putParameter(java.lang.String key, java.lang.String value)
-
getParameter
public java.lang.String getParameter(java.lang.String key)
-
loadDirectory
public void loadDirectory(java.io.File directory, javax.naming.Context ctxt) throws javax.naming.NamingException, java.io.IOException
Loads all .properties files in a directory into a context- Throws:
javax.naming.NamingException
java.io.IOException
-
loadDirectory
public void loadDirectory(java.io.File directory, javax.naming.Context ctxt, javax.naming.Context parentCtxt, java.lang.String ctxtName) throws javax.naming.NamingException, java.io.IOException
- Throws:
javax.naming.NamingException
java.io.IOException
-
loadFile
private java.util.Properties loadFile(java.io.File file) throws java.io.IOException
- Throws:
java.io.IOException
-
load
public void load(java.util.Properties properties, javax.naming.Context ctxt) throws javax.naming.NamingException
Loads a properties object into a context.- Throws:
javax.naming.NamingException
-
load
public void load(java.util.Properties properties, javax.naming.Context ctxt, javax.naming.Context parentCtxt, java.lang.String ctxtName) throws javax.naming.NamingException
- Throws:
javax.naming.NamingException
-
jndiPut
private void jndiPut(javax.naming.Context ctxt, java.lang.String key, java.lang.Object value) throws javax.naming.NamingException
- Throws:
javax.naming.NamingException
-
convert
private static java.lang.Object convert(java.util.Properties properties)
-
getLastElement
private static java.lang.String getLastElement(java.lang.String str, java.lang.String delimiter)
-
removeLastElement
private static java.lang.String removeLastElement(java.lang.String str, java.lang.String delimiter)
-
-