org.apache.avalon.merlin.kernel.impl
Class DefaultKernelContext

java.lang.Object
  extended byorg.apache.avalon.framework.logger.AbstractLogEnabled
      extended byorg.apache.avalon.merlin.kernel.impl.DefaultKernelContext
All Implemented Interfaces:
KernelContext, LogEnabled

public class DefaultKernelContext
extends AbstractLogEnabled
implements KernelContext

Default implementation of a kernel context.

Version:
$Revision: 1.30 $ $Date: 2003/09/15 08:26:22 $
Author:
Avalon Development Team

Field Summary
static String PRODUCT
           
static String VERSION
           
 
Constructor Summary
DefaultKernelContext(Repository bootstrap, File user, File library, File home, URL kernel, URL[] blocks, URL config, boolean server, boolean info, boolean debug)
          Creation of a new default kernel context.
 
Method Summary
 String getBootstrapRepositoryPath()
          Return the runtime repository directory.
 ContainmentContext getContainmentContext()
          Return the root containment context.
 boolean getDebugFlag()
          Return the kernel debug flag.
 File getHomePath()
          Return the home path
 URL[] getInstallSequence()
          Return the URLs to install into the kerenel on startup.
 Logger getKernelLogger()
          Return the kernel logging channel.
 File getLibraryPath()
          Return the library path
 LoggingManager getLoggingManager()
          Return the logging manager for the kernel.
static File getMerlinHomeDirectory()
          Return the merlin.home directory.
static File getMerlinLocalRepositoryDirectory()
          If the user has declare a local repository then return that (based on the merlin.local.repository sytem property, otherwise return the merlin.home repository directory.
 ModelFactory getModelFactory()
          Return the model factory.
 org.apache.excalibur.mpool.PoolManager getPoolManager()
          Return the kernel pool manager.
 Repository getRepository()
          Return the runtime repository.
 boolean getServerFlag()
          Return the kernel server flag.
 TargetDirective[] getTargetDirectives()
          Return the set of target overrides.
 File getTempPath()
          Return the temporary directory path
 String toString()
           
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PRODUCT

public static final String PRODUCT
See Also:
Constant Field Values

VERSION

public static final String VERSION
See Also:
Constant Field Values
Constructor Detail

DefaultKernelContext

public DefaultKernelContext(Repository bootstrap,
                            File user,
                            File library,
                            File home,
                            URL kernel,
                            URL[] blocks,
                            URL config,
                            boolean server,
                            boolean info,
                            boolean debug)
                     throws NullPointerException,
                            KernelException
Creation of a new default kernel context.

Parameters:
bootstrap - the system repository
user - the user repository directory
library - directory against which extension jar directives shall be anchored
home - local working directory
kernel - the kernel configuration URL - if null, the default kernel profile will be loaded from the bootstrap repository
blocks - a sequence of block urls
config - a url to a configuration override descriptor
server - server mode flag
debug - debug flag
Throws:
NullPointerException - if the supplied bootstrap repository is null
KernelException - if an error occurs during context creation
Method Detail

getKernelLogger

public Logger getKernelLogger()
Return the kernel logging channel.

Specified by:
getKernelLogger in interface KernelContext
Returns:
the kernel logging channel

getModelFactory

public ModelFactory getModelFactory()
Return the model factory.

Specified by:
getModelFactory in interface KernelContext
Returns:
the factory

getRepository

public Repository getRepository()
Return the runtime repository.

Specified by:
getRepository in interface KernelContext
Returns:
the repository

getLibraryPath

public File getLibraryPath()
Return the library path

Specified by:
getLibraryPath in interface KernelContext
Returns:
the path (possibly null)

getHomePath

public File getHomePath()
Return the home path

Specified by:
getHomePath in interface KernelContext
Returns:
the path

getTempPath

public File getTempPath()
Return the temporary directory path

Specified by:
getTempPath in interface KernelContext
Returns:
the path (possibly null)

getContainmentContext

public ContainmentContext getContainmentContext()
Return the root containment context.

Specified by:
getContainmentContext in interface KernelContext
Returns:
the kernel directive url

getInstallSequence

public URL[] getInstallSequence()
Return the URLs to install into the kerenel on startup.

Specified by:
getInstallSequence in interface KernelContext
Returns:
the block directive urls

getDebugFlag

public boolean getDebugFlag()
Return the kernel debug flag.

Specified by:
getDebugFlag in interface KernelContext
Returns:
the debug flag

getServerFlag

public boolean getServerFlag()
Return the kernel server flag.

Specified by:
getServerFlag in interface KernelContext
Returns:
the server flag

getLoggingManager

public LoggingManager getLoggingManager()
Return the logging manager for the kernel.

Specified by:
getLoggingManager in interface KernelContext
Returns:
the logging manager

getPoolManager

public org.apache.excalibur.mpool.PoolManager getPoolManager()
Return the kernel pool manager.

Specified by:
getPoolManager in interface KernelContext
Returns:
the pool manager

getTargetDirectives

public TargetDirective[] getTargetDirectives()
Return the set of target overrides.

Specified by:
getTargetDirectives in interface KernelContext
Returns:
the target override directives

getBootstrapRepositoryPath

public String getBootstrapRepositoryPath()
Return the runtime repository directory.

Returns:
the repository path

toString

public String toString()

getMerlinLocalRepositoryDirectory

public static File getMerlinLocalRepositoryDirectory()
If the user has declare a local repository then return that (based on the merlin.local.repository sytem property, otherwise return the merlin.home repository directory.

Returns:
the local repository directory

getMerlinHomeDirectory

public static File getMerlinHomeDirectory()
Return the merlin.home directory. If undefined, return the ${user.home}/.merlin directory.

Returns:
the merlin home directory


Copyright © Apache Software Foundation. All Rights Reserved.