com.ebmwebsourcing.easycommons.pooling
Interface ResourceHandler<T>


public interface ResourceHandler<T>

A resource handler to manage the resource life cycle. It enables to control the creation of the resource and to make specific actions on the getting a resource from the pool and on the putting of a resource to the pool

Author:
aruffie, Nicolas Oddoux - EBM WebSourcing

Method Summary
 T create()
          Create a resource.
 void onRelease(T resource)
          Call when putting a resource back in the pool (releasing)
 void onTake(T resource)
          Call when getting a resource from the pool (taking)
 

Method Detail

create

T create()
Create a resource.

Returns:
a new resource instance.

onTake

void onTake(T resource)
Call when getting a resource from the pool (taking)

Parameters:
resource - the resource got from the pool

onRelease

void onRelease(T resource)
Call when putting a resource back in the pool (releasing)

Parameters:
resource - The resource put back in the pool


Copyright © 2012 Petals Link. All Rights Reserved.