org.apache.commons.pool
クラス BaseObjectPool

java.lang.Object
  拡張org.apache.commons.pool.BaseObjectPool
すべての実装インタフェース:
ObjectPool
直系の既知のサブクラス:
GenericObjectPool, SoftReferenceObjectPool, StackObjectPool

public abstract class BaseObjectPool
extends Object
implements ObjectPool

シンプルな ObjectPool の基底となる実装です。 全てのオプショナルな処理は UnsupportedOperationException を投げるように実装されています。

A simple base impementation of {@link ObjectPool}. All optional operations are implemented as throwing {@link UnsupportedOperationException}.

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

コンストラクタの概要
BaseObjectPool()
           
 
メソッドの概要
abstract  Object borrowObject()
          プールからインスタンスを取り出します。
 void clear()
          この基底実装ではサポートされません。
 void close()
          この基底実装では何も行いません。
 int getNumActive()
          この基底実装ではサポートされません。
 int getNumIdle()
          この基底実装ではサポートされません。
abstract  void returnObject(Object obj)
          プールにインスタンスを返します。
 void setFactory(PoolableObjectFactory factory)
          この基底実装ではサポートされません。
 
クラス java.lang.Object から継承したメソッド
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

BaseObjectPool

public BaseObjectPool()
メソッドの詳細

borrowObject

public abstract 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
戻り値:
プールから取り出されたインスタンス
an instance from my pool.
例外:
Exception

clear

public void clear()
           throws Exception,
                  UnsupportedOperationException
この基底実装ではサポートされません。
Not supported in this base implementation.

定義:
インタフェース ObjectPool 内の clear
例外:
UnsupportedOperationException - この実装がこの処理をサポートしない場合
if this implementation does not support the operation
Exception

close

public void close()
           throws Exception
この基底実装では何も行いません。
Does nothing this base implementation.

定義:
インタフェース ObjectPool 内の close
例外:
Exception

getNumActive

public int getNumActive()
                 throws UnsupportedOperationException
この基底実装ではサポートされません。
Not supported in this base implementation.

定義:
インタフェース ObjectPool 内の getNumActive
戻り値:
現在プールから貸し出されているインスタンスの数
the number of instances currently borrowed in my pool
例外:
UnsupportedOperationException - この実装がこの処理をサポートしない場合
if this implementation does not support the operation

getNumIdle

public int getNumIdle()
               throws UnsupportedOperationException
この基底実装ではサポートされません。
Not supported in this base implementation.

定義:
インタフェース ObjectPool 内の getNumIdle
戻り値:
プール内にある使用されていないインスタンスの数
the number of instances currently idle in my pool
例外:
UnsupportedOperationException - この実装がこの処理をサポートしない場合
if this implementation does not support the operation

returnObject

public abstract 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
パラメータ:
obj - プールに返す ObjectPool.borrowObject() にて取得されたインスタンス
a {@link #borrowObject() borrowed} instance to be returned.
例外:
Exception

setFactory

public void setFactory(PoolableObjectFactory factory)
                throws IllegalStateException,
                       UnsupportedOperationException
この基底実装ではサポートされません。
Not supported in this base implementation.

定義:
インタフェース ObjectPool 内の setFactory
パラメータ:
factory - 新たなインスタンスを生成するために使用する PoolableObjectFactory
the {@link PoolableObjectFactory} I use to create new instances.
例外:
IllegalStateException - ファクトリを設定できる状態でない場合
IllegalStateException when the factory cannot be set at this time
UnsupportedOperationException - この実装がこの処理をサポートしない場合
if this implementation does not support the operation


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