Package nablarch.integration.micrometer
Class MeterRegistryFactory<T extends io.micrometer.core.instrument.MeterRegistry>
java.lang.Object
nablarch.integration.micrometer.MeterRegistryFactory<T>
- Type Parameters:
- T- サブクラスで生成する具体的な- MeterRegistryの型
- All Implemented Interfaces:
- ComponentFactory<T>
- Direct Known Subclasses:
- CloudWatchMeterRegistryFactory,- DatadogMeterRegistryFactory,- GlobalMeterRegistryFactory,- LoggingMeterRegistryFactory,- OtlpMeterRegistryFactory,- SimpleMeterRegistryFactory,- StatsdMeterRegistryFactory
public abstract class MeterRegistryFactory<T extends io.micrometer.core.instrument.MeterRegistry>
extends Object
implements ComponentFactory<T>
MeterRegistryのコンポーネント生成に共通する処理をまとめた抽象クラス。- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected ApplicationDisposer廃棄処理を行うインタフェース。protected MeterBinderListProvider生成したMeterRegistryに適用するMeterBinderリストのプロバイダ。protected String設定値のプレフィックス。すべてのメトリクスに共通で設定するタグ。protected String設定ファイルのパス。
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected abstract TcreateMeterRegistry(MicrometerConfiguration micrometerConfiguration) MeterRegistryのインスタンスを生成する。protected TComponentFactory.createObject()の実処理を行うメソッド。voidsetApplicationDisposer(ApplicationDisposer applicationDisposer) ApplicationDisposerを設定する。voidsetMeterBinderListProvider(MeterBinderListProvider meterBinderListProvider) MeterBinderListProviderを設定する。voidプレフィックスを設定する。voidすべてのメトリクスに共通で設定するタグを指定する。voidsetXmlConfigPath(String xmlConfigPath) XML設定ファイルのパスを設定する。Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface nablarch.core.repository.di.ComponentFactorycreateObject
- 
Field Details- 
prefix設定値のプレフィックス。
- 
xmlConfigPath設定ファイルのパス。未設定の場合に読み込まれるデフォルトのパスについては MicrometerConfigurationを参照。
- 
meterBinderListProvider生成したMeterRegistryに適用するMeterBinderリストのプロバイダ。
- 
tagsすべてのメトリクスに共通で設定するタグ。
- 
applicationDisposer廃棄処理を行うインタフェース。
 
- 
- 
Constructor Details- 
MeterRegistryFactorypublic MeterRegistryFactory()
 
- 
- 
Method Details- 
doCreateObjectComponentFactory.createObject()の実処理を行うメソッド。サブクラスは、本メソッドを使って createObject()を次のように実装する。@Override public SimpleMeterRegistry createObject() { return doCreateObject(); }これは、 createObject()の戻り値の型が総称型だった場合、 DIコンテナがコンポーネントの具象型を特定できないことに起因する。
 この問題は、上述のようにサブクラスでcreateObject()の戻り値の型を具象型として宣言することで回避できる。
 一方で、コンポーネントを作成するロジック自体はどのMeterRegistryでも共通なので、 コンポーネント作成処理を共通化するために、このメソッドが用意されている。- Returns:
- 作成された MeterRegistryオブジェクト
 
- 
createMeterRegistryMeterRegistryのインスタンスを生成する。- Parameters:
- micrometerConfiguration- Micrometerの設定
- Returns:
- 生成した MeterRegistryのインスタンス
 
- 
setPrefixプレフィックスを設定する。- Parameters:
- prefix- プレフィックス
 
- 
setXmlConfigPathXML設定ファイルのパスを設定する。- Parameters:
- xmlConfigPath- XML設定ファイルのパス
 
- 
setMeterBinderListProviderMeterBinderListProviderを設定する。- Parameters:
- meterBinderListProvider-- MeterBinderListProvider
 
- 
setTagsすべてのメトリクスに共通で設定するタグを指定する。- Parameters:
- tags- すべてのメトリクスに共通で設定するタグ
 
- 
setApplicationDisposerApplicationDisposerを設定する。- Parameters:
- applicationDisposer-- ApplicationDisposer
 
 
-