Package org.springframework.cloud.task.repository.support

# 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 Summary

  Constructors
  Constructor
  Description
  `SimpleTaskNameResolver()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getTaskName()`
  `void`
  `setApplicationContext(org.springframework.context.ApplicationContext applicationContext)`
  `void`
  `setConfiguredName(String configuredName)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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.