org.ow2.jonas.resource.internal.pool
Interface PoolMatchFactory

All Known Implementing Classes:
ConnectionManagerImpl

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 Object as needed, conforming to the passed hints.


Method Summary
 Object createResource(Object hints)
          createResource creates a new Object.
 ValidatingManagedConnectionFactory getValidatingMCFactory()
           
 boolean matchResource(Object pr, Object hints)
          matchResource tests if a given resource of a Pool matches with the hints passed with the Pool getResource method.
 Object matchResource(Set res, Object hints)
          matchResource tests if a given resource of a Pool matches with the hints passed with the Pool getResource method.
 void releaseResource(Object pr)
          releaseResource make sure that any cleanup needed for this entry is done
 

Method Detail

createResource

Object createResource(Object hints)
                      throws Exception
createResource creates a new Object.

Parameters:
hints - The "properties" that the created Object should conform to.
Returns:
The created Object.
Throws:
Exception - if an error occurs

matchResource

boolean matchResource(Object pr,
                      Object hints)
matchResource tests if a given resource of a Pool matches with the hints passed with the Pool getResource method.

Parameters:
pr - The Object to test its matching with some "properties" specified by hints.
hints - The "properties" that the Object specified by pr should match.
Returns:
true if the pr Object matches the hints "properties".

matchResource

Object matchResource(Set res,
                     Object hints)
                     throws Exception
matchResource tests if a given resource of a Pool matches with the hints passed with the Pool getResource method.

Parameters:
res - A set of Objects to test if matching with some "properties" specified by hints.
hints - The "properties" that the Object specified by pr should match.
Returns:
Object that matches the hints "properties". or null if no match.
Throws:
Exception - Description of Exception

releaseResource

void releaseResource(Object pr)
                     throws Exception
releaseResource make sure that any cleanup needed for this entry is done

Parameters:
pr - The Object to release
Throws:
Exception - Description of Exception

getValidatingMCFactory

ValidatingManagedConnectionFactory getValidatingMCFactory()
Returns:
the ValidatingManagedConnectionFactory if the RA implements it


Copyright © 2010 OW2 Consortium. All Rights Reserved.