|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cocoon.environment.wrapper.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
Constructor Summary | |
MutableEnvironmentFacade(EnvironmentWrapper env)
|
Method Summary | |
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 |
EnvironmentWrapper |
getDelegate()
|
Map |
getObjectModel()
Get the underlying object model |
OutputStream |
getOutputStream(int bufferSize)
Get the output stream where to write the generated resource. |
String |
getRedirectURL()
|
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(String url,
boolean global,
boolean permanent)
Redirect to the given URL |
void |
removeAttribute(String name)
Removes the object bound with the specified name from this environment. |
void |
reset()
|
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 |
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)
Set the URI and the prefix to process. |
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)
Environment
setURI
in interface Environment
public void setOutputStream(OutputStream os)
public String getRedirectURL()
public String getURI()
Environment
getURI
in interface Environment
public String getURIPrefix()
Environment
getURIPrefix
in interface Environment
public String getView()
Environment
getView
in interface Environment
public String getAction()
Environment
getAction
in interface Environment
public void redirect(String url, boolean global, boolean permanent) throws IOException
Environment
redirect
in interface Environment
IOException
public void setContentType(String mimeType)
Environment
setContentType
in interface Environment
public String getContentType()
Environment
getContentType
in interface Environment
public void setContentLength(int length)
Environment
setContentLength
in interface Environment
public void setStatus(int statusCode)
Environment
setStatus
in interface Environment
public OutputStream getOutputStream(int bufferSize) throws IOException
Environment
getOutputStream
in interface Environment
IOException
public Map getObjectModel()
Environment
getObjectModel
in interface Environment
public boolean isResponseModified(long lastModified)
Environment
isResponseModified
in interface Environment
public void setResponseIsNotModified()
Environment
setResponseIsNotModified
in interface Environment
public void setAttribute(String name, Object value)
Environment
If an object of the same name is already bound, the object is replaced.
setAttribute
in interface Environment
name
- the name to which the object is boundvalue
- the object to be boundpublic Object getAttribute(String name)
Environment
null
if no object is bound under the name.
getAttribute
in interface Environment
name
- a string specifying the name of the object
public void removeAttribute(String name)
Environment
removeAttribute
in interface Environment
name
- the name of the object to removepublic Enumeration getAttributeNames()
Environment
Enumeration
of String
objects
containing the names of all the objects bound to this environment.
getAttributeNames
in interface Environment
Enumeration
of String
s.public boolean tryResetResponse() throws IOException
Environment
tryResetResponse
in interface Environment
IOException
public void commitResponse() throws IOException
Environment
commitResponse
in interface Environment
IOException
public void startingProcessing()
Environment
startingProcessing
in interface Environment
public void finishingProcessing()
Environment
finishingProcessing
in interface Environment
public boolean isExternal()
Environment
isExternal
in interface Environment
public void reset()
public boolean isInternalRedirect()
Environment
isInternalRedirect
in interface Environment
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |