|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.cafesoft.core.service.ServiceConfigSupport
A Helper class that performs common functions on ServiceConfig Objects
| Constructor Summary | |
ServiceConfigSupport()
|
|
| Method Summary | |
static boolean |
getBooleanParam(ServiceConfig config,
String paramName,
boolean defaultValue)
Get a boolean param from the ServiceConfig object |
static Properties |
getInitProperties(ServiceConfig config)
Get the initial parameters from the ServiceConfig object and put them into a new Properties object This method is useful in situations where a Properties object is used to initialize an Object and the parent Object has a ServiceConfig Object instead. |
static int |
getRequiredIntParam(ServiceConfig config,
String source,
String paramName,
int defaultValue,
Logger logger)
Get an Integer parameter from the ServiceConfig object |
static String |
getRequiredStringParam(ServiceConfig config,
String source,
String paramName,
String defaultValue,
Logger logger)
Get a required String param from the ServiceConfig object |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ServiceConfigSupport()
| Method Detail |
public static final Properties getInitProperties(ServiceConfig config)
This method is useful in situations where a Properties object is used to initialize an Object and the parent Object has a ServiceConfig Object instead.
config - the ServiceConfig object that contains the initial parameters
public static final int getRequiredIntParam(ServiceConfig config,
String source,
String paramName,
int defaultValue,
Logger logger)
config - the ServiceConfig object that contains all initialization
parameterssource - the source object that is attempting to get the
parameter. This value is used to give a contextual
warning message.paramName - the name of the Parameter for which to retreive the
integer valuedefaultValue - the default value to use if a valid integer can
not be evaluated.logger - the logger to log warning messages to
public static final String getRequiredStringParam(ServiceConfig config,
String source,
String paramName,
String defaultValue,
Logger logger)
config - the ServiceConfig object that contains all
initialization properties.source - the source object that is attempting to get the
parameter. This value is used to give a contextual
warning message.paramName - the name of the Parameter for which to retreive
the String value.defaultValue - the default value to use if the parameter
is not defined in the ServiceConfig object.logger - the logger to log warning messages to
public static final boolean getBooleanParam(ServiceConfig config,
String paramName,
boolean defaultValue)
config - the ServiceConfig object to get the boolean value fromparamName - the parameter name of the boolean valuedefaultValue - the default value if the parameter is not found in the
ServiceConfig object
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||