public class

DBPortPool

extends SimplePool<T>
java.lang.Object
   ↳ com.mongodb.util.SimplePool<T>
     ↳ com.mongodb.DBPortPool

Summary

Nested Classes
class DBPortPool.ConnectionWaitTimeOut  
class DBPortPool.NoMoreConnection  
class DBPortPool.SemaphoresOut  
[Expand]
Inherited Fields
From class com.mongodb.util.SimplePool
Public Methods
void cleanup(DBPort p)
override this if you need to do any cleanup
DBPort get()
Gets an object from the pool - will block if none are available
ServerAddress getServerAddress()
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 Methods
DBPort createNew()
Creates a new object of this pool's type.
long memSize(DBPort p)
int pick(int iThink, boolean couldCreate)
[Expand]
Inherited Methods
From class com.mongodb.util.SimplePool
From class java.lang.Object
From interface javax.management.DynamicMBean

Public Methods

public void cleanup (DBPort p)

override this if you need to do any cleanup

public DBPort get ()

Gets an object from the pool - will block if none are available

Returns
  • An object from the pool

public ServerAddress getServerAddress ()

public 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

Returns
  • true if the object is ok to be added back to pool

Protected Methods

protected DBPort createNew ()

Creates a new object of this pool's type.

Returns
  • the new object.

protected long memSize (DBPort p)

protected int pick (int iThink, boolean couldCreate)

Returns
  • >= 0 the one to use, -1 don't use any