|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 Environment
public String getURIPrefix()
Environment
getURIPrefix
in interface Environment
public String getRootContext()
Environment
getRootContext
in interface Environment
public String getContext()
Environment
getContext
in interface Environment
public String getView()
Environment
getView
in interface Environment
public 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 Environment
Exception
public void redirect(boolean sessionmode, String url) 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() throws IOException
getOutputStream(int)
instead.
Environment
getOutputStream
in interface Environment
IOException
Environment.getOutputStream()
public OutputStream getOutputStream(int bufferSize) throws IOException
Environment
Environment.getOutputStream()
.
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 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 SourceResolver
MalformedURLException
IOException
public Source resolveURI(String arg0, String arg1, Map arg2) throws MalformedURLException, IOException
resolveURI
in interface SourceResolver
MalformedURLException
IOException
public void release(Source arg0)
release
in interface SourceResolver
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |