|
|||||||||||
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
Base class for any environment
Field Summary | |
protected String |
action
The Action requested |
protected Map |
objectModel
The object model |
protected OutputStream |
outputStream
The real output stream |
protected String |
prefix
The prefix |
protected BufferedOutputStream |
secureOutputStream
The secure Output Stream |
protected String |
uri
The current uri in progress |
protected String |
view
The View requested |
Constructor Summary | |
AbstractEnvironment(String uri,
String view)
Constructs the abstract environment |
|
AbstractEnvironment(String uri,
String view,
String action)
Constructs the abstract environment |
Method Summary | |
void |
commitResponse()
Commit the response |
protected static String |
extractAction(Request req)
Helper method to extract the action name from the request. |
protected static String |
extractView(Request request)
Helper method to extract the view name from the request. |
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. |
Map |
getObjectModel()
Get the underlying object model |
OutputStream |
getOutputStream(int bufferSize)
Get the output stream where to write the generated resource. |
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 |
isInternalRedirect()
Is this an internal redirect? |
boolean |
isResponseModified(long lastModified)
Check if the response has been modified since the same "resource" was requested. |
void |
removeAttribute(String name)
Removes the object bound with the specified name from this environment. |
protected void |
setAction(String action)
Allow implementations to set action later than in super() constructor Action can be set only once, and should be set in implementation's constructor. |
void |
setAttribute(String name,
Object value)
Binds an object to this environment, using the name specified. |
void |
setResponseIsNotModified()
Mark the response as not modified. |
void |
setStatus(int statusCode)
Set the response status code |
void |
setURI(String prefix,
String value)
Set the URI and the prefix to process. |
protected void |
setView(String view)
Allow implementations to set view later than in super() constructor. |
void |
startingProcessing()
Notify that the processing starts. |
boolean |
tryResetResponse()
Reset the response if possible. |
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 |
Methods inherited from interface org.apache.cocoon.environment.Environment |
getContentType, isExternal, redirect, setContentLength, setContentType |
Field Detail |
protected String uri
protected String prefix
protected String view
protected String action
protected Map objectModel
protected BufferedOutputStream secureOutputStream
protected OutputStream outputStream
Constructor Detail |
public AbstractEnvironment(String uri, String view)
public AbstractEnvironment(String uri, String view, String action)
Method Detail |
protected void setView(String view)
protected void setAction(String action)
protected static String extractView(Request request)
protected static String extractAction(Request req)
public String getURI()
Environment
getURI
in interface Environment
public String getURIPrefix()
Environment
getURIPrefix
in interface Environment
public void setURI(String prefix, String value)
Environment
setURI
in interface Environment
public String getView()
Environment
getView
in interface Environment
public String getAction()
Environment
getAction
in interface Environment
public void setStatus(int statusCode)
Environment
setStatus
in interface Environment
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 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 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 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 OutputStream getOutputStream(int bufferSize) throws IOException
Environment
getOutputStream
in interface Environment
IOException
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 isInternalRedirect()
Environment
isInternalRedirect
in interface Environment
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |