org.geotools.arcsde.pool
Class SessionPool.SeConnectionFactory

Object
  extended by BasePoolableObjectFactory
      extended by SessionPool.SeConnectionFactory
All Implemented Interfaces:
PoolableObjectFactory
Enclosing class:
SessionPool

protected final class SessionPool.SeConnectionFactory
extends BasePoolableObjectFactory

PoolableObjectFactory intended to be used by a Jakarta's commons-pool objects pool, that provides ArcSDE's SeConnections.

Author:
Gabriel Roldan, Axios Engineering

Constructor Summary
SessionPool.SeConnectionFactory(ArcSDEConnectionConfig config)
          Creates a new SeConnectionFactory object.
 
Method Summary
 void activateObject(Object obj)
          is invoked on every instance before it is returned from the pool.
 void destroyObject(Object obj)
          is invoked on every instance when it is being "dropped" from the pool (whether due to the response from validateObject, or for reasons specific to the pool implementation.)
 Object makeObject()
          Called whenever a new instance is needed.
 void passivateObject(Object obj)
           
 boolean validateObject(Object obj)
          is invoked in an implementation-specific fashion to determine if an instance is still valid to be returned by the pool.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionPool.SeConnectionFactory

public SessionPool.SeConnectionFactory(ArcSDEConnectionConfig config)
Creates a new SeConnectionFactory object.

Parameters:
config - DOCUMENT ME!
Method Detail

makeObject

public Object makeObject()
                  throws IOException
Called whenever a new instance is needed.

Specified by:
makeObject in interface PoolableObjectFactory
Specified by:
makeObject in class BasePoolableObjectFactory
Returns:
a newly created SeConnection
Throws:
SeException - if the connection can't be created
IOException

activateObject

public void activateObject(Object obj)
is invoked on every instance before it is returned from the pool.

Specified by:
activateObject in interface PoolableObjectFactory
Overrides:
activateObject in class BasePoolableObjectFactory
Parameters:
obj -

passivateObject

public void passivateObject(Object obj)
Specified by:
passivateObject in interface PoolableObjectFactory
Overrides:
passivateObject in class BasePoolableObjectFactory

validateObject

public boolean validateObject(Object obj)
is invoked in an implementation-specific fashion to determine if an instance is still valid to be returned by the pool. It will only be invoked on an "activated" instance.

Specified by:
validateObject in interface PoolableObjectFactory
Overrides:
validateObject in class BasePoolableObjectFactory
Parameters:
an - instance of Session maintained by this pool.
Returns:
true if the connection is still alive and operative (checked by asking its user name), false otherwise.

destroyObject

public void destroyObject(Object obj)
is invoked on every instance when it is being "dropped" from the pool (whether due to the response from validateObject, or for reasons specific to the pool implementation.)

Specified by:
destroyObject in interface PoolableObjectFactory
Overrides:
destroyObject in class BasePoolableObjectFactory
Parameters:
obj - an instance of Session maintained by this pool.


Copyright © 1996-2009 Geotools. All Rights Reserved.