org.apache.cocoon.core.osgi
Class OSGiBootstrapEnvironment

java.lang.Object
  extended byorg.apache.cocoon.core.osgi.OSGiBootstrapEnvironment
All Implemented Interfaces:
BootstrapEnvironment

public class OSGiBootstrapEnvironment
extends Object
implements BootstrapEnvironment

Since:
2.2
Version:
$Id: OSGiBootstrapEnvironment.java 312637 2005-10-10 13:00:42Z cziegeler $

Nested Class Summary
 class OSGiBootstrapEnvironment.OSGiContext
           
 
Nested classes inherited from class org.apache.cocoon.core.BootstrapEnvironment
BootstrapEnvironment.LogLevel
 
Field Summary
 Logger logger
           
 
Constructor Summary
OSGiBootstrapEnvironment(org.osgi.framework.BundleContext bc)
           
 
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.
 InputStream getInputStream(String path)
          Get the input stream from a resource at the given path.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

public Logger logger
Constructor Detail

OSGiBootstrapEnvironment

public OSGiBootstrapEnvironment(org.osgi.framework.BundleContext bc)
                         throws Exception
Method Detail

getBootstrapLogger

public Logger getBootstrapLogger(BootstrapEnvironment.LogLevel logLevel)
Description copied from interface: BootstrapEnvironment
Get the bootstrap logger.

Specified by:
getBootstrapLogger in interface BootstrapEnvironment
Parameters:
logLevel - The log level to use according to the Logger interface.
See Also:
BootstrapEnvironment.getBootstrapLogger(org.apache.cocoon.core.BootstrapEnvironment.LogLevel)

log

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

Specified by:
log in interface BootstrapEnvironment
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.

Specified by:
log in interface BootstrapEnvironment
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.

Specified by:
setLogger in interface BootstrapEnvironment
Parameters:
rootLogger - The root logger.

getInputStream

public InputStream getInputStream(String path)
Get the input stream from a resource at the given path. Only paths relative to the bootstrap context are supported. Returns null if no resource exists at the specified path


configure

public void configure(MutableSettings settings)
Description copied from interface: BootstrapEnvironment
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.

Specified by:
configure in interface BootstrapEnvironment
Parameters:
settings - The settings for Cocoon.

configureLoggingContext

public void configureLoggingContext(DefaultContext context)
Description copied from interface: BootstrapEnvironment
This callback can be used by the environment to add environment specific information for the logging system.

Specified by:
configureLoggingContext in interface BootstrapEnvironment
Parameters:
context - The context passed to the logging system.

configure

public void configure(DefaultContext context)
Description copied from interface: BootstrapEnvironment
This callback can be used by the environment to add environment specific information.

Specified by:
configure in interface BootstrapEnvironment
Parameters:
context - The context passed to all Avalon based components that are context aware.

getEnvironmentContext

public Context getEnvironmentContext()
Description copied from interface: BootstrapEnvironment
Create the context object of the environment.

Specified by:
getEnvironmentContext in interface BootstrapEnvironment
Returns:
The context object.

getContextURL

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

Specified by:
getContextURL in interface BootstrapEnvironment

getContextForWriting

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

Specified by:
getContextForWriting in interface BootstrapEnvironment
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.

Specified by:
getConfigFile in interface BootstrapEnvironment
Parameters:
configFileName - The file location for the cocoon.xconf
Throws:
Exception


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