org.ow2.util.pool.impl.enhanced.deprecated
Interface PoolFactory<InstanceType,Clue>

Type Parameters:
InstanceType - the type of the object that are managed by the pool (could be EasyBeansSLSB, etc.)
Clue - a clue which is given to match an instance in the pool

Deprecated.

@Deprecated
public interface PoolFactory<InstanceType,Clue>

Allows to call specific methods for each implementation of the pool for each lifecycle on an object.

Author:
Florent Benoit

Method Summary
 void activate(InstanceType object, Clue clue)
          Deprecated. This method is called just before an instance is getted.
 InstanceType create(Clue clue)
          Deprecated. Creates an instance with the given hint.
 boolean isMatching(InstanceType object, Clue clue)
          Deprecated. Checks if the given object with the given clue is matching.
 void passivate(InstanceType object)
          Deprecated. This method is called while an instance is put in pool.
 void remove(InstanceType object)
          Deprecated. Callback called when object is gonna be removed.
 void setClue(InstanceType object, Clue clue)
          Deprecated. Change item clue.
 boolean validate(InstanceType instance)
          Deprecated. Validate an instance by giving some statistics.
 

Method Detail

create

InstanceType create(Clue clue)
                    throws org.ow2.util.pool.api.PoolException
Deprecated. 
Creates an instance with the given hint.

Parameters:
clue - always null with this implementation.
Returns:
the created instance.
Throws:
org.ow2.util.pool.api.PoolException - if instance cannot be created.

isMatching

boolean isMatching(InstanceType object,
                   Clue clue)
Deprecated. 
Checks if the given object with the given clue is matching.

Parameters:
object - given object against which the check should be done.
clue - the object used as clue to check the matching.
Returns:
true if it is matching, else false.

setClue

void setClue(InstanceType object,
             Clue clue)
Deprecated. 
Change item clue.

Parameters:
object - given object against which the check should be done.
clue - the object used as clue to check the matching.

remove

void remove(InstanceType object)
Deprecated. 
Callback called when object is gonna be removed.

Parameters:
object - that is being removed from the pool.

activate

void activate(InstanceType object,
              Clue clue)
Deprecated. 
This method is called just before an instance is getted. You should reinit fields you set to null and saved to file system for example.

Parameters:
object - the pool item which will become busy
clue - the clue used to get this instance

passivate

void passivate(InstanceType object)
Deprecated. 
This method is called while an instance is put in pool. You may back up and set to null some field.

Parameters:
object - the pool item which will become available

validate

boolean validate(InstanceType instance)
Deprecated. 
Validate an instance by giving some statistics.

Parameters:
instance - the instance to validate
Returns:
true if the element is valid, else false.


Copyright © 2007-2009 OW2 Consortium. All Rights Reserved.