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 です。

A {@link java.lang.ref.SoftReference SoftReference} based {@link ObjectPool}.

バージョン:
$Revision: 1.1.1.1 $ $Date: 2004/02/13 10:02:01 $
作成者:
Rodney Waldhoff
翻訳者:
日置 聡
翻訳状況:
初稿(校正者募集中)
翻訳更新日:
2003/08/21

コンストラクタの概要
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 または実装クラスやサブインターフェイスのそれと関連するメソッドを使用して インスタンスをプールに返さなくてはなりません。
Obtain an instance from my pool. By contract, clients MUST return the borrowed instance using {@link #returnObject(java.lang.Object) returnObject} or a related method as defined in an implementation or sub-interface.

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

The behaviour of this method when the pool has been exhausted is not specified (although it may be specified by implementations).

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

clear

public void clear()
インタフェース ObjectPool の記述:
プール内にある使用されていないオブジェクトを削除し、関連するリソースを開放します(オプショナルな処理)。
Clears any objects sitting idle in the pool, releasing any associated resources (optional operation).

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

close

public void close()
           throws Exception
インタフェース ObjectPool の記述:
このプールを閉じ、関連する全てのリソースを開放します。
Close this pool, and free any resources associated with it.

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

getNumActive

public int getNumActive()
インタフェース ObjectPool の記述:
現在プールから貸し出されているインスタンスの数を返します(オプショナルな処理)。
Return the number of instances currently borrowed from my pool (optional operation).

定義:
インタフェース 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 または実装クラスやサブインターフェイスのそれと関連するメソッドを使用して 取得されたインスタンスでなくてはなりません。
Return an instance to my pool. By contract, obj MUST have been obtained using {@link #borrowObject() borrowObject} or a related method as defined in an implementation or sub-interface.

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

setFactory

public void setFactory(PoolableObjectFactory factory)
                throws IllegalStateException
インタフェース ObjectPool の記述:
新たなインスタンスを生成するために使用する factory を設定します(オプショナルな処理)。
Sets the {@link PoolableObjectFactory ファクトリ} I use to create new instances (optional operation).

定義:
インタフェース 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