|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.shale.remoting.impl.ChainProcessor
public class ChainProcessor
Implementation of Processor
which maps a resource identifier
to the name of a Commons
Chain command or chain, in an appropriate catalog. The command or chain
that is executed is passed an appropriate Context
object, and
it will also have access to the current JavaServer Faces state by calling
FacesContext.getCurrentInstance()
.
Constructor Summary | |
---|---|
ChainProcessor()
|
Method Summary | |
---|---|
protected Context |
createContext(javax.faces.context.FacesContext context,
String resourceId)
Create and return an appropriate Context instance to be
passed to the command or chain that is executed. |
protected String |
mapCatalog(javax.faces.context.FacesContext context,
String resourceId)
Map the specified resource identifier to the name of a Commons Chain Catalog from which the command or chain instance will be
acquired. |
protected String |
mapCommand(javax.faces.context.FacesContext context,
String resourceId)
Map the specified resource identifier to the name of a Commons Chain Command or Chain , which will be acquired from
a mapped Catalog . |
void |
process(javax.faces.context.FacesContext context,
String resourceId)
Map the specified resource identifier to an appropriate Commons Chain command or chain, in an appropriate catalog. |
protected void |
sendNotFound(javax.faces.context.FacesContext context,
String resourceId)
Send a "not found" HTTP response, if possible. |
protected void |
sendServerError(javax.faces.context.FacesContext context,
String resourceId,
Exception e)
Send a "server error" HTTP response, if possible. |
protected boolean |
servletRequest(javax.faces.context.FacesContext context)
Return true if we are processing a servlet request (as
opposed to a portlet request). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ChainProcessor()
Method Detail |
---|
public void process(javax.faces.context.FacesContext context, String resourceId) throws IOException
Map the specified resource identifier to an appropriate Commons
Chain command or chain, in an appropriate catalog. Construct an
appropriate Context
object, and execute the specified
command or chain, to which we delegate responsibility for creating
the response for the current request. Call
FacesContext.responseComplete()
to tell JavaServer Faces
that the entire response has already been created.
process
in interface Processor
context
- FacesContext
for the current requestresourceId
- Resource identifier used to select the appropriate response
(this will generally be a context relative path starting with "/")
IOException
- if an input/output error occurs
NullPointerException
- if viewId
is null
protected Context createContext(javax.faces.context.FacesContext context, String resourceId)
Create and return an appropriate Context
instance to be
passed to the command or chain that is executed.
The default algorithm constructs and returns an instance of
ChainContext
that wraps the specified FacesContext
.
context
- FacesContext
for the current requestresourceId
- Resource identifier to be mappedprotected String mapCatalog(javax.faces.context.FacesContext context, String resourceId)
Map the specified resource identifier to the name of a Commons Chain
Catalog
from which the command or chain instance will be
acquired.
The default implementation returns remoting
unconditionally.
context
- FacesContext
for the current requestresourceId
- Resource identifier to be mappedprotected String mapCommand(javax.faces.context.FacesContext context, String resourceId)
Map the specified resource identifier to the name of a Commons Chain
Command
or Chain
, which will be acquired from
a mapped Catalog
.
The default algorithm performs this conversion as follows:
context
- FacesContext
for the current requestresourceId
- Resource identifier to be mappedprotected void sendNotFound(javax.faces.context.FacesContext context, String resourceId) throws IOException
Send a "not found" HTTP response, if possible. Otherwise, throw an
IllegalArgumentException
that will ripple out.
context
- FacesContext
for the current requestresourceId
- Resource identifier of the resource that was not found
IllegalArgumentException
- if we cannot send an HTTP response
IOException
- if an input/output error occursprotected void sendServerError(javax.faces.context.FacesContext context, String resourceId, Exception e) throws IOException
Send a "server error" HTTP response, if possible. Otherwise, throw a
FacesException
that will ripple out.
context
- FacesContext
for the current requestresourceId
- Resource identifier of the resource that was not founde
- Server exception to be reported
javax.faces.FacesException
- if we cannot send an HTTP response
IOException
- if an input/output error occursprotected boolean servletRequest(javax.faces.context.FacesContext context)
Return true
if we are processing a servlet request (as
opposed to a portlet request).
context
- FacesContext
for the current request
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |