クラス StepScope

実装されたすべてのインターフェース:
org.springframework.beans.factory.config.BeanFactoryPostProcessororg.springframework.beans.factory.config.Scopeorg.springframework.core.Ordered

public class StepScope extends BatchScopeSupport
ステップコンテキストのスコープ。このスコープ内のオブジェクトは、Spring コンテナーをオブジェクトファクトリとして使用するため、実行ステップごとにそのような Bean のインスタンスは 1 つだけです。このスコープ内のすべてのオブジェクトは <aop:scoped-proxy/> です(Bean 定義を装飾する必要はありません)。

さらに、#{..} プレースホルダーを使用して StepContext からアクセス可能な参照の遅延バインディングのサポートが提供されます。この機能を使用すると、Bean プロパティをステップまたはジョブ実行コンテキストおよびジョブパラメーターから取得できます。たとえば
 <bean id="..." class="..." scope="step">
        <property name="parent" ref="#{stepExecutionContext[helper]}" />
 </bean>

 <bean id="..." class="..." scope="step">
        <property name="name" value="#{stepExecutionContext['input.name']}" />
 </bean>

 <bean id="..." class="..." scope="step">
        <property name="name" value="#{jobParameters[input]}" />
 </bean>

 <bean id="..." class="..." scope="step">
        <property name="name" value="#{jobExecutionContext['input.stem']}.txt" />
 </bean>
 
StepContext は、標準の Bean プロパティパスを使用して参照されます(BeanWrapper に従って)。上記の例はすべて、ステップ属性とジョブ属性の便宜上提供されているマップアクセサーの使用箇所を示しています。
導入:
2.0
作成者:
Dave Syer, Michael Minella, Mahmoud Ben Hassine
  • フィールドの詳細

  • コンストラクターの詳細

    • StepScope

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

    • resolveContextualObject

      public ObjectSE resolveContextualObject(StringSE key)
      これは、ステップスコープの Bean の式を解決するために使用されます。
    • get

      public ObjectSE get(StringSE name, org.springframework.beans.factory.ObjectFactory<?> objectFactory)
      関連事項:
      • Scope.get(String, ObjectFactory)
    • getConversationId

      public StringSE getConversationId()
      関連事項:
      • Scope.getConversationId()
    • registerDestructionCallback

      public void registerDestructionCallback(StringSE name, RunnableSE callback)
      関連事項:
      • Scope.registerDestructionCallback(String, Runnable)
    • remove

      public ObjectSE remove(StringSE name)
      関連事項:
      • Scope.remove(String)
    • getTargetNamePrefix

      public StringSE getTargetNamePrefix()
      次で指定:
      クラス BatchScopeSupportgetTargetNamePrefix