edu.vt.middleware.ldap.pool
Class AbstractLdapFactory<T extends BaseLdap>

java.lang.Object
  extended by edu.vt.middleware.ldap.pool.AbstractLdapFactory<T>
Type Parameters:
T - type of ldap object
All Implemented Interfaces:
LdapFactory<T>
Direct Known Subclasses:
DefaultLdapFactory

public abstract class AbstractLdapFactory<T extends BaseLdap>
extends Object
implements LdapFactory<T>

AbstractLdapFactory provides a basic implementation of an ldap factory.

Version:
$Revision: 1330 $ $Date: 2010-05-23 18:10:53 -0400 (Sun, 23 May 2010) $
Author:
Middleware Services

Field Summary
protected  LdapActivator<T> activator
          For activating ldap objects.
protected  org.apache.commons.logging.Log logger
          Log for this class.
protected  LdapPassivator<T> passivator
          For passivating ldap objects.
protected  LdapValidator<T> validator
          For validating ldap objects.
 
Constructor Summary
AbstractLdapFactory()
           
 
Method Summary
 boolean activate(T t)
          Prepare the supplied object for placement in the pool.
abstract  T create()
          Create a new ldap object.
abstract  void destroy(T t)
          Destroy an ldap object.
 LdapActivator<T> getLdapActivator()
          Returns the ldap activator for this factory.
 LdapPassivator<T> getLdapPassivator()
          Returns the ldap passivator for this factory.
 LdapValidator<T> getLdapValidator()
          Returns the ldap validator for this factory.
 boolean passivate(T t)
          Prepare the supplied object for removal from the pool.
 void setLdapActivator(LdapActivator<T> la)
          Sets the ldap activator for this factory.
 void setLdapPassivator(LdapPassivator<T> lp)
          Sets the ldap passivator for this factory.
 void setLdapValidator(LdapValidator<T> lv)
          Sets the ldap validator for this factory.
 boolean validate(T t)
          Verify an ldap object is still viable for use in the pool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger
Log for this class.


activator

protected LdapActivator<T extends BaseLdap> activator
For activating ldap objects.


passivator

protected LdapPassivator<T extends BaseLdap> passivator
For passivating ldap objects.


validator

protected LdapValidator<T extends BaseLdap> validator
For validating ldap objects.

Constructor Detail

AbstractLdapFactory

public AbstractLdapFactory()
Method Detail

setLdapActivator

public void setLdapActivator(LdapActivator<T> la)
Sets the ldap activator for this factory.

Parameters:
la - ldap activator

getLdapActivator

public LdapActivator<T> getLdapActivator()
Returns the ldap activator for this factory.

Returns:
ldap activator

setLdapPassivator

public void setLdapPassivator(LdapPassivator<T> lp)
Sets the ldap passivator for this factory.

Parameters:
lp - ldap passivator

getLdapPassivator

public LdapPassivator<T> getLdapPassivator()
Returns the ldap passivator for this factory.

Returns:
ldap passivator

setLdapValidator

public void setLdapValidator(LdapValidator<T> lv)
Sets the ldap validator for this factory.

Parameters:
lv - ldap validator

getLdapValidator

public LdapValidator<T> getLdapValidator()
Returns the ldap validator for this factory.

Returns:
ldap validator

create

public abstract T create()
Create a new ldap object.

Specified by:
create in interface LdapFactory<T extends BaseLdap>
Returns:
ldap object

destroy

public abstract void destroy(T t)
Destroy an ldap object.

Specified by:
destroy in interface LdapFactory<T extends BaseLdap>
Parameters:
t - ldap object

activate

public boolean activate(T t)
Prepare the supplied object for placement in the pool.

Specified by:
activate in interface LdapFactory<T extends BaseLdap>
Parameters:
t - ldap object
Returns:
whether the supplied object successfully activated

passivate

public boolean passivate(T t)
Prepare the supplied object for removal from the pool.

Specified by:
passivate in interface LdapFactory<T extends BaseLdap>
Parameters:
t - ldap object
Returns:
whether the supplied object successfully passivated

validate

public boolean validate(T t)
Verify an ldap object is still viable for use in the pool.

Specified by:
validate in interface LdapFactory<T extends BaseLdap>
Parameters:
t - ldap object
Returns:
whether the supplied object is ready for use


Copyright © 2003-2010 Virginia Tech. All Rights Reserved.