org.restlet.engine.connector
Class ConnectionPool<T extends Connector>

java.lang.Object
  extended by org.restlet.engine.util.Pool<Connection<T>>
      extended by org.restlet.engine.connector.ConnectionPool<T>

public class ConnectionPool<T extends Connector>
extends Pool<Connection<T>>

A connection pool to prevent to recreation of heavy byte buffers.

Author:
Jerome Louvel

Constructor Summary
ConnectionPool(ConnectionHelper<T> helper, int initialSize)
          Constructor.
 
Method Summary
protected  void clear(Connection<T> connection)
          Clears the given object when it is checked in the pool.
protected  Connection<T> createObject()
          Creates a new reusable object.
 
Methods inherited from class org.restlet.engine.util.Pool
checkin, checkout, clear, createStore, getStore, preCreate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionPool

public ConnectionPool(ConnectionHelper<T> helper,
                      int initialSize)
Constructor.

Parameters:
helper - The parent helper.
initialSize - The initial pool size.
Method Detail

clear

protected void clear(Connection<T> connection)
Description copied from class: Pool
Clears the given object when it is checked in the pool. Does nothing by default.

Overrides:
clear in class Pool<Connection<T extends Connector>>
Parameters:
connection - The object to clear.

createObject

protected Connection<T> createObject()
Description copied from class: Pool
Creates a new reusable object.

Specified by:
createObject in class Pool<Connection<T extends Connector>>
Returns:
A new reusable object.


Copyright © 2005-2013 Restlet.