NextApp Echo
App Container 1.1.4

nextapp.echoservlet
Class CacheableServiceWrapper

java.lang.Object
  extended bynextapp.echoservlet.CacheableServiceWrapper
All Implemented Interfaces:
CacheableService, java.io.Serializable, Service

public class CacheableServiceWrapper
extends java.lang.Object
implements CacheableService, java.io.Serializable

A 'wrapper' service which provides caching capability to a an otherwise non-cacheable service.

See Also:
Serialized Form

Constructor Summary
CacheableServiceWrapper(Id id, Service service)
          Creates a new CacheableServiceWrapper to wrap the specified service.
 
Method Summary
 Id getId()
          Returns a unique identifier for this service.
 int getVersion()
          Returns the version of the service to be retrieved.
 void service(Connection conn)
          Services an HTTP request.
 void update()
          Updates the cache id of the service, causing it to be reloaded when next requested.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheableServiceWrapper

public CacheableServiceWrapper(Id id,
                               Service service)
Creates a new CacheableServiceWrapper to wrap the specified service.

Parameters:
service - The non-cacheable service to wrap.
Method Detail

getVersion

public int getVersion()
Description copied from interface: CacheableService
Returns the version of the service to be retrieved. When a service is requested with an updated version number, a non-cached copy will be used. getVersion() should return distinct values whenever the service's content may have changed.

Specified by:
getVersion in interface CacheableService
Returns:
The current version number of the service.
See Also:
CacheableService.getVersion()

getId

public Id getId()
Description copied from interface: Service
Returns a unique identifier for this service.

Specified by:
getId in interface Service
Returns:
A unique identifier for this service.
See Also:
Service.getId()

update

public void update()
Updates the cache id of the service, causing it to be reloaded when next requested.


service

public void service(Connection conn)
             throws java.io.IOException
Description copied from interface: Service
Services an HTTP request. Information about the HTTP request as well as methods for issuing a response are available from the provided Connection object.

Specified by:
service in interface Service
Parameters:
conn - A Connection object which wraps HttpServletRequest and HttpServletResponse objects and provides access to the facilities of the Echo application container.
Throws:
java.io.IOException - in the event of errors related to processing the HTTP request or producing a response.
See Also:
Service.service(Connection)

NextApp Echo
App Container 1.1.4