com.mongodb
Class DBPortPool

java.lang.Object
  extended by com.mongodb.util.SimplePool<DBPort>
      extended by com.mongodb.DBPortPool
All Implemented Interfaces:
DynamicMBean

public class DBPortPool
extends SimplePool<DBPort>


Nested Class Summary
static class DBPortPool.ConnectionWaitTimeOut
           
static class DBPortPool.NoMoreConnection
           
static class DBPortPool.SemaphoresOut
           
 
Field Summary
 
Fields inherited from class com.mongodb.util.SimplePool
_availSafe, _debug, _maxToKeep, _maxTotal, _name, _trackLeaks
 
Method Summary
 void cleanup(DBPort p)
          override this if you need to do any cleanup
protected  DBPort createNew()
          Creates a new object of this pool's type.
 DBPort get()
          Gets an object from the pool - will block if none are available
 ServerAddress getServerAddress()
           
protected  long memSize(DBPort p)
           
 boolean ok(DBPort t)
          callback to determine if an object is ok to be added back to the pool or used will be called when something is put back into the queue and when it comes out
protected  int pick(int iThink, boolean couldCreate)
           
 
Methods inherited from class com.mongodb.util.SimplePool
available, clear, done, everCreated, get, getAll, getAttribute, getAttributes, getMBeanInfo, inUse, invoke, maxToKeep, remove, setAttribute, setAttributes, toString, total
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

memSize

protected long memSize(DBPort p)

pick

protected int pick(int iThink,
                   boolean couldCreate)
Overrides:
pick in class SimplePool<DBPort>
Returns:
>= 0 the one to use, -1 don't use any

get

public DBPort get()
Description copied from class: SimplePool
Gets an object from the pool - will block if none are available

Overrides:
get in class SimplePool<DBPort>
Returns:
An object from the pool

cleanup

public void cleanup(DBPort p)
Description copied from class: SimplePool
override this if you need to do any cleanup

Overrides:
cleanup in class SimplePool<DBPort>

ok

public boolean ok(DBPort t)
Description copied from class: SimplePool
callback to determine if an object is ok to be added back to the pool or used will be called when something is put back into the queue and when it comes out

Overrides:
ok in class SimplePool<DBPort>
Returns:
true if the object is ok to be added back to pool

createNew

protected DBPort createNew()
Description copied from class: SimplePool
Creates a new object of this pool's type.

Specified by:
createNew in class SimplePool<DBPort>
Returns:
the new object.

getServerAddress

public ServerAddress getServerAddress()