xmlBlaster 2.2.0 API

org.xmlBlaster.test.classtest
Class TestPoolManager.TestPool

java.lang.Object
  extended by org.xmlBlaster.test.classtest.TestPoolManager.TestPool
All Implemented Interfaces:
I_PoolManager
Enclosing class:
TestPoolManager

 class TestPoolManager.TestPool
extends java.lang.Object
implements I_PoolManager

This class does the resource pooling for TestResource, with the help of PoolManager


Field Summary
private  int counter
           
(package private)  PoolManager poolManager
           
 
Constructor Summary
TestPoolManager.TestPool(int maxInstances, long busyToIdle, long idleToErase)
           
 
Method Summary
 void busyToIdle(java.lang.Object resource)
          Is invoked on state transition from 'busy' to 'idle'.
 void idleToBusy(java.lang.Object resource)
          Is invoked on state transition from 'idle' to 'busy'.
(package private)  void release(TestPoolManager.TestResource rr)
           
(package private)  TestPoolManager.TestResource reserve()
           
(package private)  TestPoolManager.TestResource reserve(java.lang.String instanceId)
           
 java.lang.Object toCreate(java.lang.String instanceId)
          Is invoked when a new resource is needed.
 void toErased(java.lang.Object resource)
          Is invoked when a resource is destroyed explicitly or by timeout.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

counter

private int counter

poolManager

PoolManager poolManager
Constructor Detail

TestPoolManager.TestPool

TestPoolManager.TestPool(int maxInstances,
                         long busyToIdle,
                         long idleToErase)
Method Detail

idleToBusy

public void idleToBusy(java.lang.Object resource)
Description copied from interface: I_PoolManager
Is invoked on state transition from 'idle' to 'busy'.

You can code here some specific behavior.

Specified by:
idleToBusy in interface I_PoolManager

busyToIdle

public void busyToIdle(java.lang.Object resource)
Description copied from interface: I_PoolManager
Is invoked on state transition from 'busy' to 'idle'.

You can code here some specific behavior.

Specified by:
busyToIdle in interface I_PoolManager

toCreate

public java.lang.Object toCreate(java.lang.String instanceId)
                          throws XmlBlasterException
Description copied from interface: I_PoolManager
Is invoked when a new resource is needed.

You need to create a new resource instance (e.g. a JDBC connection) and return it.

Specified by:
toCreate in interface I_PoolManager
Returns:
A new Resource which will be managed
Throws:
XmlBlasterException

toErased

public void toErased(java.lang.Object resource)
Description copied from interface: I_PoolManager
Is invoked when a resource is destroyed explicitly or by timeout.

You may want to do some specific coding here, for example logout from a JDBC connection.

Specified by:
toErased in interface I_PoolManager

reserve

TestPoolManager.TestResource reserve()

reserve

TestPoolManager.TestResource reserve(java.lang.String instanceId)

release

void release(TestPoolManager.TestResource rr)

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.