public class DefaultBootstrapContext extends ObjectSE implements ConfigurableBootstrapContext
ConfigurableBootstrapContext
実装。BootstrapRegistry.InstanceSupplier<T>, BootstrapRegistry.Scope
コンストラクターと説明 |
---|
DefaultBootstrapContext() |
修飾子と型 | メソッドと説明 |
---|---|
void | addCloseListener(ApplicationListener<BootstrapContextClosedEvent> listener) BootstrapContext が閉じられ、ApplicationContext が準備されたときに、BootstrapContextClosedEvent で呼び出される ApplicationListener を追加します。 |
void | close(ConfigurableApplicationContext applicationContext) BootstrapContext が閉じられ、ApplicationContext が準備されたときに呼び出されるメソッド。 |
<T> T | get(ClassSE<T> type) 型が登録されている場合は、コンテキストからインスタンスを返します。 |
<T> T | getOrElse(ClassSE<T> type, T other) 型が登録されている場合は、コンテキストからインスタンスを返します。 |
<T> T | getOrElseSupply(ClassSE<T> type, SupplierSE<T> other) 型が登録されている場合は、コンテキストからインスタンスを返します。 |
<T,X extends ThrowableSE> | getOrElseThrow(ClassSE<T> type, SupplierSE<? extends X> exceptionSupplier) 型が登録されている場合は、コンテキストからインスタンスを返します。 |
<T> BootstrapRegistry.InstanceSupplier<T> | getRegisteredInstanceSupplier(ClassSE<T> type) 指定された型の既存の BootstrapRegistry.InstanceSupplier を返します。 |
<T> boolean | isRegistered(ClassSE<T> type) 指定された型の登録が存在する場合に戻ります。 |
<T> void | register(ClassSE<T> type, BootstrapRegistry.InstanceSupplier<T> instanceSupplier) 特定の型をレジストリに登録します。 |
<T> void | registerIfAbsent(ClassSE<T> type, BootstrapRegistry.InstanceSupplier<T> instanceSupplier) 特定の型がまだ存在しない場合は、レジストリに登録します。 |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
public <T> void register(ClassSE<T> type, BootstrapRegistry.InstanceSupplier<T> instanceSupplier)
BootstrapRegistry
singleton
として取得されていない場合は、置き換えられます。BootstrapRegistry
の register
T
- インスタンス型 type
- インスタンス型 instanceSupplier
- インスタンスサプライヤー public <T> void registerIfAbsent(ClassSE<T> type, BootstrapRegistry.InstanceSupplier<T> instanceSupplier)
BootstrapRegistry
BootstrapRegistry
の registerIfAbsent
T
- インスタンス型 type
- インスタンス型 instanceSupplier
- インスタンスサプライヤー public <T> boolean isRegistered(ClassSE<T> type)
BootstrapRegistry
BootstrapContext
の isRegistered
BootstrapRegistry
の isRegistered
T
- インスタンス型 type
- インスタンス型 true
public <T> BootstrapRegistry.InstanceSupplier<T> getRegisteredInstanceSupplier(ClassSE<T> type)
BootstrapRegistry
BootstrapRegistry.InstanceSupplier
を返します。BootstrapRegistry
の getRegisteredInstanceSupplier
T
- インスタンス型 type
- インスタンス型 BootstrapRegistry.InstanceSupplier
または null
public void addCloseListener(ApplicationListener<BootstrapContextClosedEvent> listener)
BootstrapRegistry
BootstrapContext
が閉じられ、ApplicationContext
が準備されたときに、BootstrapContextClosedEvent
で呼び出される ApplicationListener
を追加します。BootstrapRegistry
の addCloseListener
listener
- 追加するリスナー public <T> T get(ClassSE<T> type) throws IllegalStateExceptionSE
BootstrapContext
BootstrapContext
の get
T
- インスタンス型 type
- インスタンス型 IllegalStateExceptionSE
- 型が登録されていない場合 public <T> T getOrElse(ClassSE<T> type, T other)
BootstrapContext
BootstrapContext
の getOrElse
T
- インスタンス型 type
- インスタンス型 other
- 型が登録されていない場合に使用するインスタンス public <T> T getOrElseSupply(ClassSE<T> type, SupplierSE<T> other)
BootstrapContext
BootstrapContext
の getOrElseSupply
T
- インスタンス型 type
- インスタンス型 other
- 型が登録されていない場合に使用するインスタンスのサプライヤー public <T,X extends ThrowableSE> T getOrElseThrow(ClassSE<T> type, SupplierSE<? extends X> exceptionSupplier) throws X extends ThrowableSE
BootstrapContext
BootstrapContext
の getOrElseThrow
T
- インスタンス型 X
- 型が登録されていない場合にスローする例外 type
- インスタンス型 exceptionSupplier
- スローされる例外を返すサプライヤー X
- 型が登録されていない場合 X extends ThrowableSE
public void close(ConfigurableApplicationContext applicationContext)
BootstrapContext
が閉じられ、ApplicationContext
が準備されたときに呼び出されるメソッド。applicationContext
- 準備されたコンテキスト