|
EAF 7.4 Util | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.enhydra.util.JNDIAdapter
public class JNDIAdapter
This class is used for reading configuration parameters using JNDI. It coresponds between InitialContext object and application's Config and ConfigFile object.
Field Summary | |
---|---|
static java.lang.String |
CONTEXT_FOR_ENV_BIND
Application component Context environment. |
static java.lang.String |
FILE_JNDI_ABS_PATH_NAME
Absolute path to application configuration file. |
Constructor Summary | |
---|---|
JNDIAdapter()
Default constructor for empty adapter. |
|
JNDIAdapter(java.lang.String fileAbsolutePath,
java.lang.String factoryClass)
Constructor with defined file. |
Method Summary | |
---|---|
boolean |
containsKey(java.lang.String key)
Returns true if the specified key is found,
false otherwise. |
java.lang.Object |
get(java.lang.String keyword)
Get the value of a field as an object. |
java.lang.Object |
get(java.lang.String keyword,
java.lang.Object defaultValue)
Get the value of a field as an object, return a default if it does not exist. |
java.lang.Object |
getResource(java.lang.String jndiName)
|
java.lang.String[] |
getStrings(java.lang.String key)
Get the value of a field as String array. |
static boolean |
isArray(java.lang.String key)
Returns true if key has indicator that the field is array
(the key ends with "[]") |
java.lang.String[] |
keys()
Get the keywords in the table. |
java.lang.String[] |
leafKeys()
Recursively get the keywords for the entire table. |
static java.lang.String |
makeConfigString(java.lang.String oldString)
From Context String (delimiters are / signs) makes Config
String (delimiters are . signs). |
static java.lang.String |
makeContextString(java.lang.String oldString)
From Config String (delimiters are . signs) makes Context
String (delimiters are / signs). |
static java.lang.String |
makeStringFromStrings(java.lang.String[] strings)
From String array makes String in which are String array elements separated with , sign. |
void |
remove(java.lang.String keyword)
Removes field with the defined key. |
java.lang.String |
removeArrayMark(java.lang.String key)
Removes array indicator (the key ends with "[]") if exists. |
void |
set(java.lang.String keyword,
java.lang.String value)
Sets the value of a field with the defined key. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String FILE_JNDI_ABS_PATH_NAME
public static final java.lang.String CONTEXT_FOR_ENV_BIND
Constructor Detail |
---|
public JNDIAdapter()
public JNDIAdapter(java.lang.String fileAbsolutePath, java.lang.String factoryClass)
fileAbsolutePath
- absolute file path.factoryClass
- InitialContextFactory class used for creating
application InitialContext.Method Detail |
---|
public boolean containsKey(java.lang.String key)
true
if the specified key is found,
false
otherwise.
key
- The key whose existence is to be tested.
true
if the key was found, otherwise false
.public java.lang.String[] keys()
public java.lang.String[] leafKeys()
public java.lang.Object get(java.lang.String keyword) throws javax.naming.NamingException
keyword
- The keyword of the field. This can be a simple keyword
or a recursive, dot-seperated keyword path.
com.lutris.util.KeywordValueException
- If the keyword is not syntactically
legal or is a non-leaf element of the keyword is not a section.
javax.naming.NamingException
public java.lang.Object get(java.lang.String keyword, java.lang.Object defaultValue) throws javax.naming.NamingException
keyword
- The keyword of the field. This can be a simple keyword
or a recursive, dot-seperated keyword path.defaultValue
- The default value to return it the keyword does not
exist.
defaultValue
if its not found.
com.lutris.util.KeywordValueException
- If the keyword is not syntactically
legal or is a non-leaf element of the keyword is not a section.
javax.naming.NamingException
public java.lang.Object getResource(java.lang.String jndiName) throws javax.naming.NamingException
javax.naming.NamingException
public void set(java.lang.String keyword, java.lang.String value)
keyword
- The keyword of the field.value
- The new field value.public void remove(java.lang.String keyword)
keyword
- The keyword of the field.public static java.lang.String makeConfigString(java.lang.String oldString)
/
signs) makes Config
String (delimiters are .
signs).
oldString
- Context String
public static java.lang.String makeContextString(java.lang.String oldString)
.
signs) makes Context
String (delimiters are /
signs).
oldString
- Config String
public static java.lang.String makeStringFromStrings(java.lang.String[] strings)
,
sign.
strings
- String array.
public static boolean isArray(java.lang.String key)
true
if key has indicator that the field is array
(the key ends with "[]")
key
- The keyword of the field.
true
if key has indicator that the field is array,
otherwise false.public java.lang.String removeArrayMark(java.lang.String key)
key
- The keyword of the field.
public java.lang.String[] getStrings(java.lang.String key)
key
- The keyword of the field. This can be a simple keyword
or a recursive, dot-seperated keyword path.
|
EAF 7.4 Util | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |