xmlBlaster 2.2.0 contributions API

org.xmlBlaster.contrib.db
Class DbInfo

java.lang.Object
  extended by org.xmlBlaster.contrib.db.DbInfo
All Implemented Interfaces:
DbInfoMBean, I_Info

public class DbInfo
extends java.lang.Object
implements I_Info, DbInfoMBean

DbInfo This is the I_Info implementation making use of Properties. Creates a simple implementation based on our ClientProperty maps. This implementation uses the reference to the properties passed. If you want a snapshot of these properties, you need to take a clone and pass the clone to the constructor. Therefore this class can be seen as a decorator to the map passed into the constructor. If you change a value with this class it will update the clientPropertyMap. If entries in the map are found which are not of the type ClientProperty, they are ignored. This class is thread safe.

Author:
Michele Laghi

Field Summary
 
Fields inherited from interface org.xmlBlaster.contrib.I_Info
ID, JMX_PREFIX
 
Constructor Summary
DbInfo(I_DbPool pool, java.lang.String id, I_Info info)
           
 
Method Summary
 java.lang.String get(java.lang.String key, java.lang.String def)
          Access a string environment setting.
 boolean getBoolean(java.lang.String key, boolean def)
          Access an environment setting of type boolean.
 int getInt(java.lang.String key, int def)
          Access an environment setting of type int.
 java.util.Set getKeys()
          Gets the keys of the entries stored.
 java.lang.String getKeysAsString()
           
 long getLong(java.lang.String key, long def)
          Access an environment setting of type long.
 java.lang.Object getObject(java.lang.String key)
          Access the remembered object.
 java.util.Set getObjectKeys()
          Gets the keys of the objects registered.
 java.lang.String getObjectKeysAsString()
           
protected  java.lang.String getPropAsString(java.lang.String key)
           
 java.lang.String getRaw(java.lang.String key)
          Returns the value associated to this key.
 void put(java.lang.String key, java.lang.String value)
          Put key/value to environment.
 java.lang.Object putObject(java.lang.String key, java.lang.Object o)
          Store an object.
 void putRaw(java.lang.String key, java.lang.String value)
          Put key/value to environment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DbInfo

public DbInfo(I_DbPool pool,
              java.lang.String id,
              I_Info info)
       throws java.lang.Exception
Parameters:
clientPropertyMap - Can be null
Throws:
java.lang.Exception
Method Detail

getRaw

public java.lang.String getRaw(java.lang.String key)
Description copied from interface: I_Info
Returns the value associated to this key.

Specified by:
getRaw in interface I_Info
Parameters:
txt -
Returns:

getPropAsString

protected java.lang.String getPropAsString(java.lang.String key)
Parameters:
txt -
Returns:

get

public java.lang.String get(java.lang.String key,
                            java.lang.String def)
Description copied from interface: I_Info
Access a string environment setting.

Specified by:
get in interface DbInfoMBean
Specified by:
get in interface I_Info
Parameters:
key - The parameter key
def - The default used if key is not found
Returns:
The configured value of the parameter
See Also:
I_Info.get(java.lang.String, java.lang.String)

put

public void put(java.lang.String key,
                java.lang.String value)
Description copied from interface: I_Info
Put key/value to environment.

Specified by:
put in interface DbInfoMBean
Specified by:
put in interface I_Info
Parameters:
key - The parameter key
value - The parameter value, if null the parameter is removed.
See Also:
I_Info.put(java.lang.String, java.lang.String)

putRaw

public void putRaw(java.lang.String key,
                   java.lang.String value)
Description copied from interface: I_Info
Put key/value to environment. This put does not modify (replace) the key, nor the value.

Specified by:
putRaw in interface I_Info
Parameters:
key - The parameter key
value - The parameter value, if null the parameter is removed.
See Also:
I_Info.put(java.lang.String, java.lang.String)

getLong

public long getLong(java.lang.String key,
                    long def)
Description copied from interface: I_Info
Access an environment setting of type long.

Specified by:
getLong in interface I_Info
Parameters:
key - The parameter key
def - The default used if key is not found
Returns:
The configured value of the parameter
See Also:
I_Info.getLong(java.lang.String, long)

getInt

public int getInt(java.lang.String key,
                  int def)
Description copied from interface: I_Info
Access an environment setting of type int.

Specified by:
getInt in interface I_Info
Parameters:
key - The parameter key
def - The default used if key is not found
Returns:
The configured value of the parameter
See Also:
I_Info.getInt(java.lang.String, int)

getBoolean

public boolean getBoolean(java.lang.String key,
                          boolean def)
Description copied from interface: I_Info
Access an environment setting of type boolean.

Specified by:
getBoolean in interface I_Info
Parameters:
key - The parameter key
def - The default used if key is not found
Returns:
The configured value of the parameter
See Also:
I_Info.getBoolean(java.lang.String, boolean)

getObject

public java.lang.Object getObject(java.lang.String key)
Description copied from interface: I_Info
Access the remembered object.

Specified by:
getObject in interface I_Info
Parameters:
key - The object key
Returns:
The found object or null
See Also:
I_Info.getObject(java.lang.String)

putObject

public java.lang.Object putObject(java.lang.String key,
                                  java.lang.Object o)
Description copied from interface: I_Info
Store an object.

Specified by:
putObject in interface I_Info
Parameters:
key - The object key
o - The object to remember or null to remove it
Returns:
The old object or null
See Also:
I_Info.putObject(java.lang.String, Object)

getKeys

public java.util.Set getKeys()
Description copied from interface: I_Info
Gets the keys of the entries stored. Note that this does not return the key of the entries stored as objects. To retrieve these use getObjectKeys().

Specified by:
getKeys in interface I_Info
Returns:
See Also:
I_Info.getKeys()

getObjectKeys

public java.util.Set getObjectKeys()
Description copied from interface: I_Info
Gets the keys of the objects registered. Note that this does not return the key of the normal entries. To retrieve these use getKeys().

Specified by:
getObjectKeys in interface I_Info
Returns:
See Also:
I_Info.getObjectKeys()

getKeysAsString

public java.lang.String getKeysAsString()
Specified by:
getKeysAsString in interface DbInfoMBean

getObjectKeysAsString

public java.lang.String getObjectKeysAsString()
Specified by:
getObjectKeysAsString in interface DbInfoMBean

xmlBlaster 2.2.0 contributions API

Copyright © 1999-2014 The xmlBlaster.org contributers.