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

# Class TaskRepositoryInitializer

java.lang.Object
org.springframework.cloud.task.repository.support.TaskRepositoryInitializer

All Implemented Interfaces:
  `org.springframework.beans.factory.InitializingBean`

public final class TaskRepositoryInitializer extends Object implements org.springframework.beans.factory.InitializingBean
Utility for initializing the Task Repository's datasource. If a single `DataSource` is available in the current context, and functionality is enabled (as it is by default), this will initialize the database. If more than one DataSource is available in the current context, custom configuration of this is required (if desired). Initialization of the database can be disabled by configuring the property `spring.cloud.task.initialize-enabled` to false. `spring.cloud.task.initialize.enable` has been deprecated.

Author:
  Glenn Renfro, Michael Minella

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TaskRepositoryInitializer(TaskProperties taskProperties)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `afterPropertiesSet()`
  `void`
  `setDataSource(DataSource dataSource)`
  `void`
  `setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)`

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

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

- ## Constructor Details

  - ### TaskRepositoryInitializer

    public TaskRepositoryInitializer(TaskProperties taskProperties)

- ## Method Details

  - ### setDataSource

    public void setDataSource(DataSource dataSource)

  - ### setResourceLoader

    @Autowired(required=false) public void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)

  - ### afterPropertiesSet

    public void afterPropertiesSet() throws Exception
    Specified by:
      `afterPropertiesSet` in interface `org.springframework.beans.factory.InitializingBean`
    Throws:
      `Exception`