Class SimpleTaskNameResolver

java.lang.Object
org.springframework.cloud.task.repository.support.SimpleTaskNameResolver
All Implemented Interfaces:
org.springframework.beans.factory.Aware, TaskNameResolver, org.springframework.context.ApplicationContextAware

public class SimpleTaskNameResolver extends Object implements TaskNameResolver, org.springframework.context.ApplicationContextAware
Simple implementation of the TaskNameResolver interface. Names the task based on the following order of precidence:
  1. A configured property spring.cloud.task.name
  2. The ApplicationContext's id.
Author:
Michael Minella
See Also:
  • ContextIdApplicationContextInitializer
  • Constructor Details

    • SimpleTaskNameResolver

      public SimpleTaskNameResolver()
  • Method Details

    • setConfiguredName

      @Value("${spring.cloud.task.name:}") public void setConfiguredName(String configuredName)
    • setApplicationContext

      public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
      Specified by:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware
      Throws:
      org.springframework.beans.BeansException
    • getTaskName

      public String getTaskName()
      Specified by:
      getTaskName in interface TaskNameResolver
      Returns:
      the name of the task being executed within this context.