org.objectweb.perseus.pool.api
Interface PoolMatchFactory
public interface PoolMatchFactory
The interface PoolMatchFactory defines the object used by a Pool to
test if a given resource of a Pool matches with the hints passed with the
Pool getResource method. It also allows such a Pool to allocate a
PoolResource as needed, conforming to the passed hints. Finally the factory
is called when a resource is going to be destroyed.
- S.Chassande-Barrioz, P.Dechamboux
Object | createResource(Object hints) - createResource creates a new PoolResource.
|
void | destroyResource(Object resource) - is called when a resource is going to be destroyed.
|
boolean | matchResource(Object resource, Object hints) - matchResource tests if a given resource of a Pool matches with
the hints passed with the Pool getResource method.
|
createResource
public Object createResource(Object hints)
throws PoolException
createResource creates a new PoolResource.
hints
- The "properties" that the created PoolResource should
conform to.
- The created PoolResource.
destroyResource
public void destroyResource(Object resource)
is called when a resource is going to be destroyed. This method permits
to close physical resource for example.
resource
- to initialize.
matchResource
public boolean matchResource(Object resource,
Object hints)
matchResource tests if a given resource of a Pool matches with
the hints passed with the Pool getResource method.
resource
- The PoolResource to test its matching with some
"properties" specified by hints.hints
- The "properties" that the PoolResource specified by pr
should match.
- true if the pr PoolResource matches the hints
"properties".
Copyright © 2000-2002 France Telecom S.A., INRIA, IMAG-LSR All Rights Reserved.