@Configuration
public class ServicesConfig
extends java.lang.Object
Constructor and Description |
---|
ServicesConfig() |
Modifier and Type | Method and Description |
---|---|
ApplicationService |
applicationService(JpaApplicationRepository applicationRepo,
JpaCommandRepository commandRepo)
Get JPA based implementation of the ApplicationService.
|
AttachmentService |
attachmentService(JobsProperties jobsProperties)
The attachment service to use.
|
GenieFileTransferService |
cacheGenieFileTransferService(FileTransferFactory fileTransferFactory,
java.lang.String baseCacheLocation,
FileTransfer localFileTransfer,
com.netflix.spectator.api.Registry registry)
Get an instance of the Cache Genie File Transfer service.
|
ClusterLoadBalancer |
clusterLoadBalancer()
Get a Randomized Cluster load balancer.
|
ClusterService |
clusterService(JpaClusterRepository clusterRepo,
JpaCommandRepository commandRepo)
Get JPA based implementation of the ClusterService.
|
CommandService |
commandService(JpaCommandRepository commandRepo,
JpaApplicationRepository appRepo,
JpaClusterRepository clusterRepo)
Get JPA based implementation of the CommandService.
|
org.springframework.beans.factory.FactoryBean |
fileTransferFactory()
FileTransfer factory.
|
GenieFileTransferService |
genieFileTransferService(FileTransferFactory fileTransferFactory)
Get an instance of the Genie File Transfer service.
|
MailService |
getDefaultMailServiceImpl()
Get an default implementation of the Mail Service interface if nothing is supplied.
|
MailService |
getJavaMailSenderMailService(org.springframework.mail.javamail.JavaMailSender javaMailSender,
java.lang.String fromAddress)
Returns a bean for mail service impl using the Spring Mail.
|
JobCoordinatorService |
jobCoordinatorService(JobPersistenceService jobPersistenceService,
JobKillService jobKillService,
JobStateService jobStateService,
JobsProperties jobsProperties,
ApplicationService applicationService,
ClusterService clusterService,
CommandService commandService,
ClusterLoadBalancer clusterLoadBalancer,
com.netflix.spectator.api.Registry registry,
java.lang.String hostName)
Get an instance of the JobCoordinatorService.
|
JobKillService |
jobKillService(java.lang.String hostName,
JobSearchService jobSearchService,
org.apache.commons.exec.Executor executor,
JobsProperties jobsProperties,
org.springframework.context.ApplicationEventPublisher eventPublisher,
org.springframework.core.io.Resource genieWorkingDir,
com.fasterxml.jackson.databind.ObjectMapper objectMapper)
Get an local implementation of the JobKillService.
|
JobPersistenceService |
jobPersistenceService(JpaJobRepository jobRepo,
JpaJobRequestRepository jobRequestRepo,
JpaJobMetadataRepository jobMetadataRepository,
JpaJobExecutionRepository jobExecutionRepo,
JpaApplicationRepository applicationRepo,
JpaClusterRepository clusterRepo,
JpaCommandRepository commandRepo)
Get JPA based implementation of the JobPersistenceService.
|
JobSearchService |
jobSearchService(JpaJobRepository jobRepository,
JpaJobRequestRepository jobRequestRepository,
JpaJobExecutionRepository jobExecutionRepository,
JpaClusterRepository clusterRepository,
JpaCommandRepository commandRepository)
Get JPA based implementation of the JobSearchService.
|
JobSubmitterService |
jobSubmitterService(JobPersistenceService jobPersistenceService,
org.springframework.context.ApplicationEventPublisher eventPublisher,
org.springframework.context.event.ApplicationEventMulticaster eventMulticaster,
java.util.List<WorkflowTask> workflowTasks,
org.springframework.core.io.Resource genieWorkingDir,
com.netflix.spectator.api.Registry registry)
Get a implementation of the JobSubmitterService that runs jobs locally.
|
@Bean @ConditionalOnProperty(value="spring.mail.host") public MailService getJavaMailSenderMailService(org.springframework.mail.javamail.JavaMailSender javaMailSender, @Value(value="${genie.mail.fromAddress}") java.lang.String fromAddress)
javaMailSender
- An implementation of the JavaMailSender interface.fromAddress
- The from email address for the email.@Bean @ConditionalOnMissingBean public MailService getDefaultMailServiceImpl()
@Bean public ApplicationService applicationService(JpaApplicationRepository applicationRepo, JpaCommandRepository commandRepo)
applicationRepo
- The application repository to use.commandRepo
- The command repository to use.@Bean public ClusterService clusterService(JpaClusterRepository clusterRepo, JpaCommandRepository commandRepo)
clusterRepo
- The cluster repository to use.commandRepo
- The command repository to use.@Bean public CommandService commandService(JpaCommandRepository commandRepo, JpaApplicationRepository appRepo, JpaClusterRepository clusterRepo)
commandRepo
- the command repository to useappRepo
- the application repository to useclusterRepo
- the cluster repository to use@Bean public JobSearchService jobSearchService(JpaJobRepository jobRepository, JpaJobRequestRepository jobRequestRepository, JpaJobExecutionRepository jobExecutionRepository, JpaClusterRepository clusterRepository, JpaCommandRepository commandRepository)
jobRepository
- The repository to use for job entitiesjobRequestRepository
- The repository to use for job request entitiesjobExecutionRepository
- The repository to use for job execution entitiesclusterRepository
- The repository to use for cluster entitiescommandRepository
- The repository to use for command entities@Bean public JobPersistenceService jobPersistenceService(JpaJobRepository jobRepo, JpaJobRequestRepository jobRequestRepo, JpaJobMetadataRepository jobMetadataRepository, JpaJobExecutionRepository jobExecutionRepo, JpaApplicationRepository applicationRepo, JpaClusterRepository clusterRepo, JpaCommandRepository commandRepo)
jobRepo
- The job repository to usejobRequestRepo
- The job request repository to usejobMetadataRepository
- The job metadata repository to usejobExecutionRepo
- The job execution repository to useapplicationRepo
- The application repository to useclusterRepo
- The cluster repository to usecommandRepo
- The command repository to use@Bean public JobKillService jobKillService(java.lang.String hostName, JobSearchService jobSearchService, org.apache.commons.exec.Executor executor, JobsProperties jobsProperties, org.springframework.context.ApplicationEventPublisher eventPublisher, @Qualifier(value="jobsDir") org.springframework.core.io.Resource genieWorkingDir, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
hostName
- The name of the host this Genie node is running on.jobSearchService
- The job search service to use to locate job information.executor
- The executor to use to run system processes.jobsProperties
- The jobs properties to useeventPublisher
- The application event publisher to use to publish system wide eventsgenieWorkingDir
- Working directory for genie where it creates jobs directories.objectMapper
- The Jackson ObjectMapper used to serialize from/to JSON@Bean public ClusterLoadBalancer clusterLoadBalancer()
@Bean public GenieFileTransferService genieFileTransferService(FileTransferFactory fileTransferFactory) throws GenieException
fileTransferFactory
- file transfer implementation factoryGenieException
- If there is any problem@Bean public GenieFileTransferService cacheGenieFileTransferService(FileTransferFactory fileTransferFactory, @Value(value="${genie.file.cache.location}") java.lang.String baseCacheLocation, @Qualifier(value="file.system.file") FileTransfer localFileTransfer, com.netflix.spectator.api.Registry registry) throws GenieException
fileTransferFactory
- file transfer implementation factorybaseCacheLocation
- file cache locationlocalFileTransfer
- local file transfer serviceregistry
- RegistryGenieException
- If there is any problem@Bean public JobSubmitterService jobSubmitterService(JobPersistenceService jobPersistenceService, org.springframework.context.ApplicationEventPublisher eventPublisher, org.springframework.context.event.ApplicationEventMulticaster eventMulticaster, java.util.List<WorkflowTask> workflowTasks, @Qualifier(value="jobsDir") org.springframework.core.io.Resource genieWorkingDir, com.netflix.spectator.api.Registry registry)
jobPersistenceService
- Implementation of the job persistence service.eventPublisher
- Instance of the synchronous event publisher.eventMulticaster
- Instance of the asynchronous event publisher.workflowTasks
- List of all the workflow tasks to be executed.genieWorkingDir
- Working directory for genie where it creates jobs directories.registry
- The metrics registry to use@Bean public JobCoordinatorService jobCoordinatorService(JobPersistenceService jobPersistenceService, JobKillService jobKillService, @Qualifier(value="jobMonitoringCoordinator") JobStateService jobStateService, JobsProperties jobsProperties, ApplicationService applicationService, ClusterService clusterService, CommandService commandService, ClusterLoadBalancer clusterLoadBalancer, com.netflix.spectator.api.Registry registry, java.lang.String hostName)
jobPersistenceService
- implementation of job persistence service interfacejobKillService
- The job kill service to usejobStateService
- The running job metrics service to usejobsProperties
- The jobs properties to useapplicationService
- Implementation of application service interfaceclusterService
- Implementation of cluster service interfacecommandService
- Implementation of command service interfaceclusterLoadBalancer
- Implementation of the cluster load balancer interfaceregistry
- The metrics registry to usehostName
- The host this Genie instance is running on@Bean public AttachmentService attachmentService(JobsProperties jobsProperties)
jobsProperties
- All properties related to jobs@Bean public org.springframework.beans.factory.FactoryBean fileTransferFactory()