クラス JobScope

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

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

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

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

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

    • JobScope

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

    • 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