org.objectweb.jonas.resource.pool.api
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 |
java.lang.Object |
createResource(java.lang.Object hints)
createResource creates a new Object. |
boolean |
matchResource(java.lang.Object pr,
java.lang.Object hints)
matchResource tests if a given resource of a Pool matches with
the hints passed with the Pool getResource method. |
java.lang.Object |
matchResource(java.util.Set res,
java.lang.Object hints)
matchResource tests if a given resource of a Pool matches with
the hints passed with the Pool getResource method. |
createResource
public java.lang.Object createResource(java.lang.Object hints)
throws java.lang.Exception
- createResource creates a new Object.
- Parameters:
hints
- The "properties" that the created Object should
conform to.- Returns:
- The created Object.
matchResource
public boolean matchResource(java.lang.Object pr,
java.lang.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
public java.lang.Object matchResource(java.util.Set res,
java.lang.Object hints)
throws java.lang.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:
java.lang.Exception
- Description of Exception