org.apache.cocoon.core
Class Core

java.lang.Object
  extended byorg.apache.cocoon.core.Core

public class Core
extends Object

This is the core Cocoon component. It can be looked up to get access to various information about the current installation. The core of Cocoon is a singleton object that is created on startup.

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

Nested Class Summary
static interface Core.CleanupTask
          The interface for the cleanup task.
static class Core.SitemapImpl
           
 
Field Summary
static String ROLE
          The key to lookup the component.
 
Constructor Summary
Core(Settings s, Context c)
          Constructor The core object is created by the CoreUtil class.
 
Method Summary
static void addCleanupTask(Core.CleanupTask task)
          Add a cleanup task.
static void cleanup()
          Invoke all registered cleanup tasks for the current process.
 File getCacheDirectory()
          Return the cache directory.
 Context getContext()
          Return the Avalon context.
 Map getCurrentObjectModel()
          Return the current object model
 Sitemap getCurrentSitemap()
          Return the current sitemap.
 Context getEnvironmentContext()
          Return the environment context object.
 Settings getSettings()
          Return the settings.
 File getUploadDirectory()
          Return the upload directory.
 File getWorkDirectory()
          Return the work directory.
 void update(DynamicSettings dynSettings)
          Update the dynamic settings at runtime.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ROLE

public static String ROLE
The key to lookup the component.

Constructor Detail

Core

public Core(Settings s,
            Context c)
Constructor The core object is created by the CoreUtil class. Never construct a core object yourself (apart from testing of course)!

Parameters:
s - The settings
c - The context
Method Detail

addCleanupTask

public static void addCleanupTask(Core.CleanupTask task)
Add a cleanup task. A cleanup task is run after a request is processed.

Parameters:
task - The task to run.

cleanup

public static void cleanup()
Invoke all registered cleanup tasks for the current process. This method should not be called directly!


getSettings

public Settings getSettings()
Return the settings.


update

public void update(DynamicSettings dynSettings)
Update the dynamic settings at runtime.

Parameters:
dynSettings -

getEnvironmentContext

public Context getEnvironmentContext()
Return the environment context object.

Returns:
The environment context.

getContext

public Context getContext()
Return the Avalon context.

Returns:
The Avalon context.

getCurrentObjectModel

public Map getCurrentObjectModel()
Return the current object model

Returns:
The object model.

getWorkDirectory

public File getWorkDirectory()
Return the work directory.


getUploadDirectory

public File getUploadDirectory()
Return the upload directory.


getCacheDirectory

public File getCacheDirectory()
Return the cache directory.


getCurrentSitemap

public Sitemap getCurrentSitemap()
Return the current sitemap.

Returns:
The current sitemap or null if no request is currently processed


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