|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cocoon.util.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. INTERNAL CLASS. Do not use this, can be removed without warning or deprecation cycle.
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(org.apache.cocoon.environment.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)
INTERNAL METHOD. |
static org.apache.cocoon.xml.XMLConsumer |
createEnvironmentAwareConsumer(org.apache.cocoon.xml.XMLConsumer consumer)
Create an environment aware xml consumer for the cocoon protocol. |
static org.apache.cocoon.xml.XMLConsumer |
createPopEnvironmentConsumer(org.apache.cocoon.xml.XMLConsumer consumer)
Create an environment aware xml consumer that pop and save the current environment before calling the consumer. |
static org.apache.cocoon.xml.XMLConsumer |
createPushEnvironmentConsumer(org.apache.cocoon.xml.XMLConsumer consumer,
org.apache.cocoon.environment.Environment environment)
Create an environment aware xml consumer that push an environment before calling the consumer. |
void |
dispose()
|
static void |
enterEnvironment(org.apache.cocoon.environment.Environment env)
This method is used for entering a new environment. |
static void |
enterProcessor(org.apache.cocoon.Processor processor,
org.apache.cocoon.environment.Environment env)
This hook must be called by the sitemap each time a sitemap is entered. |
String |
getContext()
Return the current context URI |
static org.apache.cocoon.environment.Environment |
getCurrentEnvironment()
Return the environment. |
static org.apache.cocoon.Processor |
getCurrentProcessor()
Return the current processor INTERNAL METHOD. |
String |
getPrefix()
Return the prefix |
static ServiceManager |
getSitemapServiceManager()
Get the current sitemap component manager. |
static org.apache.cocoon.environment.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 avalonManager)
|
Methods inherited from class org.apache.cocoon.util.AbstractLogEnabled |
getLogger, setLogger |
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 avalonManager) 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 IOException
resolveURI
in interface SourceResolver
IOException
SourceResolver.resolveURI(java.lang.String, java.lang.String, java.util.Map)
public Source resolveURI(String location) throws IOException
resolveURI
in interface SourceResolver
IOException
SourceResolver.resolveURI(java.lang.String)
public String getContext()
public String getPrefix()
public void changeContext(org.apache.cocoon.environment.Environment env) throws org.apache.cocoon.ProcessingException
env
- The environment to change
org.apache.cocoon.ProcessingException
public void changeContext(Source newSource, String newPrefix) throws IOException
IOException
public static void enterProcessor(org.apache.cocoon.Processor processor, org.apache.cocoon.environment.Environment env) throws org.apache.cocoon.ProcessingException
This method should never raise an exception, except when the parameters are not set!
org.apache.cocoon.ProcessingException
- if processor is nullpublic static void leaveProcessor()
It's the counterpart to the enterProcessor(Processor, Environment)
method.
public static void enterEnvironment(org.apache.cocoon.environment.Environment env) throws org.apache.cocoon.ProcessingException
org.apache.cocoon.ProcessingException
- if there is no current processing environmentpublic static org.apache.cocoon.environment.Environment leaveEnvironment()
It's the counterpart to the enterEnvironment(Environment)
method.
public static int markEnvironment()
public static void checkEnvironment(int depth) throws Exception
Exception
public static org.apache.cocoon.environment.Environment getCurrentEnvironment()
public static org.apache.cocoon.Processor getCurrentProcessor()
public static ServiceManager getSitemapServiceManager()
public static org.apache.cocoon.xml.XMLConsumer createEnvironmentAwareConsumer(org.apache.cocoon.xml.XMLConsumer consumer)
public static org.apache.cocoon.xml.XMLConsumer createPushEnvironmentConsumer(org.apache.cocoon.xml.XMLConsumer consumer, org.apache.cocoon.environment.Environment environment)
public static org.apache.cocoon.xml.XMLConsumer createPopEnvironmentConsumer(org.apache.cocoon.xml.XMLConsumer consumer)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |