Class ItemStreamSupport

java.lang.Object
org.springframework.batch.infrastructure.item.ItemStreamSupport
All Implemented Interfaces:
ItemStream, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware
Direct Known Subclasses:
AbstractItemStreamItemReader, AbstractItemStreamItemWriter, ChunkMonitor

public abstract class ItemStreamSupport extends Object implements ItemStream, org.springframework.beans.factory.BeanNameAware
Support class for ItemStreams. Provides a default name for components that can be used as a prefix for keys in the ExecutionContext and which can be overridden by the bean name if the component is a Spring managed bean.
Author:
Dave Syer, Dean de Bree, Mahmoud Ben Hassine, Stefano Cordio, Jimmy Praet
  • Constructor Details

    • ItemStreamSupport

      public ItemStreamSupport()
  • Method Details

    • setName

      public void setName(String name)
      The name of the component which will be used as a stem for keys in the ExecutionContext. Subclasses should provide a default value, e.g. the short form of the class name.
      Parameters:
      name - the name for the component
    • setBeanName

      public void setBeanName(String name)
      Set the name of the bean in the bean factory that created this bean. The bean name will only be used as name of the component in case it hasn't already been explicitly set to a value other than the default. setName(String)
      Specified by:
      setBeanName in interface org.springframework.beans.factory.BeanNameAware
      Since:
      6.0
      See Also:
      • BeanNameAware.setBeanName(String)
    • getName

      public @Nullable String getName()
      Get the name of the component
      Returns:
      the name of the component
    • setExecutionContextName

      protected void setExecutionContextName(String name)
    • getExecutionContextKey

      public String getExecutionContextKey(String key)