org.apache.commons.pool.impl
クラス SoftReferenceObjectPool

java.lang.Object
  拡張org.apache.commons.pool.BaseObjectPool
      拡張org.apache.commons.pool.impl.SoftReferenceObjectPool
すべての実装インタフェース:
ObjectPool

public class SoftReferenceObjectPool
extends BaseObjectPool
implements ObjectPool

SoftReference をベースとした ObjectPool です。

バージョン:
$Revision: 1.1.1.1 $ $Date: 2004/02/13 10:02:01 $
作成者:
Rodney Waldhoff
翻訳者:
日置 聡

コンストラクタの概要
SoftReferenceObjectPool()
           
SoftReferenceObjectPool(PoolableObjectFactory factory)
           
SoftReferenceObjectPool(PoolableObjectFactory factory, int initSize)
           
 
メソッドの概要
 Object borrowObject()
          プールからインスタンスを取り出します。
 void clear()
          プール内にある使用されていないオブジェクトを削除し、関連するリソースを開放します(オプショナルな処理)。
 void close()
          このプールを閉じ、関連する全てのリソースを開放します。
 int getNumActive()
          現在プールから貸し出されているインスタンスの数を返します(オプショナルな処理)。
 int getNumIdle()
          Returns an approximation not less than the of the number of idle instances in the pool.
 void returnObject(Object obj)
          プールにインスタンスを返します。
 void setFactory(PoolableObjectFactory factory)
          新たなインスタンスを生成するために使用する factory を設定します(オプショナルな処理)。
 
クラス java.lang.Object から継承したメソッド
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

SoftReferenceObjectPool

public SoftReferenceObjectPool()

SoftReferenceObjectPool

public SoftReferenceObjectPool(PoolableObjectFactory factory)

SoftReferenceObjectPool

public SoftReferenceObjectPool(PoolableObjectFactory factory,
                               int initSize)
                        throws Exception
メソッドの詳細

borrowObject

public Object borrowObject()
                    throws Exception
インタフェース ObjectPool の記述:
プールからインスタンスを取り出します。 プールからインスタンスを取得したクライアントは必ず returnObject または実装クラスやサブインターフェイスのそれと関連するメソッドを使用して インスタンスをプールに返さなくてはなりません。

プール内のインスタンスが空の場合のこのメソッドの振る舞いは明示されません (各実装クラスで明示されるでしょう)。

定義:
インタフェース ObjectPool 内の borrowObject
定義:
クラス BaseObjectPool 内の borrowObject
例外:
Exception

clear

public void clear()
インタフェース ObjectPool の記述:
プール内にある使用されていないオブジェクトを削除し、関連するリソースを開放します(オプショナルな処理)。

定義:
インタフェース ObjectPool 内の clear
オーバーライド:
クラス BaseObjectPool 内の clear

close

public void close()
           throws Exception
インタフェース ObjectPool の記述:
このプールを閉じ、関連する全てのリソースを開放します。

定義:
インタフェース ObjectPool 内の close
オーバーライド:
クラス BaseObjectPool 内の close
例外:
Exception

getNumActive

public int getNumActive()
インタフェース ObjectPool の記述:
現在プールから貸し出されているインスタンスの数を返します(オプショナルな処理)。

定義:
インタフェース ObjectPool 内の getNumActive
オーバーライド:
クラス BaseObjectPool 内の getNumActive

getNumIdle

public int getNumIdle()
Returns an approximation not less than the of the number of idle instances in the pool.

定義:
インタフェース ObjectPool 内の getNumIdle
オーバーライド:
クラス BaseObjectPool 内の getNumIdle

returnObject

public void returnObject(Object obj)
                  throws Exception
インタフェース ObjectPool の記述:
プールにインスタンスを返します。 プールに返される obj は必ず borrowObject または実装クラスやサブインターフェイスのそれと関連するメソッドを使用して 取得されたインスタンスでなくてはなりません。

定義:
インタフェース ObjectPool 内の returnObject
定義:
クラス BaseObjectPool 内の returnObject
例外:
Exception

setFactory

public void setFactory(PoolableObjectFactory factory)
                throws IllegalStateException
インタフェース ObjectPool の記述:
新たなインスタンスを生成するために使用する factory を設定します(オプショナルな処理)。

定義:
インタフェース ObjectPool 内の setFactory
オーバーライド:
クラス BaseObjectPool 内の setFactory
例外:
IllegalStateException


このドキュメントは、Ja-Jakartaにより訳されました。 コメントがある場合は report@jajakarta.orgまでお願いします。
Translated into Japanese by jajakarta.org. The original page is here.
Copyright (c) 2002-2003 - Apache Software Foundation