parameters:
    oro_cron.entity.schedule.class:   Oro\Bundle\CronBundle\Entity\Schedule
    oro_cron.job_daemon.class:        Oro\Bundle\CronBundle\Job\Daemon
    oro_cron.job_manager.class:       Oro\Bundle\CronBundle\Entity\Manager\JobManager
    oro_cron.schedule_manager.class:  Oro\Bundle\CronBundle\Entity\Manager\ScheduleManager

services:
    oro_cron.job_daemon:
        class: '%oro_cron.job_daemon.class%'
        arguments:
            - '%kernel.root_dir%'
            - '%oro_cron.max_jobs%'
            - '%oro_cron.max_runtime%'
            - '%kernel.environment%'

    oro_cron.job_manager:
        class: '%oro_cron.job_manager.class%'
        arguments:
            - '@doctrine.orm.entity_manager'

    oro_cron.schedule_manager:
        class: '%oro_cron.schedule_manager.class%'
        arguments:
            - '@doctrine'
            - '%oro_cron.entity.schedule.class%'

    oro_cron.deferred_scheduler:
        class: Oro\Bundle\CronBundle\Entity\Manager\DeferredScheduler
        arguments:
            - '@oro_cron.schedule_manager'
            - '@doctrine'
            - '%oro_cron.entity.schedule.class%'

    oro_cron.command_args_tokenizer:
        class: 'Oro\Bundle\CronBundle\ORM\CommandArgsTokenizer'
        public: false
        calls:
            - [ addNormalizer, [ '@oro_cron.command_args_normalizer.default' ] ]
            - [ addNormalizer, [ '@oro_cron.command_args_normalizer.pgsql92' ] ]

    oro_cron.command_args_normalizer.default:
        class: 'Oro\Bundle\CronBundle\ORM\CommandArgsNormalizer'
        public: false

    oro_cron.command_args_normalizer.pgsql92:
        class: 'Oro\Bundle\CronBundle\ORM\Pgsql92CommandArgsNormalizer'
        public: false

    oro_cron.command_with_args_string_filter:
        class: Oro\Bundle\CronBundle\Filter\CommandWithArgsFilter
        arguments:
            - '@form.factory'
            - '@oro_filter.filter_utility'
            - '@oro_cron.command_args_tokenizer'
        tags:
            - { name: oro_filter.extension.orm_filter.filter, type: command_with_args }

    oro_cron.action.create_job:
        class: 'Oro\Bundle\CronBundle\Action\CreateJobAction'
        arguments:
            - '@oro_action.context_accessor'
            - '@oro_cron.job_manager'
            - '@doctrine'
        tags:
            - { name: oro_action.action, alias: create_job }
            - { name: oro_workflow.action, alias: create_job }

    oro_cron.helper.cron:
        class: 'Oro\Bundle\CronBundle\Helper\CronHelper'

    oro_cron.listener.load_class_metadata_subscriber:
        class: Oro\Bundle\CronBundle\EventListener\LoadClassMetadataSubscriber
        tags:
            - { name: doctrine.event_subscriber }

    oro_cron.listener.job_subscriber:
        class: Oro\Bundle\CronBundle\EventListener\JobSubscriber
        arguments:
            - '@logger'
        tags:
            - { name: kernel.event_subscriber }
