public class ThreadLocalTargetSource extends AbstractPrototypeBasedTargetSource implements ThreadLocalTargetSourceStats, DisposableBean
TargetSource
は、すべてのスレッドが独自のターゲットのコピーを持つスレッドモデルを使用します。ターゲットの競合はありません。ターゲットオブジェクトの作成は、実行中のサーバー上で最小限に抑えられます。アプリケーションコードは通常のプールに関して書かれています。呼び出し側は、異なるスレッドでの呼び出しで同じインスタンスを処理することを想定できません。ただし、たとえば、1 人の呼び出し元が AOP プロキシで繰り返し呼び出しを行う場合など、単一スレッドの操作中は状態を信頼できます。
スレッドバインドオブジェクトのクリーンアップは、BeanFactory 破棄時に実行され、使用可能な場合は DisposableBean.destroy()
メソッドを呼び出します。アプリケーションが実際にシャットダウンするまで、多くのスレッドバインドオブジェクトが存在する可能性があることに注意してください。
ThreadLocalTargetSourceStats
, DisposableBean.destroy()
, 直列化された形式 logger
コンストラクターと説明 |
---|
ThreadLocalTargetSource() |
修飾子と型 | メソッドと説明 |
---|---|
void | destroy() 必要に応じてターゲットを廃棄します。ThreadLocal をクリアします。 |
int | getHitCount() スレッドバウンドオブジェクトによって満たされたヒットの数を返します。 |
int | getInvocationCount() クライアント呼び出しの数を返します。 |
int | getObjectCount() 作成されたスレッドバインドオブジェクトの数を返します。 |
IntroductionAdvisor | getStatsMixin() AOP プロキシを ThreadLocalInvokerStats にキャストできるようにする導入アドバイザー Mixin を返します。 |
ObjectSE | getTarget() 抽象 getTarget() メソッドの実装。 |
destroyPrototypeInstance, newPrototypeInstance, setBeanFactory, writeReplace
copyFrom, equals, getBeanFactory, getTargetBeanName, getTargetClass, hashCode, isStatic, releaseTarget, setTargetBeanName, setTargetClass, toString
cloneSE, finalizeSE, getClassSE, notifySE, notifyAllSE, waitSE, waitSE, waitSE
public ObjectSE getTarget() throws BeansException
TargetSource
の getTarget
null
BeansException
public void destroy()
public int getInvocationCount()
ThreadLocalTargetSourceStats
ThreadLocalTargetSourceStats
の getInvocationCount
public int getHitCount()
ThreadLocalTargetSourceStats
ThreadLocalTargetSourceStats
の getHitCount
public int getObjectCount()
ThreadLocalTargetSourceStats
ThreadLocalTargetSourceStats
の getObjectCount
public IntroductionAdvisor getStatsMixin()