|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avalon.framework.logger.AbstractLogEnabled org.apache.cocoon.environment.AbstractEnvironment org.apache.cocoon.environment.wrapper.EnvironmentWrapper
public class 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 Map |
objectModel
The object model |
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, avalonToCocoonSourceWrapper, context, initializedComponents, manager, prefix, rootContext, secureOutputStream, sourceResolver, uris, view |
Fields inherited from interface org.apache.excalibur.source.SourceResolver |
---|
METHOD, ROLE, URI_ENCODING, URI_PARAMETERS |
Constructor Summary | |
---|---|
EnvironmentWrapper(Environment env,
ComponentManager manager,
String uri,
Logger logger,
boolean wrapResponse)
|
|
EnvironmentWrapper(Environment env,
String requestURI,
String queryString,
Logger logger)
Constructs an EnvironmentWrapper object from a Request and Response objects |
|
EnvironmentWrapper(Environment env,
String requestURI,
String queryString,
Logger logger,
boolean rawMode)
Constructs an EnvironmentWrapper object from a Request and Response objects |
|
EnvironmentWrapper(Environment env,
String requestURI,
String queryString,
Logger logger,
ComponentManager manager,
boolean rawMode)
Constructs an EnvironmentWrapper object from a Request and Response objects |
|
EnvironmentWrapper(Environment env,
String requestURI,
String queryString,
Logger logger,
ComponentManager manager,
boolean rawMode,
String view)
Constructs an EnvironmentWrapper object from a Request and Response objects |
|
EnvironmentWrapper(Environment env,
String requestURI,
String queryString,
Logger logger,
ComponentManager manager,
boolean rawMode,
String view,
boolean wrapResponse)
Constructs an EnvironmentWrapper object from a Request and Response objects |
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 |
Map |
getObjectModel()
Get the underlying object model |
OutputStream |
getOutputStream(int bufferSize)
Get the output stream |
String |
getRedirectURL()
if a redirect should happen this returns the url, otherwise null is returned |
void |
globalRedirect(boolean sessionmode,
String newURL)
Redirect in the first non-wrapped environment |
boolean |
isExternal()
Always return false . |
boolean |
isInternalRedirect()
Is this an internal redirect? |
void |
redirect(boolean sessionmode,
String newURL)
Redirect the client to a new URL is not allowed |
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 |
void |
setURI(String prefix,
String uris)
Set a new URI for processing. |
boolean |
tryResetResponse()
Reset the response if possible. |
Methods inherited from class org.apache.cocoon.environment.AbstractEnvironment |
---|
changeContext, extractAction, extractView, finishingProcessing, getAction, getAttributeNames, getContext, getOutputStream, getRootContext, getURI, getURIPrefix, getView, hasAttribute, initComponents, isResponseModified, release, removeAttribute, resolve, resolveURI, resolveURI, setAction, setAttribute, setContext, setContext, setResponseIsNotModified, setURIPrefix, 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 Environment environment
protected Map objectModel
protected String redirectURL
protected Request request
protected OutputStream outputStream
protected String contentType
protected boolean internalRedirect
Constructor Detail |
---|
public EnvironmentWrapper(Environment env, String requestURI, String queryString, Logger logger) throws MalformedURLException
MalformedURLException
public EnvironmentWrapper(Environment env, String requestURI, String queryString, Logger logger, boolean rawMode) throws MalformedURLException
MalformedURLException
public EnvironmentWrapper(Environment env, String requestURI, String queryString, Logger logger, ComponentManager manager, boolean rawMode) throws MalformedURLException
MalformedURLException
public EnvironmentWrapper(Environment env, String requestURI, String queryString, Logger logger, ComponentManager manager, boolean rawMode, String view) throws MalformedURLException
MalformedURLException
public EnvironmentWrapper(Environment env, String requestURI, String queryString, Logger logger, ComponentManager manager, boolean rawMode, String view, boolean wrapResponse) throws MalformedURLException
MalformedURLException
public EnvironmentWrapper(Environment env, ComponentManager manager, String uri, Logger logger, boolean wrapResponse) throws MalformedURLException
MalformedURLException
Method Detail |
---|
public void redirect(boolean sessionmode, String newURL) throws IOException
IOException
public void globalRedirect(boolean sessionmode, String newURL) throws IOException
globalRedirect
in class AbstractEnvironment
IOException
public OutputStream getOutputStream(int bufferSize) throws IOException
getOutputStream
in interface Environment
getOutputStream
in class AbstractEnvironment
IOException
public void setOutputStream(OutputStream stream)
public boolean tryResetResponse() throws IOException
tryResetResponse
in interface Environment
tryResetResponse
in class AbstractEnvironment
IOException
public void commitResponse() throws IOException
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 Map getObjectModel()
getObjectModel
in interface Environment
getObjectModel
in class AbstractEnvironment
public void setURI(String prefix, String uris)
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 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 |