|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.productivity.java.habitat4j.Habitat4JBootstrap
public class Habitat4JBootstrap
Habitat4JBootstrap provides several static methods for initializing, or "bootstrapping," your application for using Habitat4J.
This class imposes a standard for defining locations of PropertyList XML files, and also a standard for naming of the files.
## LICENSE INFORMATION ##
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
| Field Summary | |
|---|---|
static java.lang.String |
BOOTSTRAP_PARAM_APPLICATION_NAME
|
static java.lang.String |
BOOTSTRAP_PARAM_APPLICATION_PROPERTY_LIST_LOADER_CLASS
|
static java.lang.String |
BOOTSTRAP_PARAM_BOOTSTRAP_PROPERTIES_PATH
|
static java.lang.String |
BOOTSTRAP_PARAM_LOG_LEVEL
|
static java.lang.String |
BOOTSTRAP_PARAM_LOG4J_ENABLED
|
static java.lang.String |
BOOTSTRAP_PARAM_SERVER_IDENTITY_FILE_PATH
|
static java.lang.String |
BOOTSTRAP_PARAM_SERVER_IDENTITY_MODE
|
static java.lang.String |
BOOTSTRAP_PARAM_XSD_VALIDATION_ENABLED
|
protected static java.lang.Class |
DEFAULT_APPLICATION_PROPERTY_LIST_LOADER
|
protected static java.lang.String |
DEFAULT_BOOTSTRAP_PROPERTY_LIST_FILENAME
|
protected static java.lang.String[][] |
defaultBootstrapParamNameArray
|
protected static Habitat4JLogger |
logger
|
| Constructor Summary | |
|---|---|
Habitat4JBootstrap()
|
|
| Method Summary | |
|---|---|
protected static void |
configureApplicationName(java.lang.String applicationName)
|
protected static void |
configureLog4j(boolean log4jEnabled,
java.lang.String logLevel)
|
protected static void |
configurePropertyListManager(java.lang.String applicationName,
java.lang.String serverIdentityMode)
|
protected static void |
configurePropertyListXsdValidation(boolean xsdValidationEnabled)
|
protected static void |
configureServerIdentity(java.lang.String serverIdentityFilePath)
|
protected static void |
configureServerIdentityXsdValidation(boolean xsdValidationEnabled)
|
static java.lang.String |
createServerIdentityPath(java.lang.String serverIdentityFileName,
java.lang.String[] directories)
createServerIdentityPath() is a helper method for specifying multiple locations for a server-identity file. |
static java.util.HashMap |
getDefaultBootstrapParamNameMap()
getDefaultBootstrapParamNameMap provides a default HashMap of the default one-to-one mappings in defaultBootstrapParamNameArray. |
protected static java.lang.String |
getMappedInitParamValue(java.util.Map bootstrapInitParams,
java.util.Map bootstrapInitParamsNameMap,
java.lang.String name)
|
static void |
initialize(java.util.Map bootstrapInitParams)
|
static void |
initialize(java.util.Map bootstrapInitParams,
java.util.Map bootstrapInitParamsNameMap)
|
static void |
initialize(java.lang.String applicationName,
java.lang.String bootstrapPropertyListPath)
This initialize() method is the simplest to use, but has the least features. |
static void |
initialize(java.lang.String applicationName,
java.lang.String bootstrapPropertyListPath,
boolean xsdValidationEnabled)
To use this initialize() method, specify: applicationName - the name of your application bootstrapPropertyListPath - a path, either on the filesystem, or in the classpath (use slashes to delimit package paths) xsdValidationEnabled - a boolean value which determines whether Habitat4J should validate the server-identity and property-list files against the stock Habitat4J XSD files |
static void |
initialize(java.lang.String applicationName,
java.lang.String bootstrapPropertyListPath,
boolean xsdValidationEnabled,
boolean log4jEnabled)
To use this initialize() method, specify: applicationName - the name of your application bootstrapPropertyListPath - a path, either on the filesystem, or in the classpath (use slashes to delimit package paths) xsdValidationEnabled - a boolean value which determines whether Habitat4J should validate the server-identity and property-list files against the stock Habitat4J XSD files log4jEnabled - a boolean value which determines whether Habitat4J should use log4j |
static void |
initialize(java.lang.String applicationName,
java.lang.String bootstrapPropertyListPath,
boolean xsdValidationEnabled,
boolean log4jEnabled,
java.lang.String logLevel)
To use this initialize() method, specify: applicationName - the name of your application bootstrapPropertyListPath - a path, either on the filesystem, or in the classpath (use slashes to delimit package paths) xsdValidationEnabled - a boolean value which determines whether Habitat4J should validate the server-identity and property-list files against the stock Habitat4J XSD files log4jEnabled - a boolean value which determines whether Habitat4J should use log4j logLevel - a String containing one of the following log levels: debug, info, warn, error, or fatal mainly used for setting Habitat4J's native logging level (non-log4j) |
static void |
initialize(java.lang.String applicationName,
java.lang.String bootstrapPropertyListPath,
boolean xsdValidationEnabled,
boolean log4jEnabled,
java.lang.String logLevel,
java.lang.String serverIdentityFilePath)
To use this initialize() method, specify: applicationName - the name of your application bootstrapPropertyListPath - a path, either on the filesystem, or in the classpath (use slashes to delimit package paths) xsdValidationEnabled - a boolean value which determines whether Habitat4J should validate the server-identity and property-list files against the stock Habitat4J XSD files log4jEnabled - a boolean value which determines whether Habitat4J should use log4j logLevel - a String containing one of the following log levels: debug, info, warn, error, or fatal mainly used for setting Habitat4J's native logging level (non-log4j) serverIdentityFilePath - a String containing a single path or semicolon-delimited list of paths pointing to a server-identity.xml file or files |
static void |
initialize(java.lang.String applicationName,
java.lang.String bootstrapPropertyListPath,
boolean xsdValidationEnabled,
boolean log4jEnabled,
java.lang.String logLevel,
java.lang.String serverIdentityFilePath,
java.lang.String serverIdentityMode,
java.lang.Class appPropertyListLoaderClass)
To use this initialize() method, specify: applicationName - the name of your application bootstrapPropertyListPath - a path, either on the filesystem, or in the classpath (use slashes to delimit package paths) xsdValidationEnabled - a boolean value which determines whether Habitat4J should validate the server-identity and property-list files against the stock Habitat4J XSD files log4jEnabled - a boolean value which determines whether Habitat4J should use log4j logLevel - a String containing one of the following log levels: debug, info, warn, error, or fatal mainly used for setting Habitat4J's native logging level (non-log4j) serverIdentityFilePath - a String containing a single path or semicolon-delimited list of paths pointing to a server-identity.xml file or files serverIdentityMode - a String containing the ServerIdentity mode of operation (NULL, JVM, FILE) appPropertyListLoaderClassName - a String containing the fully qualified class for the customized implementation of ApplicationPropertyListLoaderIF |
static void |
initialize(java.lang.String applicationName,
java.lang.String bootstrapPropertyListPath,
boolean xsdValidationEnabled,
boolean log4jEnabled,
java.lang.String logLevel,
java.lang.String serverIdentityFilePath,
java.lang.String serverIdentityMode,
java.lang.String appPropertyListLoaderClassName)
To use this initialize() method, specify: applicationName - the name of your application bootstrapPropertyListPath - a path, either on the filesystem, or in the classpath (use slashes to delimit package paths) xsdValidationEnabled - a boolean value which determines whether Habitat4J should validate the server-identity and property-list files against the stock Habitat4J XSD files log4jEnabled - a boolean value which determines whether Habitat4J should use log4j logLevel - a String containing one of the following log levels: debug, info, warn, error, or fatal mainly used for setting Habitat4J's native logging level (non-log4j) serverIdentityFilePath - a String containing a single path or semicolon-delimited list of paths pointing to a server-identity.xml file or files serverIdentityMode - a String containing the ServerIdentity mode of operation (NULL, JVM, FILE) appPropertyListLoaderClassName - a String containing the fully qualified class for the customized implementation of ApplicationPropertyListLoaderIF |
static void |
initializePropertyLists(java.util.Map bootstrapInitParams)
|
static void |
initializePropertyLists(java.util.Map bootstrapInitParams,
java.util.Map bootstrapInitParamsNameMap)
|
static void |
initializePropertyLists(java.lang.String bootstrapPropertyListPath)
|
static void |
initializePropertyLists(java.lang.String bootstrapPropertyListPath,
boolean xsdValidationEnabled)
|
static void |
initializePropertyLists(java.lang.String bootstrapPropertyListPath,
boolean xsdValidationEnabled,
java.lang.String appPropertyListLoaderClass)
|
static void |
initializeServerIdentity(java.util.Map bootstrapInitParams)
|
static void |
initializeServerIdentity(java.util.Map bootstrapInitParams,
java.util.Map bootstrapInitParamsNameMap)
|
static void |
initializeServerIdentity(java.lang.String applicationName)
|
static void |
initializeServerIdentity(java.lang.String applicationName,
boolean xsdValidationEnabled,
boolean log4jEnabled,
java.lang.String logLevel,
java.lang.String serverIdentityFilePath)
|
static void |
initializeServerIdentity(java.lang.String applicationName,
boolean xsdValidationEnabled,
boolean log4jEnabled,
java.lang.String logLevel,
java.lang.String serverIdentityFilePath,
java.lang.String serverIdentityMode)
|
static void |
initializeServerIdentity(java.lang.String applicationName,
java.lang.String serverIdentityFilePath)
|
static void |
initializeServerIdentity(java.lang.String applicationName,
java.lang.String serverIdentityFilePath,
java.lang.String serverIdentityMode)
|
protected static void |
loadApplicationPropertyLists(java.lang.String applicationName,
java.lang.Class appPropertyListLoaderClass)
|
protected static void |
loadApplicationPropertyLists(java.lang.String applicationName,
java.lang.String appPropertyListLoaderClassName)
|
protected static void |
loadBootstrapPropertyList(java.lang.String bootstrapPropertyListPath)
|
protected static void |
loadServerIdentity()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static Habitat4JLogger logger
protected static final java.lang.String DEFAULT_BOOTSTRAP_PROPERTY_LIST_FILENAME
protected static final java.lang.Class DEFAULT_APPLICATION_PROPERTY_LIST_LOADER
public static final java.lang.String BOOTSTRAP_PARAM_APPLICATION_NAME
public static final java.lang.String BOOTSTRAP_PARAM_BOOTSTRAP_PROPERTIES_PATH
public static final java.lang.String BOOTSTRAP_PARAM_XSD_VALIDATION_ENABLED
public static final java.lang.String BOOTSTRAP_PARAM_LOG4J_ENABLED
public static final java.lang.String BOOTSTRAP_PARAM_LOG_LEVEL
public static final java.lang.String BOOTSTRAP_PARAM_SERVER_IDENTITY_FILE_PATH
public static final java.lang.String BOOTSTRAP_PARAM_SERVER_IDENTITY_MODE
public static final java.lang.String BOOTSTRAP_PARAM_APPLICATION_PROPERTY_LIST_LOADER_CLASS
protected static final java.lang.String[][] defaultBootstrapParamNameArray
| Constructor Detail |
|---|
public Habitat4JBootstrap()
| Method Detail |
|---|
public static java.util.HashMap getDefaultBootstrapParamNameMap()
protected static void configureApplicationName(java.lang.String applicationName)
throws Habitat4JBootstrapException
applicationName - - the name of the calling application
Habitat4JBootstrapExceptionprotected static void configureServerIdentityXsdValidation(boolean xsdValidationEnabled)
xsdValidationEnabled - - boolean whether XSD validation should occurprotected static void configurePropertyListXsdValidation(boolean xsdValidationEnabled)
xsdValidationEnabled - - boolean whether XSD validation should occur
protected static void configureLog4j(boolean log4jEnabled,
java.lang.String logLevel)
log4jEnabled - - boolean whether log4j should be used for logginglogLevel - - a String containing either: "debug" "info" "warn" "error" or "fatal"protected static void configureServerIdentity(java.lang.String serverIdentityFilePath)
serverIdentityFilePath - - a String containing a single path or semicolon-delimited list of paths
protected static void configurePropertyListManager(java.lang.String applicationName,
java.lang.String serverIdentityMode)
applicationName - - the name of the calling applicationserverIdentityMode - - the ServerIdentity mode to use
protected static void loadBootstrapPropertyList(java.lang.String bootstrapPropertyListPath)
throws Habitat4JBootstrapException
bootstrapPropertyListPath - - the file- or class-path to the bootstrap property file
Habitat4JBootstrapException
protected static void loadApplicationPropertyLists(java.lang.String applicationName,
java.lang.String appPropertyListLoaderClassName)
throws Habitat4JBootstrapException
applicationName - - the name of the calling applicationappPropertyListLoaderClassName - - a String containing the fully qualified class for the implementation of ApplicationPropertyListLoaderIF
Habitat4JBootstrapException
protected static void loadApplicationPropertyLists(java.lang.String applicationName,
java.lang.Class appPropertyListLoaderClass)
throws Habitat4JBootstrapException
applicationName - - the name of the calling applicationappPropertyListLoaderClass - - the Class object for the implementation of ApplicationPropertyListLoaderIF
Habitat4JBootstrapException
protected static void loadServerIdentity()
throws Habitat4JBootstrapException
Habitat4JBootstrapException
public static void initializeServerIdentity(java.lang.String applicationName,
boolean xsdValidationEnabled,
boolean log4jEnabled,
java.lang.String logLevel,
java.lang.String serverIdentityFilePath,
java.lang.String serverIdentityMode)
throws Habitat4JBootstrapException
applicationName - - the name of the calling applicationxsdValidationEnabled - - boolean whether XSD validation should occurlog4jEnabled - - boolean whether log4j should be used for logginglogLevel - - a String containing either: "debug" "info" "warn" "error" or "fatal"serverIdentityFilePath - - a String containing a single path or semicolon-delimited list of pathsserverIdentityMode - - a String containing the ServerIdentity mode of operation (NULL, JVM, FILE)
Habitat4JBootstrapException
public static void initializeServerIdentity(java.lang.String applicationName,
boolean xsdValidationEnabled,
boolean log4jEnabled,
java.lang.String logLevel,
java.lang.String serverIdentityFilePath)
throws Habitat4JBootstrapException
applicationName - - the name of the calling applicationxsdValidationEnabled - - boolean whether XSD validation should occurlog4jEnabled - - boolean whether log4j should be used for logginglogLevel - - a String containing either: "debug" "info" "warn" "error" or "fatal"serverIdentityFilePath - - a String containing a single path or semicolon-delimited list of paths
Habitat4JBootstrapException
public static void initializeServerIdentity(java.lang.String applicationName,
java.lang.String serverIdentityFilePath,
java.lang.String serverIdentityMode)
throws Habitat4JBootstrapException
applicationName - - the name of the calling applicationserverIdentityFilePath - - a String containing a single path or semicolon-delimited list of pathsserverIdentityMode - - a String containing the ServerIdentity mode of operation (NULL, JVM, FILE)
Habitat4JBootstrapException
public static void initializeServerIdentity(java.lang.String applicationName,
java.lang.String serverIdentityFilePath)
throws Habitat4JBootstrapException
applicationName - - the name of the calling applicationserverIdentityFilePath - - a String containing a single path or semicolon-delimited list of paths
Habitat4JBootstrapException
public static void initializeServerIdentity(java.lang.String applicationName)
throws Habitat4JBootstrapException
applicationName - - the name of the calling application
Habitat4JBootstrapException
public static void initializePropertyLists(java.lang.String bootstrapPropertyListPath,
boolean xsdValidationEnabled,
java.lang.String appPropertyListLoaderClass)
throws Habitat4JBootstrapException
bootstrapPropertyListPath - xsdValidationEnabled - - boolean whether XSD validation should occurappPropertyListLoaderClass -
Habitat4JBootstrapException
public static void initializePropertyLists(java.lang.String bootstrapPropertyListPath,
boolean xsdValidationEnabled)
throws Habitat4JBootstrapException
bootstrapPropertyListPath - xsdValidationEnabled - - boolean whether XSD validation should occur
Habitat4JBootstrapException
public static void initializePropertyLists(java.lang.String bootstrapPropertyListPath)
throws Habitat4JBootstrapException
bootstrapPropertyListPath -
Habitat4JBootstrapException
public static void initialize(java.lang.String applicationName,
java.lang.String bootstrapPropertyListPath,
boolean xsdValidationEnabled,
boolean log4jEnabled,
java.lang.String logLevel,
java.lang.String serverIdentityFilePath,
java.lang.String serverIdentityMode,
java.lang.Class appPropertyListLoaderClass)
throws Habitat4JBootstrapException
applicationName - - the name of the calling applicationbootstrapPropertyListPath - - the file- or class-path to the bootstrap property filexsdValidationEnabled - - boolean whether XSD validation should occurlog4jEnabled - - boolean whether log4j should be used for logginglogLevel - - a String containing either: "debug" "info" "warn" "error" or "fatal"serverIdentityFilePath - - a String containing a single path or semicolon-delimited list of pathsserverIdentityMode - - a String containing the ServerIdentity mode of operation (NULL, JVM, FILE)appPropertyListLoaderClass - - a Class that implements ApplicationPropertyListLoaderIF
Habitat4JBootstrapException
public static void initialize(java.lang.String applicationName,
java.lang.String bootstrapPropertyListPath,
boolean xsdValidationEnabled,
boolean log4jEnabled,
java.lang.String logLevel,
java.lang.String serverIdentityFilePath,
java.lang.String serverIdentityMode,
java.lang.String appPropertyListLoaderClassName)
throws Habitat4JBootstrapException
applicationName - - the name of the calling applicationbootstrapPropertyListPath - - the file- or class-path to the bootstrap property filexsdValidationEnabled - - boolean whether XSD validation should occurlog4jEnabled - - boolean whether log4j should be used for logginglogLevel - - a String containing either: "debug" "info" "warn" "error" or "fatal"serverIdentityFilePath - - a String containing a single path or semicolon-delimited list of pathsserverIdentityMode - - a String containing the ServerIdentity mode of operation (NULL, JVM, FILE)appPropertyListLoaderClassName - - a String containing the fully qualified class for the implementation of ApplicationPropertyListLoaderIF
Habitat4JBootstrapException
public static void initialize(java.lang.String applicationName,
java.lang.String bootstrapPropertyListPath,
boolean xsdValidationEnabled,
boolean log4jEnabled,
java.lang.String logLevel,
java.lang.String serverIdentityFilePath)
throws Habitat4JBootstrapException
applicationName - - the name of the calling applicationbootstrapPropertyListPath - - the file- or class-path to the bootstrap property filexsdValidationEnabled - - boolean whether XSD validation should occurlog4jEnabled - - boolean whether log4j should be used for logginglogLevel - - a String containing either: "debug" "info" "warn" "error" or "fatal"serverIdentityFilePath - - a String containing a single path or semicolon-delimited list of paths
Habitat4JBootstrapException
public static void initialize(java.lang.String applicationName,
java.lang.String bootstrapPropertyListPath,
boolean xsdValidationEnabled,
boolean log4jEnabled,
java.lang.String logLevel)
throws Habitat4JBootstrapException
applicationName - - the name of the calling applicationbootstrapPropertyListPath - - the file- or class-path to the bootstrap property filexsdValidationEnabled - - boolean whether XSD validation should occurlog4jEnabled - - boolean whether log4j should be used for logginglogLevel - - a String containing either: "debug" "info" "warn" "error" or "fatal"
Habitat4JBootstrapException
public static void initialize(java.lang.String applicationName,
java.lang.String bootstrapPropertyListPath,
boolean xsdValidationEnabled,
boolean log4jEnabled)
throws Habitat4JBootstrapException
applicationName - - the name of the calling applicationbootstrapPropertyListPath - - the file- or class-path to the bootstrap property filexsdValidationEnabled - - boolean whether XSD validation should occurlog4jEnabled - - boolean whether log4j should be used for logging
Habitat4JBootstrapException
public static void initialize(java.lang.String applicationName,
java.lang.String bootstrapPropertyListPath,
boolean xsdValidationEnabled)
throws Habitat4JBootstrapException
applicationName - - the name of the calling applicationbootstrapPropertyListPath - - the file- or class-path to the bootstrap property filexsdValidationEnabled - - boolean whether XSD validation should occur
Habitat4JBootstrapException
public static void initialize(java.lang.String applicationName,
java.lang.String bootstrapPropertyListPath)
throws Habitat4JBootstrapException
applicationName - - the name of the calling applicationbootstrapPropertyListPath - - the file- or class-path to the bootstrap property file
Habitat4JBootstrapException
protected static java.lang.String getMappedInitParamValue(java.util.Map bootstrapInitParams,
java.util.Map bootstrapInitParamsNameMap,
java.lang.String name)
throws Habitat4JBootstrapException
bootstrapInitParams - - the Map instance of name/value pairs that contain bootstrap initialization parameter valuesbootstrapInitParamsNameMap - - the Map instance of name/value pairs that contain initialization parameter name-to-name mappingsname - - the name in the name/value pair
Habitat4JBootstrapException
public static void initializeServerIdentity(java.util.Map bootstrapInitParams,
java.util.Map bootstrapInitParamsNameMap)
throws Habitat4JBootstrapException
bootstrapInitParams - - the Map instance of name/value pairs that contain bootstrap initialization parametersbootstrapInitParamsNameMap - - the Map instance of name/value pairs that contain initialization parameter name-to-name mappings
Habitat4JBootstrapException
public static void initializeServerIdentity(java.util.Map bootstrapInitParams)
throws Habitat4JBootstrapException
bootstrapInitParams - - the Map instance of name/value pairs that contain bootstrap initialization parameters
Habitat4JBootstrapException
public static void initializePropertyLists(java.util.Map bootstrapInitParams,
java.util.Map bootstrapInitParamsNameMap)
throws Habitat4JBootstrapException
bootstrapInitParams - - the Map instance of name/value pairs that contain bootstrap initialization parametersbootstrapInitParamsNameMap - - the Map instance of name/value pairs that contain initialization parameter name-to-name mappings
Habitat4JBootstrapException
public static void initializePropertyLists(java.util.Map bootstrapInitParams)
throws Habitat4JBootstrapException
bootstrapInitParams - - the Map instance of name/value pairs that contain bootstrap initialization parameters
Habitat4JBootstrapException
public static void initialize(java.util.Map bootstrapInitParams,
java.util.Map bootstrapInitParamsNameMap)
throws Habitat4JBootstrapException
bootstrapInitParams - - the Map instance of name/value pairs that contain bootstrap initialization parametersbootstrapInitParamsNameMap - - the Map instance of name/value pairs that contain initialization parameter name-to-name mappings
Habitat4JBootstrapException
public static void initialize(java.util.Map bootstrapInitParams)
throws Habitat4JBootstrapException
bootstrapInitParams - - the Map instance of name/value pairs that contain bootstrap initialization parameters
Habitat4JBootstrapException
public static java.lang.String createServerIdentityPath(java.lang.String serverIdentityFileName,
java.lang.String[] directories)
serverIdentityFileName - - filename for server-identity file.directories - - all directories where the server-identity file could exist.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||