|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avalon.framework.logger.AbstractLogEnabled org.apache.avalon.excalibur.component.AbstractDualLogEnabled org.apache.avalon.excalibur.component.ExcaliburComponentManager org.apache.cocoon.components.CocoonComponentManager
public final class CocoonComponentManager
Cocoon Component Manager.
This manager extends the ExcaliburComponentManager
by a special lifecycle handling for a RequestLifecycleComponent
and by handling the lookup of the SourceResolver
.
WARNING: This is a "private" Cocoon core class - do NOT use this class
directly - and do not assume that a ComponentManager
you get
via the compose() method is an instance of CocoonComponentManager.
Nested Class Summary | |
---|---|
static class |
CocoonComponentManager.AbstractCocoonRunnable
A runnable wrapper that inherits the environment stack of the thread it is created in. |
Field Summary | |
---|---|
protected static ThreadLocal |
environmentStack
The environment information |
Fields inherited from class org.apache.avalon.excalibur.component.ExcaliburComponentManager |
---|
INSTRUMENTABLE_NAME |
Fields inherited from interface org.apache.excalibur.source.SourceResolver |
---|
METHOD, ROLE, URI_ENCODING, URI_PARAMETERS |
Fields inherited from interface org.apache.excalibur.instrument.Instrumentable |
---|
EMPTY_INSTRUMENT_ARRAY, EMPTY_INSTRUMENTABLE_ARRAY |
Constructor Summary | |
---|---|
CocoonComponentManager()
Create the ComponentManager |
|
CocoonComponentManager(ClassLoader loader)
Create the ComponentManager with a Classloader |
|
CocoonComponentManager(ComponentManager manager)
Create the ComponentManager with a parent ComponentManager |
|
CocoonComponentManager(ComponentManager manager,
ClassLoader loader)
Create the ComponentManager with a Classloader and parent ComponentManager |
Method Summary | |
---|---|
void |
addComponent(String role,
Class clazz,
Configuration conf)
|
static void |
addComponentForAutomaticRelease(ComponentManager manager,
Component component)
Add an automatically released component |
static void |
addComponentForAutomaticRelease(ComponentSelector selector,
Component component,
ComponentManager manager)
Add an automatically released component |
static void |
checkEnvironment(int depth,
Logger logger)
INTERNAL METHOD. |
static XMLConsumer |
createEnvironmentAwareConsumer(XMLConsumer consumer)
Create an environment aware xml consumer for the cocoon protocol |
void |
dispose()
Dispose |
static void |
endProcessing(Environment env,
Object key)
This hook has to be called before a request is processed. |
static void |
enterEnvironment(Environment env,
ComponentManager manager,
Processor processor)
This hook must be called by the sitemap each time a sitemap is entered This method should never raise an exception, except when the parameters are not set! |
static Processor |
getActiveProcessor(Environment env)
Return the processor that has actually processed the request |
static Environment |
getCurrentEnvironment()
Return the current environment (for the cocoon: protocol) |
static Processor |
getCurrentProcessor()
Return the current processor (for the cocoon: protocol) |
static ComponentManager |
getSitemapComponentManager()
Get the current sitemap component manager. |
void |
initialize()
|
static void |
leaveEnvironment()
This hook must be called by the sitemap each time a sitemap is left. |
static void |
leaveEnvironment(boolean success)
This hook must be called by the sitemap each time a sitemap is left. |
Component |
lookup(String role)
Return an instance of a component based on a Role. |
static int |
markEnvironment()
INTERNAL METHOD. |
void |
release(Component component)
Release a Component. |
void |
release(Source source)
Releases a resolved resource |
protected void |
releaseRLComponent(Component component)
Release a RequestLifecycleComponent |
static void |
removeFromAutomaticRelease(Component component)
Remove from automatically released components |
Source |
resolveURI(String location)
Get a Source object. |
Source |
resolveURI(String location,
String baseURI,
Map parameters)
Get a Source object. |
void |
setInstrumentManager(InstrumentManager iManager)
|
protected void |
setParentManager(ComponentManager manager)
|
static Object |
startProcessing(Environment env)
This hook has to be called before a request is processed. |
Methods inherited from class org.apache.avalon.excalibur.component.ExcaliburComponentManager |
---|
addComponentInstance, configure, contextualize, getChildInstrumentables, getComponentHandler, getInstrumentableName, getInstruments, hasComponent, setInstrumentableName, setLoggerManager, setLogKitManager, setRoleManager |
Methods inherited from class org.apache.avalon.excalibur.component.AbstractDualLogEnabled |
---|
getLogkitLogger, setLogger |
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, toString, wait, wait, wait |
Field Detail |
---|
protected static final ThreadLocal environmentStack
Constructor Detail |
---|
public CocoonComponentManager()
public CocoonComponentManager(ClassLoader loader)
public CocoonComponentManager(ComponentManager manager, ClassLoader loader)
public CocoonComponentManager(ComponentManager manager)
Method Detail |
---|
protected void setParentManager(ComponentManager manager)
public void setInstrumentManager(InstrumentManager iManager)
setInstrumentManager
in interface InstrumentManageable
setInstrumentManager
in class ExcaliburComponentManager
ExcaliburComponentManager.setInstrumentManager(org.apache.excalibur.instrument.InstrumentManager)
public static void enterEnvironment(Environment env, ComponentManager manager, Processor processor)
public static void leaveEnvironment()
enterEnvironment(Environment, ComponentManager, Processor)
.
public static void leaveEnvironment(boolean success)
enterEnvironment(Environment, ComponentManager, Processor)
.
success
- indicates if the request was successfully handled by the environment that's being leftpublic static int markEnvironment()
public static void checkEnvironment(int depth, Logger logger) throws Exception
Exception
public static XMLConsumer createEnvironmentAwareConsumer(XMLConsumer consumer)
public static Object startProcessing(Environment env)
public static void endProcessing(Environment env, Object key)
key
- A unique key within this thread return by
startProcessing(Environment)
.public static Environment getCurrentEnvironment()
public static Processor getCurrentProcessor()
public static Processor getActiveProcessor(Environment env)
public static ComponentManager getSitemapComponentManager()
public Component lookup(String role) throws ComponentException
lookup
in interface ComponentManager
lookup
in class ExcaliburComponentManager
ComponentException
public void release(Component component)
release
in interface ComponentManager
release
in class ExcaliburComponentManager
protected void releaseRLComponent(Component component)
public static void addComponentForAutomaticRelease(ComponentSelector selector, Component component, ComponentManager manager) throws ProcessingException
ProcessingException
public static void addComponentForAutomaticRelease(ComponentManager manager, Component component) throws ProcessingException
ProcessingException
public static void removeFromAutomaticRelease(Component component) throws ProcessingException
ProcessingException
public void dispose()
dispose
in interface Disposable
dispose
in class ExcaliburComponentManager
public Source resolveURI(String location) throws MalformedURLException, IOException, SourceException
Source
object.
resolveURI
in interface SourceResolver
MalformedURLException
IOException
SourceException
public Source resolveURI(String location, String baseURI, Map parameters) throws MalformedURLException, IOException, SourceException
Source
object.
resolveURI
in interface SourceResolver
MalformedURLException
IOException
SourceException
public void release(Source source)
release
in interface SourceResolver
public void addComponent(String role, Class clazz, Configuration conf) throws ComponentException
addComponent
in class ExcaliburComponentManager
ComponentException
public void initialize() throws Exception
initialize
in interface Initializable
initialize
in class ExcaliburComponentManager
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |