org.apache.tapestry.engine
Class DirectService

java.lang.Object
  extended by org.apache.tapestry.engine.DirectService
All Implemented Interfaces:
IEngineService

public class DirectService
extends Object
implements IEngineService

Implementation of the direct service, which encodes the page and component id in the service context, and passes application-defined parameters as well.

Since:
1.0.9
Author:
Howard Lewis Ship

Field Summary
protected  LinkFactory _linkFactory
           
protected  WebRequest _request
           
protected  ResponseRenderer _responseRenderer
           
 
Constructor Summary
DirectService()
           
 
Method Summary
 ILink getLink(boolean post, Object parameter)
          Builds a URL for a service.
 String getName()
          Returns the name of the service.
 void service(IRequestCycle cycle)
          Perform the service, interpreting the URL (from the HttpServletRequest) responding appropriately, and rendering a result page.
 void setLinkFactory(LinkFactory linkFactory)
           
 void setRequest(WebRequest request)
           
 void setRequestCycle(IRequestCycle requestCycle)
           
 void setResponseRenderer(ResponseRenderer responseRenderer)
           
protected  void triggerComponent(IRequestCycle cycle, IDirect direct, Object[] parameters)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_responseRenderer

protected ResponseRenderer _responseRenderer
Since:
4.0

_linkFactory

protected LinkFactory _linkFactory
Since:
4.0

_request

protected WebRequest _request
Since:
4.0
Constructor Detail

DirectService

public DirectService()
Method Detail

getLink

public ILink getLink(boolean post,
                     Object parameter)
Description copied from interface: IEngineService
Builds a URL for a service. This is performed during the rendering phase of one request cycle and builds URLs that will invoke activity in a subsequent request cycle.

This method changed incompatibly between release 3.0 and release 4.0.

Specified by:
getLink in interface IEngineService
Parameters:
post - if true, then the link will be used for a post (not a get, i.e., for a HTML form); this may affect what information is encoded into the link
parameter - An object that provide any additional information needed by the service. Each service implementation will expect that an object of the proper type be passed in. In some cases, a simple String will do; in others, a specific object (possibly implementing an interface) will be required.
Returns:
The URL for the service. The URL will have to be encoded via HttpServletResponse.encodeURL(java.lang.String).

service

public void service(IRequestCycle cycle)
             throws IOException
Description copied from interface: IEngineService
Perform the service, interpreting the URL (from the HttpServletRequest) responding appropriately, and rendering a result page.

Specified by:
service in interface IEngineService
Parameters:
cycle - the incoming request
Throws:
IOException

triggerComponent

protected void triggerComponent(IRequestCycle cycle,
                                IDirect direct,
                                Object[] parameters)
Since:
4.0

getName

public String getName()
Description copied from interface: IEngineService
Returns the name of the service.

Specified by:
getName in interface IEngineService

setResponseRenderer

public void setResponseRenderer(ResponseRenderer responseRenderer)
Since:
4.0

setLinkFactory

public void setLinkFactory(LinkFactory linkFactory)
Since:
4.0

setRequest

public void setRequest(WebRequest request)
Since:
4.0

setRequestCycle

public void setRequestCycle(IRequestCycle requestCycle)
Since:
4.0


Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.