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, writeReplacecopyFrom, equals, getBeanFactory, getTargetBeanName, getTargetClass, hashCode, isStatic, releaseTarget, setTargetBeanName, setTargetClass, toStringcloneSE, finalizeSE, getClassSE, notifySE, notifyAllSE, waitSE, waitSE, waitSEpublic ObjectSE getTarget() throws BeansException
TargetSource の getTarget null BeansExceptionpublic void destroy()
public int getInvocationCount()
ThreadLocalTargetSourceStatsThreadLocalTargetSourceStats の getInvocationCount public int getHitCount()
ThreadLocalTargetSourceStatsThreadLocalTargetSourceStats の getHitCount public int getObjectCount()
ThreadLocalTargetSourceStatsThreadLocalTargetSourceStats の getObjectCount public IntroductionAdvisor getStatsMixin()