|
|||||||||||
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.AbstractEnvironment
org.apache.cocoon.environment.wrapper.EnvironmentWrapper
This is a wrapper class for the Environment
object.
It has the same properties except that the object model
contains a RequestWrapper
object.
Field Summary | |
protected String |
contentType
|
protected Environment |
environment
The wrapped environment |
protected boolean |
internalRedirect
|
protected OutputStream |
outputStream
The stream to output to |
protected String |
redirectURL
The redirect url |
protected Request |
request
The request object |
Fields inherited from class org.apache.cocoon.environment.AbstractEnvironment |
action, objectModel, prefix, secureOutputStream, uri, view |
Constructor Summary | |
EnvironmentWrapper(Environment env,
SitemapSourceInfo info,
Logger logger)
Construct a new environment. |
|
EnvironmentWrapper(Environment env,
SitemapSourceInfo info,
Logger logger,
boolean wrapResponse)
Construct a new environment. |
Method Summary | |
void |
commitResponse()
Commit the response |
Object |
getAttribute(String name)
Lookup an attribute in this instance, and if not found search it in the wrapped environment. |
String |
getContentType()
Get the ContentType |
OutputStream |
getOutputStream(int bufferSize)
Get the output stream where to write the generated resource. |
String |
getRedirectURL()
if a redirect should happen this returns the url, otherwise null is returned |
boolean |
isExternal()
Always return false . |
boolean |
isInternalRedirect()
Is this an internal redirect? |
void |
redirect(String newURL,
boolean global,
boolean permanent)
Redirect to the given URL |
void |
removeAttribute(String name)
Remove attribute from the current instance, as well as from the wrapped environment. |
void |
reset()
|
void |
setContentLength(int length)
Set the length of the generated content |
void |
setContentType(String contentType)
Set the ContentType |
void |
setInternalRedirect(boolean flag)
|
void |
setOutputStream(OutputStream stream)
Set the output stream for this environment. |
void |
setStatus(int statusCode)
Set the StatusCode |
boolean |
tryResetResponse()
Reset the response if possible. |
Methods inherited from class org.apache.cocoon.environment.AbstractEnvironment |
extractAction, extractView, finishingProcessing, getAction, getAttributeNames, getObjectModel, getURI, getURIPrefix, getView, isResponseModified, setAction, setAttribute, setResponseIsNotModified, setURI, setView, startingProcessing |
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 final Environment environment
protected String redirectURL
protected final Request request
protected OutputStream outputStream
protected String contentType
protected boolean internalRedirect
Constructor Detail |
public EnvironmentWrapper(Environment env, SitemapSourceInfo info, Logger logger)
env
- The origial Environmentinfo
- A description of the uri for the new environmentlogger
- The logger to be used by this environmentpublic EnvironmentWrapper(Environment env, SitemapSourceInfo info, Logger logger, boolean wrapResponse)
env
- The origial Environmentinfo
- A description of the uri for the new environmentlogger
- The logger to be used by this environmentwrapResponse
- Whether or not to wrap the Response objectMethod Detail |
public void redirect(String newURL, boolean global, boolean permanent) throws IOException
Environment
IOException
public OutputStream getOutputStream(int bufferSize) throws IOException
Environment
getOutputStream
in interface Environment
getOutputStream
in class AbstractEnvironment
IOException
public void setOutputStream(OutputStream stream)
public boolean tryResetResponse() throws IOException
Environment
tryResetResponse
in interface Environment
tryResetResponse
in class AbstractEnvironment
IOException
public void commitResponse() throws IOException
Environment
commitResponse
in interface Environment
commitResponse
in class AbstractEnvironment
IOException
public String getRedirectURL()
null
is returned
public void reset()
public void setStatus(int statusCode)
setStatus
in interface Environment
setStatus
in class AbstractEnvironment
public void setContentLength(int length)
Environment
public void setContentType(String contentType)
public String getContentType()
public Object getAttribute(String name)
getAttribute
in interface Environment
getAttribute
in class AbstractEnvironment
name
- a String
, the name of the attribute to
look for
Object
, the value of the attribute or
null if no such attribute was found.public void removeAttribute(String name)
removeAttribute
in interface Environment
removeAttribute
in class AbstractEnvironment
name
- a String
valuepublic boolean isExternal()
false
.
public void setInternalRedirect(boolean flag)
public boolean isInternalRedirect()
Environment
isInternalRedirect
in interface Environment
isInternalRedirect
in class AbstractEnvironment
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |