|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.cocoon.environment.wrapper.MutableEnvironmentFacade
public class MutableEnvironmentFacade
Enviroment facade, whose delegate object can be changed. This class is
required to handle internal redirects in sitemap sources ("cocoon:").
This is because SitemapSource
keeps the environment in which the internal request should be processed.
But internal redirects create a new processing environment and there's
no way to change the one held by the SitemapSource. So the
processing of internal redirects actually changes the delegate of this
class, transparently for the SitemapSource.
SitemapSource| Field Summary |
|---|
| Fields inherited from interface org.apache.excalibur.source.SourceResolver |
|---|
METHOD, ROLE, URI_ENCODING, URI_PARAMETERS |
| Constructor Summary | |
|---|---|
MutableEnvironmentFacade(EnvironmentWrapper env)
|
|
| Method Summary | |
|---|---|
void |
changeContext(String uriprefix,
String context)
Change the context from uriprefix to context |
void |
commitResponse()
Commit the response |
void |
finishingProcessing()
Notify that the processing is finished This can be used to cleanup the environment object |
String |
getAction()
Get the action to process |
Object |
getAttribute(String name)
Returns the object bound with the specified name, or null
if no object is bound under the name. |
Enumeration |
getAttributeNames()
Returns an Enumeration of String objects
containing the names of all the objects bound to this environment. |
String |
getContentType()
Get the content type of the resource |
String |
getContext()
Get current context |
EnvironmentWrapper |
getDelegate()
|
Map |
getObjectModel()
Get the underlying object model |
OutputStream |
getOutputStream()
Deprecated. Use getOutputStream(int) instead. |
OutputStream |
getOutputStream(int bufferSize)
Get the output stream where to write the generated resource. |
String |
getRedirectURL()
|
String |
getRootContext()
Get the Root Context |
String |
getURI()
Get the URI to process. |
String |
getURIPrefix()
Get the prefix of the URI in progress. |
String |
getView()
Get the view to process |
boolean |
isExternal()
Is this environment external ? |
boolean |
isInternalRedirect()
Is this an internal redirect? |
boolean |
isResponseModified(long lastModified)
Check if the response has been modified since the same "resource" was requested. |
void |
redirect(boolean sessionmode,
String url)
Redirect the client to the given URL |
void |
release(Source arg0)
|
void |
removeAttribute(String name)
Removes the object bound with the specified name from this environment. |
void |
reset()
|
Source |
resolve(String systemID)
Resolve the source. |
Source |
resolveURI(String arg0)
|
Source |
resolveURI(String arg0,
String arg1,
Map arg2)
|
void |
setAttribute(String name,
Object value)
Binds an object to this environment, using the name specified. |
void |
setContentLength(int length)
Set the length of the generated content |
void |
setContentType(String mimeType)
Set the content type of the generated resource |
void |
setContext(String prefix,
String uri,
String context)
Set the context. |
void |
setDelegate(EnvironmentWrapper env)
|
void |
setOutputStream(OutputStream os)
|
void |
setResponseIsNotModified()
Mark the response as not modified. |
void |
setStatus(int statusCode)
Set the response status code |
void |
setURI(String prefix,
String uri)
|
void |
startingProcessing()
Notify that the processing starts. |
boolean |
tryResetResponse()
Reset the response if possible. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MutableEnvironmentFacade(EnvironmentWrapper env)
| Method Detail |
|---|
public EnvironmentWrapper getDelegate()
public void setDelegate(EnvironmentWrapper env)
public void setURI(String prefix,
String uri)
public void setOutputStream(OutputStream os)
public String getRedirectURL()
public void reset()
public String getURI()
Environment
getURI in interface Environmentpublic String getURIPrefix()
Environment
getURIPrefix in interface Environmentpublic String getRootContext()
Environment
getRootContext in interface Environmentpublic String getContext()
Environment
getContext in interface Environmentpublic String getView()
Environment
getView in interface Environmentpublic String getAction()
Environment
getAction in interface Environment
public void setContext(String prefix,
String uri,
String context)
Environment
setContext in interface Environment
public void changeContext(String uriprefix,
String context)
throws Exception
Environment
changeContext in interface EnvironmentException
public void redirect(boolean sessionmode,
String url)
throws IOException
Environment
redirect in interface EnvironmentIOExceptionpublic void setContentType(String mimeType)
Environment
setContentType in interface Environmentpublic String getContentType()
Environment
getContentType in interface Environmentpublic void setContentLength(int length)
Environment
setContentLength in interface Environmentpublic void setStatus(int statusCode)
Environment
setStatus in interface Environment
public OutputStream getOutputStream()
throws IOException
getOutputStream(int) instead.
Environment
getOutputStream in interface EnvironmentIOExceptionEnvironment.getOutputStream()
public OutputStream getOutputStream(int bufferSize)
throws IOException
EnvironmentEnvironment.getOutputStream().
getOutputStream in interface EnvironmentIOExceptionpublic Map getObjectModel()
Environment
getObjectModel in interface Environmentpublic boolean isResponseModified(long lastModified)
Environment
isResponseModified in interface Environmentpublic void setResponseIsNotModified()
Environment
setResponseIsNotModified in interface Environment
public void setAttribute(String name,
Object value)
EnvironmentIf an object of the same name is already bound, the object is replaced.
setAttribute in interface Environmentname - the name to which the object is boundvalue - the object to be boundpublic Object getAttribute(String name)
Environmentnull
if no object is bound under the name.
getAttribute in interface Environmentname - a string specifying the name of the object
public void removeAttribute(String name)
Environment
removeAttribute in interface Environmentname - the name of the object to removepublic Enumeration getAttributeNames()
EnvironmentEnumeration of String objects
containing the names of all the objects bound to this environment.
getAttributeNames in interface EnvironmentEnumeration of Strings.
public boolean tryResetResponse()
throws IOException
Environment
tryResetResponse in interface EnvironmentIOException
public void commitResponse()
throws IOException
Environment
commitResponse in interface EnvironmentIOExceptionpublic void startingProcessing()
Environment
startingProcessing in interface Environmentpublic void finishingProcessing()
Environment
finishingProcessing in interface Environmentpublic boolean isExternal()
Environment
isExternal in interface Environmentpublic boolean isInternalRedirect()
Environment
isInternalRedirect in interface Environment
public Source resolve(String systemID)
throws ProcessingException,
SAXException,
IOException
SourceResolver
systemID - This is either a system identifier
(java.net.URL or a local file.
ProcessingException
SAXException
IOException
public Source resolveURI(String arg0)
throws MalformedURLException,
IOException
resolveURI in interface SourceResolverMalformedURLException
IOException
public Source resolveURI(String arg0,
String arg1,
Map arg2)
throws MalformedURLException,
IOException
resolveURI in interface SourceResolverMalformedURLException
IOExceptionpublic void release(Source arg0)
release in interface SourceResolver
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||