|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.smartics.properties.api.core.app.JndiContext
public final class JndiContext
Defines constants for this library.
Field Summary | |
---|---|
static String |
JNDI_CONTEXT_PATH_BOOT The path within the JNDI context to access boot configuration properties. |
Method Summary | |
---|---|
static JndiContext |
boot(Context context) Provides access to the boot properties within a JNDI context. |
static JndiContext |
config(Context context, String configKey) Provides access to the custom properties within a JNDI context. |
static List<String> |
configKeys(Context context) Returns the list of configuration keys. |
static Object |
extensionConfig(Context context) Provides access to the extension configuration parameters within a JNDI context. |
static String |
extensionConfigPath() Returns the JNDI path to the extension configuration. |
String |
getSourceId() Returns the name of the JNDI namespace. |
NamingEnumeration<NameClassPair> |
list() Returns the list of stored values in the context. |
String |
lookup(String key) Runs a lookup for the value with the given key in the JNDI context and returns the value as a String . |
Boolean |
lookupBoolean(String key) Runs a lookup for the value with the given key in the JNDI context. |
Object |
lookupObject(String key) Runs a lookup for the value with the given key in the JNDI context. |
void |
set(String key, Object value) Sets the value for the given key . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String JNDI_CONTEXT_PATH_BOOT
"/smartics-properties/boot"
Method Detail |
---|
public static JndiContext boot(Context context) throws IllegalArgumentException
context
- the root context.
IllegalArgumentException
- if the JNDI context cannot be initialized.
public static JndiContext config(Context context, String configKey) throws IllegalArgumentException
context
- the custom context.
configKey
- the key to the configuration. Will be used as a path within the context to set the root of the configuration.
IllegalArgumentException
- if the JNDI context cannot be initialized.
public static Object extensionConfig(Context context) throws NamingException
The extension configuration contains properties to configure smartics-properties. It includes information for encrypting and decrypting property values, access information to data sources, etc. This information may also be provided in properties files on the class path. Having them added to JNDI via an extension is just another option to provided this information. Typically an extension is an application server specific implementation that allows to integrate the configuration parameters in a convenient way.
context
- the root context.
NamingException
- if the extension configuration cannot be retrieved.
public static String extensionConfigPath()
public static List<String> configKeys(Context context) throws IllegalArgumentException
context
- the context within which to search for .
IllegalArgumentException
- if the JNDI context cannot be accessed to fetch the configuration keys.
public Object lookupObject(String key) throws NamingException
key
in the JNDI context.
key
- the key to the value.
NamingException
- on any problem accessing the value.
public String lookup(String key) throws NamingException
key
in the JNDI context and returns the value as a
String
.
key
- the key to the value.
NamingException
- on any problem accessing the value.
public Boolean lookupBoolean(String key) throws NamingException
key
in the JNDI context.
key
- the key to the value.
NamingException
- on any problem accessing the value.
public void set(String key, Object value) throws NamingException
key
.
key
- the key to the value.
value
- the value to the key in the context.
NamingException
- on any problem accessing the value.
public NamingEnumeration<NameClassPair> list() throws NamingException
NamingException
- on any problem accessing the naming context.
public String getSourceId()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |