xmlBlaster 2.2.0 API

org.xmlBlaster.contrib
Class ClientPropertiesInfo

java.lang.Object
  extended by org.xmlBlaster.contrib.ClientPropertiesInfo
All Implemented Interfaces:
I_Info

public class ClientPropertiesInfo
extends java.lang.Object
implements I_Info

ClientPropertiesInfo 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
(package private)  java.util.Map clientPropertyMap
           
private  InfoHelper helper
           
(package private)  java.util.Map objects
           
 
Fields inherited from interface org.xmlBlaster.contrib.I_Info
ID, JMX_PREFIX
 
Constructor Summary
ClientPropertiesInfo(java.util.Map clientPropertyMap)
           
ClientPropertiesInfo(java.util.Map clientPropertyMap, I_Info extraInfo)
           
 
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.
 java.util.Map<java.lang.String,ClientProperty> getClientPropertiesClone()
          A shallow clone to avoid race conditions.
protected  ClientProperty getClientProperty(java.lang.String key)
           
 ClientProperty[] getClientPropertyArr()
           
 java.util.Map getClientPropertyMap()
           
 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.
 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.
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, ClientProperty value)
           
 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
 

Field Detail

clientPropertyMap

java.util.Map clientPropertyMap

objects

java.util.Map objects

helper

private InfoHelper helper
Constructor Detail

ClientPropertiesInfo

public ClientPropertiesInfo(java.util.Map clientPropertyMap)
Parameters:
clientPropertyMap - Can be null

ClientPropertiesInfo

public ClientPropertiesInfo(java.util.Map clientPropertyMap,
                            I_Info extraInfo)
Parameters:
clientPropertyMap - Can be null
extraInfo - Can be null
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:

getClientProperty

protected ClientProperty getClientProperty(java.lang.String key)
Parameters:
key -
Returns:
null if not of type ClientProperty or of not found

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 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 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)

put

public void put(java.lang.String key,
                ClientProperty value)
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()

getClientPropertyMap

public java.util.Map getClientPropertyMap()
Returns:
Never null

getClientPropertyArr

public ClientProperty[] getClientPropertyArr()
Returns:
Never null

getClientPropertiesClone

public java.util.Map<java.lang.String,ClientProperty> getClientPropertiesClone()
A shallow clone to avoid race conditions.

Returns:
Never null

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.