|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.environment.internal.EnvironmentHelper
Helper class for maintaining the environment stack. This is an internal class, and it might change in an incompatible way over time. For developing your own components/applications based on Cocoon, you shouldn't really need it.
Nested Class Summary | |
static class |
EnvironmentHelper.AbstractCocoonRunnable
A runnable wrapper that inherits the environment stack of the thread it is created in. |
Field Summary | |
protected String |
context
The Context path |
protected static ThreadLocal |
environmentStack
The environment information |
protected String |
lastPrefix
The last prefix, which is stripped off from the request uri |
protected ServiceManager |
manager
The service manager |
protected String |
prefix
The complete prefix |
protected SourceResolver |
resolver
The real source resolver |
Fields inherited from interface org.apache.excalibur.source.SourceResolver |
METHOD, ROLE, URI_ENCODING, URI_PARAMETERS |
Constructor Summary | |
EnvironmentHelper(EnvironmentHelper parent)
Constructor |
|
EnvironmentHelper(URL context)
Constructor |
Method Summary | |
void |
changeContext(Environment env)
Change the context of the environment. |
void |
changeContext(Source newSource,
String newPrefix)
Adds an prefix to the overall stripped off prefix from the request uri |
static void |
checkEnvironment(int depth,
Logger logger)
INTERNAL METHOD. |
static XMLConsumer |
createEnvironmentAwareConsumer(XMLConsumer consumer)
Create an environment aware xml consumer for the cocoon protocol |
static XMLConsumer |
createPopEnvironmentConsumer(XMLConsumer consumer)
Create an environment aware xml consumer that pop and save the current environment before calling the consumer. |
static XMLConsumer |
createPushEnvironmentConsumer(XMLConsumer consumer,
Environment environment)
Create an environment aware xml consumer that push an environment before calling the consumer. |
void |
dispose()
|
static void |
enterEnvironment(Environment env)
This method is used for entering a new environment. |
static void |
enterProcessor(Processor processor,
ServiceManager manager,
Environment env)
This hook must be called by the sitemap each time a sitemap is entered. |
String |
getContext()
Return the current context URI |
static Environment |
getCurrentEnvironment()
Return the environment |
static Processor |
getCurrentProcessor()
Return the current processor |
String |
getPrefix()
Return the prefix |
static ServiceManager |
getSitemapServiceManager()
Get the current sitemap component manager. |
static Environment |
leaveEnvironment()
This method is used for leaving the current environment. |
static void |
leaveProcessor()
This hook must be called by the sitemap each time a sitemap is left. |
static int |
markEnvironment()
INTERNAL METHOD. |
void |
release(Source source)
|
Source |
resolveURI(String location)
|
Source |
resolveURI(String location,
String baseURI,
Map parameters)
|
void |
service(ServiceManager manager)
|
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
protected SourceResolver resolver
protected ServiceManager manager
protected String prefix
protected String context
protected String lastPrefix
Constructor Detail |
public EnvironmentHelper(URL context)
public EnvironmentHelper(EnvironmentHelper parent)
Method Detail |
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
Serviceable.service(org.apache.avalon.framework.service.ServiceManager)
public void dispose()
dispose
in interface Disposable
Disposable.dispose()
public void release(Source source)
release
in interface SourceResolver
SourceResolver.release(org.apache.excalibur.source.Source)
public Source resolveURI(String location, String baseURI, Map parameters) throws MalformedURLException, IOException
resolveURI
in interface SourceResolver
MalformedURLException
IOException
SourceResolver.resolveURI(java.lang.String, java.lang.String, java.util.Map)
public Source resolveURI(String location) throws MalformedURLException, IOException
resolveURI
in interface SourceResolver
MalformedURLException
IOException
SourceResolver.resolveURI(java.lang.String)
public String getContext()
public String getPrefix()
public void changeContext(Environment env) throws ProcessingException
env
- The environment to change
ProcessingException
public void changeContext(Source newSource, String newPrefix) throws IOException
IOException
public static void enterProcessor(Processor processor, ServiceManager manager, Environment env) throws ProcessingException
This method should never raise an exception, except when the parameters are not set!
ProcessingException
- if processor is nullpublic static void leaveProcessor()
It's the counterpart to the enterProcessor(Processor, ServiceManager, Environment)
method.
public static void enterEnvironment(Environment env) throws ProcessingException
ProcessingException
- if there is no current processing environmentpublic static Environment leaveEnvironment()
It's the counterpart to the enterEnvironment(Environment)
method.
public static int markEnvironment()
public static void checkEnvironment(int depth, Logger logger) throws Exception
Exception
public static Environment getCurrentEnvironment()
public static Processor getCurrentProcessor()
public static ServiceManager getSitemapServiceManager()
public static XMLConsumer createEnvironmentAwareConsumer(XMLConsumer consumer)
public static XMLConsumer createPushEnvironmentConsumer(XMLConsumer consumer, Environment environment)
public static XMLConsumer createPopEnvironmentConsumer(XMLConsumer consumer)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |