com.mongodb
Class DBPortPool

java.lang.Object
  extended by com.mongodb.util.SimplePool<DBPort>
      extended by com.mongodb.DBPortPool

 class DBPortPool
extends SimplePool<DBPort>


Nested Class Summary
(package private) static class DBPortPool.Holder
           
static class DBPortPool.NoMoreConnection
           
 
Field Summary
(package private)  InetSocketAddress _addr
           
(package private)  boolean _everWorked
           
 long _maxWaitTime
           
(package private)  MongoOptions _options
           
 
Fields inherited from class com.mongodb.util.SimplePool
_debug, _maxToKeep, _maxTotal, _name, _trackLeaks
 
Constructor Summary
DBPortPool(InetSocketAddress addr, MongoOptions options)
           
 
Method Summary
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
(package private)  void gotError(Exception e)
           
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
 
Methods inherited from class com.mongodb.util.SimplePool
available, clear, done, everCreated, get, getAll, inUse, maxToKeep, total
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_maxWaitTime

public final long _maxWaitTime
See Also:
Constant Field Values

_options

final MongoOptions _options

_addr

final InetSocketAddress _addr

_everWorked

boolean _everWorked
Constructor Detail

DBPortPool

DBPortPool(InetSocketAddress addr,
           MongoOptions options)
Method Detail

memSize

protected long memSize(DBPort p)

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

gotError

void gotError(Exception e)

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 iff the object is ok to be added back to pool

createNew

protected DBPort createNew()
                    throws MongoInternalException
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.
Throws:
MongoInternalException