|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cocoon.core.CoreUtil
This is an utility class to create a new Cocoon instance. TODO - Remove dependencies to LogKit and Log4J
Nested Class Summary | |
protected static class |
CoreUtil.LoggerWrapper
|
Field Summary | |
protected DefaultContext |
appContext
"legacy" support: create an avalon context. |
protected ClassLoader |
classloader
|
protected Cocoon |
cocoon
The Cocoon instance (the root processor). |
protected static Map |
CONTEXT_PARAMETERS
Parameter map for the context protocol |
protected BootstrapEnvironment |
env
The callback to the real environment. |
protected boolean |
isPerRequestLoggerManager
Is this a per request logger manager |
protected Logger |
log
The root logger. |
protected LoggerManager |
loggerManager
The logger manager. |
protected ServiceManager |
parentManager
The parent service manager. |
protected MutableSettings |
settings
The settings. |
Constructor Summary | |
CoreUtil(BootstrapEnvironment environment)
Setup a new instance. |
Method Summary | |
void |
cleanUpRequest(Object handle)
Cleanup everything initialized during the request processing in initializeRequest(Environment) . |
protected void |
createClassloader()
Create the classloader that inlcudes all the [block]/BLOCK-INF/classes directories. |
Cocoon |
createCocoon()
Creates the Cocoon object and handles exception handling. |
protected Core |
createCore()
Create a new core instance. |
protected MutableSettings |
createSettings()
Get the settings for Cocoon. |
protected SourceResolver |
createSourceResolver(Logger logger)
Create a simple source resolver. |
void |
destroy()
Dispose Cocoon when environment is destroyed |
protected void |
disposeCocoon()
Destroy Cocoon |
protected void |
forceLoad()
Handle the load-class parameter. |
protected void |
forceProperty()
Handle the "force-property" parameter. |
Cocoon |
getCocoon(String pathInfo,
String reloadParam)
Gets the current cocoon object. |
protected Logger |
getCocoonLogger()
|
Core |
getCore()
|
protected String |
getExtraClassPath()
Retreives the "extra-classpath" attribute, that needs to be added to the class path. |
protected ServiceManager |
getParentServiceManager(Core core)
Instatiates the parent service manager, as specified in the parent-service-manager init parameter. |
Settings |
getSettings()
Return the settings object. |
protected void |
init()
|
Object |
initializeRequest(Environment env)
Initialize the current request. |
protected void |
initLogger()
|
protected void |
overrideLogLevel(Configuration root,
String value)
|
protected void |
readProperties(String directoryName,
MutableSettings s,
SourceResolver resolver)
Read all property files from the given directory and apply them to the settings. |
protected void |
updateEnvironment()
Method to update the environment before Cocoon instances are created. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final Map CONTEXT_PARAMETERS
protected final BootstrapEnvironment env
protected final DefaultContext appContext
protected MutableSettings settings
protected ServiceManager parentManager
protected Logger log
protected LoggerManager loggerManager
protected Cocoon cocoon
protected boolean isPerRequestLoggerManager
protected ClassLoader classloader
Constructor Detail |
public CoreUtil(BootstrapEnvironment environment) throws Exception
environment
- The hook back to the environment.
Exception
Method Detail |
protected void init() throws Exception
Exception
public Core getCore()
protected Core createCore()
public Settings getSettings()
protected ServiceManager getParentServiceManager(Core core)
null
.
null
.protected MutableSettings createSettings()
protected void readProperties(String directoryName, MutableSettings s, SourceResolver resolver)
public Object initializeRequest(Environment env)
PerRequestLoggerManager
than this manager is invoked to initialize the logging context for the request.
This method returns a handle that should be used to clean up everything
when the request is finished by calling cleanUpRequest(Object)
.
public void cleanUpRequest(Object handle)
initializeRequest(Environment)
.
protected SourceResolver createSourceResolver(Logger logger)
protected void initLogger()
protected void overrideLogLevel(Configuration root, String value)
public Cocoon createCocoon() throws Exception
Exception
protected void createClassloader() throws Exception
Exception
public Cocoon getCocoon(String pathInfo, String reloadParam) throws Exception
Exception
protected final void disposeCocoon()
protected Logger getCocoonLogger()
protected void forceLoad()
load-class
parameter. This overcomes
limits in many classpath issues. One of the more notorious
ones is a bug in WebSphere that does not load the URL handler
for the classloader://
protocol. In order to
overcome that bug, set load-class
parameter to
the com.ibm.servlet.classloader.Handler
value.
If you need to load more than one class, then separate each entry with whitespace, a comma, or a semi-colon. Cocoon will strip any whitespace from the entry.
protected void forceProperty()
protected void updateEnvironment() throws Exception
Exception
public void destroy()
protected String getExtraClassPath()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |