パッケージ org.springframework.boot

クラス DefaultBootstrapContext

java.lang.ObjectSE
org.springframework.boot.DefaultBootstrapContext
実装されたすべてのインターフェース:
BootstrapContextBootstrapRegistryConfigurableBootstrapContext

public class DefaultBootstrapContext extends ObjectSE implements ConfigurableBootstrapContext
デフォルトの ConfigurableBootstrapContext 実装。
導入:
2.4.0
作成者:
Phillip Webb
  • コンストラクターの詳細

    • DefaultBootstrapContext

      public DefaultBootstrapContext()
  • メソッドの詳細

    • register

      public <T> void register(ClassSE<T> type, BootstrapRegistry.InstanceSupplier<T> instanceSupplier)
      インターフェースからコピーされた説明: BootstrapRegistry
      特定の型をレジストリに登録します。指定された型がすでに登録されていて、singleton として取得されていない場合は、置き換えられます。
      次で指定:
      インターフェース BootstrapRegistryregister 
      型パラメーター:
      T - インスタンス型
      パラメーター:
      type - インスタンス型
      instanceSupplier - インスタンスサプライヤー
    • registerIfAbsent

      public <T> void registerIfAbsent(ClassSE<T> type, BootstrapRegistry.InstanceSupplier<T> instanceSupplier)
      インターフェースからコピーされた説明: BootstrapRegistry
      特定の型がまだ存在しない場合は、レジストリに登録します。
      次で指定:
      インターフェース BootstrapRegistryregisterIfAbsent 
      型パラメーター:
      T - インスタンス型
      パラメーター:
      type - インスタンス型
      instanceSupplier - インスタンスサプライヤー
    • isRegistered

      public <T> boolean isRegistered(ClassSE<T> type)
      インターフェースからコピーされた説明: BootstrapRegistry
      指定された型の登録が存在する場合に戻ります。
      次で指定:
      インターフェース BootstrapContextisRegistered 
      次で指定:
      インターフェース BootstrapRegistryisRegistered 
      型パラメーター:
      T - インスタンス型
      パラメーター:
      type - インスタンス型
      戻り値:
      型がすでに登録されている場合は true 
    • getRegisteredInstanceSupplier

      public <T> BootstrapRegistry.InstanceSupplier<T> getRegisteredInstanceSupplier(ClassSE<T> type)
      インターフェースからコピーされた説明: BootstrapRegistry
      指定された型の既存の BootstrapRegistry.InstanceSupplier を返します。
      次で指定:
      インターフェース BootstrapRegistrygetRegisteredInstanceSupplier 
      型パラメーター:
      T - インスタンス型
      パラメーター:
      type - インスタンス型
      戻り値:
      登録された BootstrapRegistry.InstanceSupplier または null
    • addCloseListener

      public void addCloseListener(ApplicationListener<BootstrapContextClosedEvent> listener)
      インターフェースからコピーされた説明: BootstrapRegistry
      BootstrapContext が閉じられ、ApplicationContext が準備されたときに、BootstrapContextClosedEvent で呼び出される ApplicationListener を追加します。
      次で指定:
      インターフェース BootstrapRegistryaddCloseListener 
      パラメーター:
      listener - 追加するリスナー
    • get

      public <T> T get(ClassSE<T> type) throws IllegalStateExceptionSE
      インターフェースからコピーされた説明: BootstrapContext
      型が登録されている場合は、コンテキストからインスタンスを返します。以前にアクセスされていない場合、インスタンスが作成されます。
      次で指定:
      インターフェース BootstrapContextget 
      型パラメーター:
      T - インスタンス型
      パラメーター:
      type - インスタンス型
      戻り値:
      コンテキストによって管理されるインスタンス
      例外:
      IllegalStateExceptionSE - 型が登録されていない場合
    • getOrElse

      public <T> T getOrElse(ClassSE<T> type, T other)
      インターフェースからコピーされた説明: BootstrapContext
      型が登録されている場合は、コンテキストからインスタンスを返します。以前にアクセスされていない場合、インスタンスが作成されます。
      次で指定:
      インターフェース BootstrapContextgetOrElse 
      型パラメーター:
      T - インスタンス型
      パラメーター:
      type - インスタンス型
      other - 型が登録されていない場合に使用するインスタンス
      戻り値:
      インスタンス
    • getOrElseSupply

      public <T> T getOrElseSupply(ClassSE<T> type, SupplierSE<T> other)
      インターフェースからコピーされた説明: BootstrapContext
      型が登録されている場合は、コンテキストからインスタンスを返します。以前にアクセスされていない場合、インスタンスが作成されます。
      次で指定:
      インターフェース BootstrapContextgetOrElseSupply 
      型パラメーター:
      T - インスタンス型
      パラメーター:
      type - インスタンス型
      other - 型が登録されていない場合に使用するインスタンスのサプライヤー
      戻り値:
      インスタンス
    • getOrElseThrow

      public <T, X extends ThrowableSE> T getOrElseThrow(ClassSE<T> type, SupplierSE<? extends X> exceptionSupplier) throws X
      インターフェースからコピーされた説明: BootstrapContext
      型が登録されている場合は、コンテキストからインスタンスを返します。以前にアクセスされていない場合、インスタンスが作成されます。
      次で指定:
      インターフェース BootstrapContextgetOrElseThrow 
      型パラメーター:
      T - インスタンス型
      X - 型が登録されていない場合にスローする例外
      パラメーター:
      type - インスタンス型
      exceptionSupplier - スローされる例外を返すサプライヤー
      戻り値:
      コンテキストによって管理されるインスタンス
      例外:
      X - 型が登録されていない場合
    • close

      public void close(ConfigurableApplicationContext applicationContext)
      BootstrapContext が閉じられ、ApplicationContext が準備されたときに呼び出されるメソッド。
      パラメーター:
      applicationContext - 準備されたコンテキスト