com.sage.orion.sdata.servlet
Interface ResourceKindPool

All Known Implementing Classes:
MiscellaneousPool, ResourceKindPoolImpl, SystemResourcePool, SystemResourcePool, SystemResourcePool

public interface ResourceKindPool

A ResourceKindPool represents a pool of ResourceKind that can be used to satisfy requests.

Use #checkOut(SDataRequest, String) to get a ResourceKind to satisfy a request and checkIn(ResourceKind, SDataRequest, ResourceResponse, RuntimeException) to return it, once done.

This allows for intelligent reuse of ResourceKinds such as using the same object to satisfy a request for a subsequent page of a feed, etc.


Method Summary
 void checkIn(ResourceKind resourceKind, SDataRequest request, ResourceResponse response, java.lang.RuntimeException exception)
          Checks the ResourceKind back into the pool.
 ResourceKind checkOut(SDataRequest request, java.lang.String authToken)
          Checks a ResourceKind out of the pool.
 java.util.Collection<SDataResourceKindInfo> getResourceKindInfo()
          Gets the ResourceKindInfo for all the resources in the pool, or null.
 void shutdown()
          Perform any cleanup of the pool during shutdown
 

Method Detail

checkOut

ResourceKind checkOut(SDataRequest request,
                      java.lang.String authToken)
Checks a ResourceKind out of the pool. If there is no ResourceKind available one is created.

Parameters:
request - the SDataRequest for which a ResourceKind is wanted
authToken - the authorization token representing the user
Returns:
a suitable ResourceKind or null

checkIn

void checkIn(ResourceKind resourceKind,
             SDataRequest request,
             ResourceResponse response,
             java.lang.RuntimeException exception)
Checks the ResourceKind back into the pool.

Parameters:
resourceKind - the ResourceKind originally checked out by checkOut(com.sage.orion.sdata.servlet.SDataRequest, java.lang.String)
request - the original SDataRequest for which the checkOut(com.sage.orion.sdata.servlet.SDataRequest, java.lang.String) occurred
response - the ResourceResponse that is about to be returned, or null if there is a throwable
exception - the RuntimeException about to be converted to a response, or null if there is a response.

getResourceKindInfo

java.util.Collection<SDataResourceKindInfo> getResourceKindInfo()
Gets the ResourceKindInfo for all the resources in the pool, or null.

Returns:
an unmodifiable collection of information or null

shutdown

void shutdown()
Perform any cleanup of the pool during shutdown



Copyright © 2011 Sage Software, Inc. All rights reserved.