Class BasePlatformPackageService
java.lang.Object
net.solarnetwork.node.service.support.BasePlatformPackageService
- All Implemented Interfaces:
PlatformPackageService
- Direct Known Subclasses:
BaseSolarPkgPlatformPackageService,NativeTarPlatformPackageService
Base implementation of
PlatformPackageService.- Since:
- 2.0
- Version:
- 1.0
- Author:
- matt
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.solarnetwork.node.service.PlatformPackageService
PlatformPackageService.PlatformPackage, PlatformPackageService.PlatformPackageResult<T> -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnet.solarnetwork.service.OptionalService<org.springframework.core.task.AsyncTaskExecutor>Get the task executor.protected <T> Future<PlatformPackageService.PlatformPackageResult<T>>performPackageResultTask(Callable<PlatformPackageService.PlatformPackageResult<T>> task, T context) Perform the extraction task, using the configuredAsyncTaskExecutorif available.protected <T> Future<T>performTask(Callable<T> task) Perform the extraction task, using the configuredAsyncTaskExecutorif available.voidsetTaskExecutor(net.solarnetwork.service.OptionalService<org.springframework.core.task.AsyncTaskExecutor> taskExecutor) Set the task executor.protected org.springframework.core.task.AsyncTaskExecutorGet the configured task executor.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.solarnetwork.node.service.PlatformPackageService
cleanup, handlesPackage, installNamedPackage, installPackage, listNamedPackages, refreshNamedPackages, removeNamedPackage, upgradeNamedPackages
-
Field Details
-
log
protected org.slf4j.Logger logA 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 configuredAsyncTaskExecutorif available.If
getTaskExecutor()is null, the task will be executed on the calling thread.- Type Parameters:
T- the context type- Parameters:
task- the taskcontext- the context- Returns:
- the task future
-
performTask
Perform the extraction task, using the configuredAsyncTaskExecutorif 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
-