org.apache.tapestry.engine
Class AbstractService

java.lang.Object
  extended by org.apache.tapestry.engine.AbstractService
All Implemented Interfaces:
IEngineService
Direct Known Subclasses:
ActionService, AssetService, DirectService, ExternalService, HomeService, PageService, ResetService, RestartService

public abstract class AbstractService
extends Object
implements IEngineService

Abstract base class for implementing engine services. Instances of services are shared by many engines and threads, so they must be threadsafe.

Note; too much of the URL encoding/decoding stategy is fixed here. A future release of Tapestry may extract this strategy, allowing developers to choose the method via which URLs are encoded.

Since:
1.0.3
Version:
$Id: AbstractService.java 243791 2004-02-19 17:38:13Z hlship $
Author:
Howard Lewis Ship
See Also:
AbstractEngine.getService(String)

Constructor Summary
AbstractService()
           
 
Method Summary
protected  ILink constructLink(IRequestCycle cycle, String serviceName, String[] serviceContext, Object[] parameters, boolean stateful)
          Constructs a link for the service.
protected  Object[] getParameters(IRequestCycle cycle)
          Returns the service parameters as an array of Strings.
protected  String[] getServiceContext(RequestContext context)
          Returns the service context as an array of Strings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.tapestry.engine.IEngineService
getLink, getName, service
 

Constructor Detail

AbstractService

public AbstractService()
Method Detail

constructLink

protected ILink constructLink(IRequestCycle cycle,
                              String serviceName,
                              String[] serviceContext,
                              Object[] parameters,
                              boolean stateful)
Constructs a link for the service.

Parameters:
cycle - the request cycle
serviceName - the name of the service
serviceContext - context related to the service itself which is added to the URL as-is
parameters - additional service parameters provided by the component; this is application specific information, and is encoded with URLEncoder.encode(String) before being added to the query.
stateful - if true, the final URL must be encoded with the HttpSession id

getServiceContext

protected String[] getServiceContext(RequestContext context)
Returns the service context as an array of Strings. Returns null if there are no service context strings.


getParameters

protected Object[] getParameters(IRequestCycle cycle)
Returns the service parameters as an array of Strings.