|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.metamatrix.common.pooling.impl.BaseResource
public abstract class BaseResource
Field Summary | |
---|---|
protected static java.lang.String |
LOG_CONTEXT
|
Constructor Summary | |
---|---|
BaseResource()
|
Method Summary | |
---|---|
protected abstract boolean |
checkIsResourceAlive()
This method is invoked when isAlive is called to determine
if the resource is operating normally. |
void |
closeResource()
This method should be invoked by the extended class to notify the pool the use of the resource is not longer needed. |
java.lang.String |
getCheckedOutBy()
Returns name of user that checked out this resource |
ResourceContainer |
getContainer()
|
void |
init(ResourceContainer resourceContainer,
java.lang.String checkedOutBy)
This method is invoked by the pool to set a reference of itself on the resource |
void |
init(java.lang.String checkedOutBy)
Called by the adapter for the resource to initialize itself and validate it should be valid resource for use. |
boolean |
isClosed()
|
boolean |
isResourceAlive()
Call isAlive to determine if the resource is operating normally. |
protected abstract void |
performInit()
Perform initialization allows for additional initialization by the implementor before the resource object is made avaialable for use. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String LOG_CONTEXT
Constructor Detail |
---|
public BaseResource()
Method Detail |
---|
public void init(java.lang.String checkedOutBy) throws ResourcePoolException
Resource
init
in interface Resource
checkedOutBy
- is the name of the user for which this resource
instance is being used
ResourcePoolException
- if not a valid resourcepublic void init(ResourceContainer resourceContainer, java.lang.String checkedOutBy) throws ResourcePoolException
resourcePool
- is the resource pool from which the resource is managed.
ResourcePoolException
- if an error occurs initializing resource.public java.lang.String getCheckedOutBy()
getCheckedOutBy
in interface Resource
public ResourceContainer getContainer()
public final void closeResource() throws ResourcePoolException
closeResource
in interface Resource
ResourcePoolConnection
- if there is an error closing the resource
ResourcePoolException
public final boolean isResourceAlive()
false
indicates the resource should not be used.
If the resource is unusable, it will be shutdown an another
instance will take its place.
isResourceAlive
in interface Resource
public final boolean isClosed() throws java.sql.SQLException
java.sql.SQLException
protected abstract void performInit() throws ResourcePoolException
ResourcePoolException
- if an error occurs initializing resource.protected abstract boolean checkIsResourceAlive()
isAlive
is called to determine
if the resource is operating normally. This logic is called
by the pool when the resource is checked in to verify its state
prior to placing it back in the pool.
A return of false
indicates the resource should not be used.
If the resource is unusable, it will be shutdown an another
instance will take its place.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |