org.apache.cocoon.core
Interface BootstrapEnvironment

All Known Implementing Classes:
CocoonPortlet.PortletBootstrapEnvironment, CocoonServlet.ServletBootstrapEnvironment, CocoonWrapper.WrapperBootstrapper, OSGiBootstrapEnvironment

public interface BootstrapEnvironment

The BootstrapEnvironment is the connection between the real environment (servlet, cli etc.) and the Cocoon core. The core uses this object to access information from the real environment and to pass several objects back. A BootstrapEnvironment can be used to create a new Cocoon system using the CoreUtil.

Since:
2.2
Version:
$Id: BootstrapEnvironment.java 312659 2005-10-10 14:11:48Z cziegeler $

Nested Class Summary
static class BootstrapEnvironment.LogLevel
          Convenience class to define some constants for log levels.
 
Method Summary
 void configure(DefaultContext context)
          This callback can be used by the environment to add environment specific information.
 void configure(MutableSettings settings)
          This callback can be used by the environment to add environment specific settings.
 void configureLoggingContext(DefaultContext context)
          This callback can be used by the environment to add environment specific information for the logging system.
 Logger getBootstrapLogger(BootstrapEnvironment.LogLevel logLevel)
          Get the bootstrap logger.
 URL getConfigFile(String configFileName)
          Set the ConfigFile for the Cocoon object.
 File getContextForWriting()
          Returns a file to the application context.
 String getContextURL()
          Returns the URL to the application context.
 Context getEnvironmentContext()
          Create the context object of the environment.
 void log(String message)
          Log a message during bootstrapping.
 void log(String message, Throwable error)
          Log a message during bootstrapping.
 void setLogger(Logger rootLogger)
          Pass the root logger back to the environment.
 

Method Detail

getBootstrapLogger

public Logger getBootstrapLogger(BootstrapEnvironment.LogLevel logLevel)
Get the bootstrap logger.

Parameters:
logLevel - The log level to use according to the Logger interface.

log

public void log(String message)
Log a message during bootstrapping. This is used to log information before the logging system is setup.

Parameters:
message - A message.

log

public void log(String message,
                Throwable error)
Log a message during bootstrapping. This is used to log information before the logging system is setup.

Parameters:
message - A message.
error - An error.

setLogger

public void setLogger(Logger rootLogger)
Pass the root logger back to the environment. As soon as the logging system is set up, this method is called.

Parameters:
rootLogger - The root logger.

configure

public void configure(MutableSettings settings)
This callback can be used by the environment to add environment specific settings. For example the servlet environment parsed the web.xml and adjusts the settings based on the parameters.

Parameters:
settings - The settings for Cocoon.

configureLoggingContext

public void configureLoggingContext(DefaultContext context)
This callback can be used by the environment to add environment specific information for the logging system.

Parameters:
context - The context passed to the logging system.

configure

public void configure(DefaultContext context)
This callback can be used by the environment to add environment specific information.

Parameters:
context - The context passed to all Avalon based components that are context aware.

getEnvironmentContext

public Context getEnvironmentContext()
Create the context object of the environment.

Returns:
The context object.

getContextURL

public String getContextURL()
Returns the URL to the application context.


getContextForWriting

public File getContextForWriting()
Returns a file to the application context.

Returns:
A file pointing to the context or null if the context is not writeable.

getConfigFile

public URL getConfigFile(String configFileName)
                  throws Exception
Set the ConfigFile for the Cocoon object.

Parameters:
configFileName - The file location for the cocoon.xconf
Throws:
Exception


Copyright ? 1999-2005 The Apache Software Foundation. All Rights Reserved.