Class BasePlatformPackageService

java.lang.Object
net.solarnetwork.node.service.support.BasePlatformPackageService
All Implemented Interfaces:
PlatformPackageService
Direct Known Subclasses:
BaseSolarPkgPlatformPackageService, NativeTarPlatformPackageService

public abstract class BasePlatformPackageService extends Object implements PlatformPackageService
Base implementation of PlatformPackageService.
Since:
2.0
Version:
1.0
Author:
matt
  • Field Details

    • log

      protected org.slf4j.Logger log
      A class-level logger.
  • Constructor Details

    • BasePlatformPackageService

      public BasePlatformPackageService()
  • Method Details

    • performPackageResultTask

      protected <T> Future<PlatformPackageService.PlatformPackageResult<T>> performPackageResultTask(Callable<PlatformPackageService.PlatformPackageResult<T>> task, T context)
      Perform the extraction task, using the configured AsyncTaskExecutor if available.

      If getTaskExecutor() is null, the task will be executed on the calling thread.

      Type Parameters:
      T - the context type
      Parameters:
      task - the task
      context - the context
      Returns:
      the task future
    • performTask

      protected <T> Future<T> performTask(Callable<T> task)
      Perform the extraction task, using the configured AsyncTaskExecutor if available.

      If getTaskExecutor() is null, the task will be executed on the calling thread.

      Type Parameters:
      T - the context type
      Parameters:
      task - the task
      Returns:
      the task future
    • taskExecutor

      protected org.springframework.core.task.AsyncTaskExecutor taskExecutor()
      Get the configured task executor.
      Returns:
      the task executor, or null.
    • getTaskExecutor

      public net.solarnetwork.service.OptionalService<org.springframework.core.task.AsyncTaskExecutor> getTaskExecutor()
      Get the task executor.
      Returns:
      the task executor
    • setTaskExecutor

      public void setTaskExecutor(net.solarnetwork.service.OptionalService<org.springframework.core.task.AsyncTaskExecutor> taskExecutor)
      Set the task executor.
      Parameters:
      taskExecutor - the task executor