Habitat4JBootstrap, Habitat4JBootstrapServlet, and ExamplesHabitat4JBootstrap Information
1.0 - Habitat4JBootstrap - Introduction [Top] The "bootstrap" process occurs during the initialization, or start-up, phase of a Java application. Habitat4J makes available the Habitat4JBootstrap static Java class, which sets up Habitat4J for an application. Habitat4JBootstrap, by default, uses a defined standard for the layout of an application's PropertyList files. This standard is described in this document. Habitat4JBootstrapServlet is a wrapper for Habitat4JBootstrap. It provides identical functionality and only serves as a mechanism to pass parameters into Habitat4JBootstrap. 1.1 - Habitat4JBootstrap - Goals [Top] Habitat4JBootstrap provides a JVM-wide environment for Habitat4J, setting:
1.2 - Habitat4JBootstrap - Bootstrap Parameters [Top] The following parameters are required by Habitat4JBootstrap:
The following parameters are optional for use in Habitat4JBootstrap:
1.3 - Habitat4JBootstrap - Bootstrap PropertyList File [Top] 1.4 - Habitat4JBootstrap - Application PropertyList System Files [Top] 1.5 - Habitat4JBootstrap - Application PropertyList Classpath Files [Top] 2.0 - Habitat4JBootstrapServlet - Servlet Configuration [Top] 2.1 - Habitat4JBootstrap - Initialization Parameters (init-param) [Top] 3.0 - Examples - Boostrap Code (Non-Servlet) [Top] NOTE: Only one of the following calls to
The following code will initialize Habitat4J using a Bootstrap PropertyList file from the classpath:
Habitat4JBootstrap.initialize(
"MyApplication",
"org/productivity/java/myapp/properties-bootstrap.xml"
);
The following code will initialize Habitat4J using a Bootstrap PropertyList file from the filesystem:
Habitat4JBootstrap.initialize(
"MyApplication",
"c:/apps/myapp/properties-bootstrap.xml"
);
The following code will initialize Habitat4J with XSD validation enabled:
Habitat4JBootstrap.initialize(
"MyApplication",
"org/productivity/java/myapp/properties-bootstrap.xml",
true
);
The following code will initialize Habitat4J with XSD validation enabled and Log4J support enabled:
Habitat4JBootstrap.initialize(
"MyApplication",
"org/productivity/java/myapp/properties-bootstrap.xml",
true,
true
);
The following code will initialize Habitat4J with XSD validation enabled, Log4J support disabled, and the built-in Habitat4J Logger set to "warn" level:
Habitat4JBootstrap.initialize(
"MyApplication",
"org/productivity/java/myapp/properties-bootstrap.xml",
true,
false,
"warn"
);
The following code will initialize Habitat4J with XSD
validation enabled, Log4J support enabled, and the path of
the
Habitat4JBootstrap.initialize(
"MyApplication",
"org/productivity/java/myapp/properties-bootstrap.xml",
true,
false,
null,
"c:/winnt/server-identity.xml"
);
The following code will initialize Habitat4J with XSD
validation enabled, Log4J support enabled, the path of the
Habitat4JBootstrap.initialize(
"MyApplication",
"org/productivity/java/myapp/properties-bootstrap.xml",
true,
false,
null,
"c:/winnt/server-identity.xml",
MyAppPropertyListLoader.class
);
The following code will initialize Habitat4J with XSD
validation enabled, Log4J support enabled, the path of the
Habitat4JBootstrap.initialize(
"MyApplication",
"org/productivity/java/myapp/properties-bootstrap.xml",
true,
false,
null,
"c:/winnt/server-identity.xml",
"org/productivity/java/myapp/MyAppPropertyListLoader"
);
3.0 - Examples - Boostrap Code (Non-Servlet) [Top] 3.1 - Examples - Bootstrap PropertyList [Top] 3.2 - Examples - Application PropertyList (FileSystem) [Top] 3.3 - Examples - Application PropertyList (ClassPath) [Top] 3.4 - Examples - Web Descriptor (web.xml) [Top] |