parameters:
    akeneo_batch.job_instance_factory.class:                  Akeneo\Tool\Bundle\BatchBundle\Job\JobInstanceFactory
    akeneo_batch.logger_subscriber.class:                     Akeneo\Tool\Bundle\BatchBundle\EventListener\LoggerSubscriber
    akeneo_batch.notification_subscriber.class:               Akeneo\Tool\Bundle\BatchBundle\EventListener\NotificationSubscriber
    akeneo_batch.lock_subscriber.class:                       Akeneo\Tool\Bundle\BatchBundle\EventListener\LockSubscriber
    akeneo_batch.load_job_parameters_listener.class:          Akeneo\Tool\Bundle\BatchBundle\EventListener\LoadJobParametersListener
    akeneo_batch.logger.batch_log_handler.class:              Akeneo\Tool\Bundle\BatchBundle\Monolog\Handler\BatchLogHandler
    akeneo_batch.mail_notifier.class:                         Akeneo\Tool\Bundle\BatchBundle\Notification\MailNotifier
    akeneo_batch.set_job_execution_log_file_subscriber.class: Akeneo\Tool\Bundle\BatchBundle\EventListener\SetJobExecutionLogFileSubscriber
    akeneo_batch.manager.job_execution.class:                 Akeneo\Tool\Bundle\BatchBundle\Manager\JobExecutionManager
    akeneo_batch.launcher.simple_job_launcher.class:          Akeneo\Tool\Bundle\BatchBundle\Launcher\SimpleJobLauncher
    akeneo_batch.entity_manager.persisted_connection_entity_manager.class: Akeneo\Tool\Bundle\BatchBundle\EntityManager\PersistedConnectionEntityManager
    akeneo_batch.connectors_config:                           ~
    akeneo_batch.jobs_config:                                 ~

services:
    akeneo_batch.job_instance_factory:
        class: '%akeneo_batch.job_instance_factory.class%'
        arguments:
            - '%akeneo_batch.entity.job_instance.class%'

    akeneo_batch.logger_subscriber:
        class: '%akeneo_batch.logger_subscriber.class%'
        arguments:
            - '@logger'
            - '@translator'
        tags:
            - { name: kernel.event_subscriber }
            - { name: monolog.logger, channel: batch }

    akeneo_batch.notification_subscriber:
        class: '%akeneo_batch.notification_subscriber.class%'
        tags:
            - { name: kernel.event_subscriber }

    akeneo_batch.load_job_parameters_listener:
        class: '%akeneo_batch.load_job_parameters_listener.class%'
        arguments:
            - '@akeneo_batch.job_parameters_factory'
        tags:
            - { name: doctrine.orm.entity_listener, lazy: true }

    akeneo_batch.mail_notifier:
        class: '%akeneo_batch.mail_notifier.class%'
        arguments:
            - '@akeneo_batch.logger.batch_log_handler'
            - '@security.token_storage'
            - '@twig'
            - '@mailer'
            - '%mailer_url%'

    akeneo_batch.logger.batch_log_handler:
        class: '%akeneo_batch.logger.batch_log_handler.class%'
        arguments:
            - 100
            - true
            - null
            - false
            - '%kernel.logs_dir%/batch'

    akeneo_batch.set_job_execution_log_file_subscriber:
        class: '%akeneo_batch.set_job_execution_log_file_subscriber.class%'
        arguments:
            - '@akeneo_batch.logger.batch_log_handler'
        tags:
            - { name: kernel.event_subscriber }

    akeneo_batch.manager.job_execution:
        class: '%akeneo_batch.manager.job_execution.class%'
        arguments:
            - '@doctrine.orm.entity_manager'

    akeneo_batch.launcher.simple_job_launcher:
        class: '%akeneo_batch.launcher.simple_job_launcher.class%'
        arguments:
            - '@akeneo_batch.job_repository'
            - '@akeneo_batch.job_parameters_factory'
            - '@akeneo_batch.job.job_registry'
            - '@akeneo_batch.job.job_parameters_validator'
            - '@event_dispatcher'
            - '%kernel.project_dir%/src'
            - '%kernel.environment%'
            - '%kernel.logs_dir%'

    akeneo_batch.entity_manager.persisted_connection_entity_manager:
        class: '%akeneo_batch.entity_manager.persisted_connection_entity_manager.class%'
        arguments:
            - '@doctrine.orm.entity_manager'

    Akeneo\Tool\Bundle\BatchBundle\Storage\DeleteJobExecutionLogs:
        arguments:
            - '@Akeneo\Tool\Bundle\BatchBundle\Persistence\Sql\GetJobExecutionIds'
            - '@filesystem'
            - '%kernel.logs_dir%/batch'

    akeneo_batch.query.get_job_execution_status:
        class: 'Akeneo\Tool\Component\Batch\Query\SqlGetJobExecutionStatus'
        arguments:
            - '@database_connection'

    akeneo_batch.query.update_job_execution_status:
        class: 'Akeneo\Tool\Component\Batch\Query\SqlUpdateJobExecutionStatus'
        arguments:
            - '@database_connection'

    Akeneo\Tool\Bundle\BatchBundle\Persistence\Sql\SqlMarkJobExecutionAsFailedWhenInterrupted:
        arguments:
            - '@database_connection'

    Akeneo\Tool\Component\Batch\Event\ErrorHandlerConfigurationListener:
        arguments:
          - '@logger'
          - '%kernel.environment%'
        tags:
          - { name: kernel.event_listener, event: console.command }
