org.apache.cocoon.environment
Class AbstractEnvironment

java.lang.Object
  extended byorg.apache.cocoon.util.AbstractLogEnabled
      extended byorg.apache.cocoon.environment.AbstractEnvironment
All Implemented Interfaces:
org.apache.cocoon.environment.Environment
Direct Known Subclasses:
HttpEnvironment

public abstract class AbstractEnvironment
extends org.apache.cocoon.util.AbstractLogEnabled
implements org.apache.cocoon.environment.Environment

Base class for any environment

Version:
$Id: AbstractEnvironment.html 1304280 2012-03-23 11:18:01Z ilgrosso $

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  org.apache.cocoon.util.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()
           
protected static String extractAction(org.apache.cocoon.environment.Request req)
          Helper method to extract the action name from the request.
protected static String extractView(org.apache.cocoon.environment.Request request)
          Helper method to extract the view name from the request.
 void finishingProcessing()
           
 String getAction()
           
 Object getAttribute(String name)
           
 Enumeration getAttributeNames()
           
 Map getObjectModel()
           
 OutputStream getOutputStream(int bufferSize)
           
 String getURI()
           
 String getURIPrefix()
           
 String getView()
           
 boolean isInternalRedirect()
           
 boolean isResponseModified(long lastModified)
           
 void removeAttribute(String name)
           
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)
           
 void setResponseIsNotModified()
           
 void setStatus(int statusCode)
           
 void setURI(String prefix, String value)
           
protected  void setView(String view)
          Allow implementations to set view later than in super() constructor.
 void startingProcessing()
           
 boolean tryResetResponse()
           
 
Methods inherited from class org.apache.cocoon.util.AbstractLogEnabled
getLogger, setLogger
 
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

uri

protected String uri
The current uri in progress


prefix

protected String prefix
The prefix


view

protected String view
The View requested


action

protected String action
The Action requested


objectModel

protected Map objectModel
The object model


secureOutputStream

protected org.apache.cocoon.util.BufferedOutputStream secureOutputStream
The secure Output Stream


outputStream

protected OutputStream outputStream
The real output stream

Constructor Detail

AbstractEnvironment

public AbstractEnvironment(String uri,
                           String view)
Constructs the abstract environment


AbstractEnvironment

public AbstractEnvironment(String uri,
                           String view,
                           String action)
Constructs the abstract environment

Method Detail

setView

protected void setView(String view)
Allow implementations to set view later than in super() constructor. View can be set only once, and should be set in implementation's constructor.


setAction

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.


extractView

protected static String extractView(org.apache.cocoon.environment.Request request)
Helper method to extract the view name from the request.


extractAction

protected static String extractAction(org.apache.cocoon.environment.Request req)
Helper method to extract the action name from the request.


getURI

public String getURI()
Specified by:
getURI in interface org.apache.cocoon.environment.Environment

getURIPrefix

public String getURIPrefix()
Specified by:
getURIPrefix in interface org.apache.cocoon.environment.Environment

setURI

public void setURI(String prefix,
                   String value)
Specified by:
setURI in interface org.apache.cocoon.environment.Environment

getView

public String getView()
Specified by:
getView in interface org.apache.cocoon.environment.Environment

getAction

public String getAction()
Specified by:
getAction in interface org.apache.cocoon.environment.Environment

setStatus

public void setStatus(int statusCode)
Specified by:
setStatus in interface org.apache.cocoon.environment.Environment

getObjectModel

public Map getObjectModel()
Specified by:
getObjectModel in interface org.apache.cocoon.environment.Environment

isResponseModified

public boolean isResponseModified(long lastModified)
Specified by:
isResponseModified in interface org.apache.cocoon.environment.Environment

setResponseIsNotModified

public void setResponseIsNotModified()
Specified by:
setResponseIsNotModified in interface org.apache.cocoon.environment.Environment

getAttribute

public Object getAttribute(String name)
Specified by:
getAttribute in interface org.apache.cocoon.environment.Environment

setAttribute

public void setAttribute(String name,
                         Object value)
Specified by:
setAttribute in interface org.apache.cocoon.environment.Environment

removeAttribute

public void removeAttribute(String name)
Specified by:
removeAttribute in interface org.apache.cocoon.environment.Environment

getAttributeNames

public Enumeration getAttributeNames()
Specified by:
getAttributeNames in interface org.apache.cocoon.environment.Environment

getOutputStream

public OutputStream getOutputStream(int bufferSize)
                             throws IOException
Specified by:
getOutputStream in interface org.apache.cocoon.environment.Environment
Throws:
IOException

tryResetResponse

public boolean tryResetResponse()
                         throws IOException
Specified by:
tryResetResponse in interface org.apache.cocoon.environment.Environment
Throws:
IOException

commitResponse

public void commitResponse()
                    throws IOException
Specified by:
commitResponse in interface org.apache.cocoon.environment.Environment
Throws:
IOException

startingProcessing

public void startingProcessing()
Specified by:
startingProcessing in interface org.apache.cocoon.environment.Environment

finishingProcessing

public void finishingProcessing()
Specified by:
finishingProcessing in interface org.apache.cocoon.environment.Environment

isInternalRedirect

public boolean isInternalRedirect()
Specified by:
isInternalRedirect in interface org.apache.cocoon.environment.Environment


Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.