de.knipp.rritoolkit
Class PooledPort.PoolManager

java.lang.Object
  extended by de.knipp.rritoolkit.PooledPort.PoolManager
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
PooledPort

private class PooledPort.PoolManager
extends java.lang.Object
implements java.lang.Runnable

thread that coordinates the pool, i.e. allocates and deallocates channels depending on the needs

Version:
$Revision: 14936 $
Author:
Klaus Malorny

Field Summary
private static long CHECK_POOL_PERIOD
          maximum time to check pool for closed connections
private static long CREATE_REPEAT_WAIT
          the timeout time if the maximum number of connections has been reached
private  long nextAllocate
          the point in time when the next channel may created (0 = immediately)
private  long nextRelease
          the point in time the next release test has to be performed
private static long RELEASE_PERIOD
          the release period of channels over the minimum
 
Constructor Summary
private PooledPort.PoolManager()
           
 
Method Summary
private  boolean createChannel()
          try to create a new channel and add it to the pool
private  void releaseChannel(RegistryChannel channel)
          release the given channel
 void run()
          perform the duties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nextRelease

private long nextRelease
the point in time the next release test has to be performed


nextAllocate

private long nextAllocate
the point in time when the next channel may created (0 = immediately)


RELEASE_PERIOD

private static final long RELEASE_PERIOD
the release period of channels over the minimum

See Also:
Constant Field Values

CHECK_POOL_PERIOD

private static final long CHECK_POOL_PERIOD
maximum time to check pool for closed connections

See Also:
Constant Field Values

CREATE_REPEAT_WAIT

private static final long CREATE_REPEAT_WAIT
the timeout time if the maximum number of connections has been reached

See Also:
Constant Field Values
Constructor Detail

PooledPort.PoolManager

private PooledPort.PoolManager()
Method Detail

createChannel

private boolean createChannel()
try to create a new channel and add it to the pool

Returns:
true if further preallocated channels may be created

releaseChannel

private void releaseChannel(RegistryChannel channel)
release the given channel

Parameters:
channel - the channel to release

run

public void run()
perform the duties

Specified by:
run in interface java.lang.Runnable


Copyright © 2005-2011 Knipp Medien und Kommunikation GmbH