woolpack.factory
クラス ConcurrentMapCache<C,K,E extends java.lang.Exception>
java.lang.Object
woolpack.factory.ConcurrentMapCache<C,K,E>
- 型パラメータ:
C
- K
- E
-
- すべての実装されたインタフェース:
- Fn<C,java.lang.Object,E>
public class ConcurrentMapCache<C,K,E extends java.lang.Exception>
- extends java.lang.Object
- implements Fn<C,java.lang.Object,E>
委譲先で生成したオブジェクトをConcurrentMap
にキャッシュして返すFn
です。
ConcurrentMap.putIfAbsent(Object, Object)
を使用して返却値の一意性を保証しますが、
ひとつの返却値に対応するインスタンス生成の委譲が複数回発生する可能性があります。
- 作成者:
- nakamura
コンストラクタの概要 |
ConcurrentMapCache(Fn<? super C,? extends java.util.concurrent.ConcurrentMap<? super K,java.lang.Object>,? extends E> mapGetter,
Fn<? super C,K,? extends E> keyGetter,
Fn<? super C,?,? extends E> maker)
|
メソッドの概要 |
java.lang.Object |
exec(C c)
関数を実行します。 |
Fn<? super C,? extends K,? extends E> |
getKeyGetter()
|
Fn<? super C,?,? extends E> |
getMaker()
|
Fn<? super C,? extends java.util.concurrent.ConcurrentMap<? super K,java.lang.Object>,? extends E> |
getMapGetter()
|
void |
setKeyGetter(Fn<? super C,? extends K,? extends E> keyGetter)
|
void |
setMaker(Fn<? super C,?,? extends E> maker)
|
void |
setMapGetter(Fn<? super C,? extends java.util.concurrent.ConcurrentMap<? super K,java.lang.Object>,? extends E> mapGetter)
|
クラス java.lang.Object から継承されたメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ConcurrentMapCache
public ConcurrentMapCache(Fn<? super C,? extends java.util.concurrent.ConcurrentMap<? super K,java.lang.Object>,? extends E> mapGetter,
Fn<? super C,K,? extends E> keyGetter,
Fn<? super C,?,? extends E> maker)
exec
public java.lang.Object exec(C c)
throws E extends java.lang.Exception
- インタフェース
Fn
の記述:
- 関数を実行します。
- 定義:
- インタフェース
Fn<C,java.lang.Object,E extends java.lang.Exception>
内の exec
- パラメータ:
c
- コンテキスト役。
- 戻り値:
- 返却値。
- 例外:
E
- 例外。
E extends java.lang.Exception
getKeyGetter
public Fn<? super C,? extends K,? extends E> getKeyGetter()
setKeyGetter
public void setKeyGetter(Fn<? super C,? extends K,? extends E> keyGetter)
getMaker
public Fn<? super C,?,? extends E> getMaker()
setMaker
public void setMaker(Fn<? super C,?,? extends E> maker)
getMapGetter
public Fn<? super C,? extends java.util.concurrent.ConcurrentMap<? super K,java.lang.Object>,? extends E> getMapGetter()
setMapGetter
public void setMapGetter(Fn<? super C,? extends java.util.concurrent.ConcurrentMap<? super K,java.lang.Object>,? extends E> mapGetter)
Copyright (C) 2006-2007 Takahiro Nakamura. All rights reserved.