Top Inners Fields Constructors Methods
com.mchange.v1.util

public abstract Class AbstractResourcePool

extends Object
Class Inheritance
Known Direct Subclasses
com.mchange.v1.db.sql.ConnectionBundlePoolImpl
Imports
java.util.List, .LinkedList, .Set, .HashSet, .Iterator

Deprecated

use com.mchange.v1.resourcepool.AbstractResourcePool

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class
protected class

Field Summary

Modifier and TypeField and Description
pack-priv int
pack-priv boolean
private static final boolean
pack-priv int
pack-priv boolean
pack-priv Set<E>
pack-priv int
pack-priv int
pack-priv RunnableQueue
rq

Deprecated as a consequence of RunnableQueue being deprecated.
private static RunnableQueue
sharedQueue

Deprecated as a consequence of RunnableQueue being deprecated.
pack-priv int
private static final boolean
pack-priv List<E>

Constructor Summary

AccessConstructor and Description
protected
AbstractResourcePool(int start, int max, int inc)

protected
AbstractResourcePool(int start, int max, int inc, RunnableQueue rq)
Deprecated as a consequence of RunnableQueue being deprecated.

Method Summary

Modifier and TypeMethod and Description
private void
protected abstract Object
private void
private void
awaitAvailable(long timeout)

protected synchronized void
protected Object
protected synchronized Object
checkoutResource(long timeout)

protected synchronized void
protected abstract void
private void
protected synchronized void
init()

We defer actual acquisition of the resources to a method outside the constructor because subclasses may need to do prep work in their own constructor before resource acquisition can occur.

protected synchronized void
private void
protected abstract void
refurbishResource(Object resc)

Called on checkout!

private void
private void
private synchronized void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

acq_attempt_delayback to summary
pack-priv int acq_attempt_delay
brokenback to summary
pack-priv boolean broken
DEBUGback to summary
private static final boolean DEBUG
incback to summary
pack-priv int inc
inittedback to summary
pack-priv boolean initted
managedback to summary
pack-priv Set<E> managed
maxback to summary
pack-priv int max
num_acq_attemptsback to summary
pack-priv int num_acq_attempts
rqback to summary
pack-priv RunnableQueue rq

Deprecated

as a consequence of RunnableQueue being deprecated. See corresponding docs for further information.

sharedQueueback to summary
private static RunnableQueue sharedQueue

Deprecated

as a consequence of RunnableQueue being deprecated. See corresponding docs for further information.

startback to summary
pack-priv int start
TRACEback to summary
private static final boolean TRACE
unusedback to summary
pack-priv List<E> unused

Constructor Detail

AbstractResourcePoolback to summary
protected AbstractResourcePool(int start, int max, int inc)
AbstractResourcePoolback to summary
protected AbstractResourcePool(int start, int max, int inc, RunnableQueue rq)

Deprecated

as a consequence of RunnableQueue being deprecated. See corresponding docs for further information.

Method Detail

acquireMoreback to summary
private void acquireMore() throws Exception
acquireResourceback to summary
protected abstract Object acquireResource() throws Exception
assimilateResourceback to summary
private void assimilateResource() throws Exception
awaitAvailableback to summary
private void awaitAvailable(long timeout) throws InterruptedException, TimeoutException
checkinResourceback to summary
protected synchronized void checkinResource(Object resc) throws BrokenObjectException
checkoutResourceback to summary
protected Object checkoutResource() throws BrokenObjectException, InterruptedException, Exception
checkoutResourceback to summary
protected synchronized Object checkoutResource(long timeout) throws BrokenObjectException, InterruptedException, TimeoutException, Exception
closeback to summary
protected synchronized void close() throws Exception
destroyResourceback to summary
protected abstract void destroyResource(Object resc) throws Exception
ensureNotBrokenback to summary
private void ensureNotBroken() throws BrokenObjectException
initback to summary
protected synchronized void init() throws Exception

We defer actual acquisition of the resources to a method outside the constructor because subclasses may need to do prep work in their own constructor before resource acquisition can occur. This method will usually be called at the end of a subclasses constructor.

markBadback to summary
protected synchronized void markBad(Object resc) throws Exception
postAcquireMoreback to summary
private void postAcquireMore() throws InterruptedException
refurbishResourceback to summary
protected abstract void refurbishResource(Object resc) throws BrokenObjectException

Called on checkout!

removeResourceback to summary
private void removeResource(Object resc) throws Exception
traceback to summary
private void trace()
unexpectedBreakback to summary
private synchronized void unexpectedBreak()
com.mchange.v1.util back to summary

pack-priv Class AbstractResourcePool.AcquireTask

extends Object
implements Runnable
Class Inheritance
All Implemented Interfaces
java.lang.Runnable

Field Summary

Modifier and TypeField and Description
pack-priv boolean

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
run()

Implements java.lang.Runnable.run.

Runs this operation.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

successback to summary
pack-priv boolean success

Constructor Detail

AcquireTaskback to summary
pack-priv AcquireTask()

Method Detail

runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

com.mchange.v1.util back to summary

protected Class AbstractResourcePool.TimeoutException

extends Exception
Class Inheritance

Constructor Summary

AccessConstructor and Description
protected

Constructor Detail

TimeoutExceptionback to summary
protected TimeoutException()