commandbox.system.modules_app.task-commands.models

Class TaskService

lucee.Component
    extended by commandbox.system.modules_app.task-commands.models.TaskService

Copyright Since 2014 CommandBox by Ortus Solutions, Corp www.coldbox.org | www.ortussolutions.com I handle excuction of Task Runners

Class Attributes:
  • singleton
  •  
  • synchronized : false
  •  
  • accessors : true
  •  
  • persistent : false
  •  
  • author : Brad Wood, Luis Majano, Denny Valliant
  •  
    Property Summary
    type property default serializable required
    any CommandService


    • access = public
    • returntype = any
    • inject = CommandService
    true false
    any FileSystemUtil


    • access = public
    • returntype = any
    • inject = FileSystem
    true false
    any consoleLogger


    • access = public
    • returntype = any
    • inject = logbox:logger:console
    true false
    any cr


    • access = public
    • returntype = any
    • inject = cr@constants
    true false
    any job


    • access = public
    • returntype = any
    • inject = interactiveJob
    true false
    any logger


    • access = public
    • returntype = any
    • inject = logbox:logger:{this}
    true false
    any metadataCache


    • access = public
    • returntype = any
    • inject = cachebox:metadataCache
    true false
    any shell


    • access = public
    • returntype = any
    • inject = Shell
    true false
    any wirebox


    • access = public
    • returntype = any
    • inject = wirebox
    true false
    Method Summary
    boolean canLifecycleEventRun([any taskCFC], [string eventName], [string target])
         Determines if a lifecycle event can run based on the this.
    any createTaskCFC(string taskFile)
         Creates Task CFC instance from absolute file path.
    string getCommandService()
    string getConsoleLogger()
    string getCr()
    string getFileSystemUtil()
    string getJob()
    string getLogger()
    string getMetadataCache()
    string getShell()
    array getTaskMethods(string taskFile)
         Returns the public methods in a task component.
    string getWirebox()
    any invokeLifecycleEvent([any taskCFC], [string eventName], [struct args='[runtime expression]'])
         Optionally invokes a lifecyle event based on whether it exists and is valid to be called.
    any onDIComplete()
    string runTask(string taskFile, string target='run', [any taskArgs='[runtime expression]'], [boolean topLevel='true'])
         Runs a task.
    any setCommandService(any CommandService)
    any setConsoleLogger(any consoleLogger)
    any setCr(any cr)
    any setFileSystemUtil(any FileSystemUtil)
    any setJob(any job)
    any setLogger(any logger)
    any setMetadataCache(any metadataCache)
    any setShell(any shell)
    any setWirebox(any wirebox)
    boolean taskHasMethod([any taskCFC], [string method])
         Convenience method to determine if a Task CFC instance has a given method name.
    any wrapLifecycleEvent([any taskCFC], [string eventName], [struct args='[runtime expression]'])
         Accepts a UDF and wraps it in another callback that adds additional functionality to it, creating a chain of callbacks.
     
    Methods inherited from class lucee.Component
    None

    Property Detail

    CommandService

    property any CommandService

    Attributes:
    access - public
    required - false
    returntype - any
    inject - CommandService
    serializable - true

    FileSystemUtil

    property any FileSystemUtil

    Attributes:
    access - public
    required - false
    returntype - any
    inject - FileSystem
    serializable - true

    consoleLogger

    property any consoleLogger

    Attributes:
    access - public
    required - false
    returntype - any
    inject - logbox:logger:console
    serializable - true

    cr

    property any cr

    Attributes:
    access - public
    required - false
    returntype - any
    inject - cr@constants
    serializable - true

    job

    property any job

    Attributes:
    access - public
    required - false
    returntype - any
    inject - interactiveJob
    serializable - true

    logger

    property any logger

    Attributes:
    access - public
    required - false
    returntype - any
    inject - logbox:logger:{this}
    serializable - true

    metadataCache

    property any metadataCache

    Attributes:
    access - public
    required - false
    returntype - any
    inject - cachebox:metadataCache
    serializable - true

    shell

    property any shell

    Attributes:
    access - public
    required - false
    returntype - any
    inject - Shell
    serializable - true

    wirebox

    property any wirebox

    Attributes:
    access - public
    required - false
    returntype - any
    inject - wirebox
    serializable - true

    Method Detail

    canLifecycleEventRun

    public boolean canLifecycleEventRun([any taskCFC], [string eventName], [string target])

    Determines if a lifecycle event can run based on the this.XXX_only and this.XXX_except variables in the task CFC instance.

    Parameters:
    taskCFC - The actual Task CFC instance
    eventName - Name of the lifecycle event to check
    target - Name of the task target requesting the lifecycle event

    createTaskCFC

    public any createTaskCFC(string taskFile)

    Creates Task CFC instance from absolute file path

    Parameters:
    taskFile - Absolute path to task CFC to create.

    getCommandService

    public string getCommandService()


    getConsoleLogger

    public string getConsoleLogger()


    getCr

    public string getCr()


    getFileSystemUtil

    public string getFileSystemUtil()


    getJob

    public string getJob()


    getLogger

    public string getLogger()


    getMetadataCache

    public string getMetadataCache()


    getShell

    public string getShell()


    getTaskMethods

    public array getTaskMethods(string taskFile)

    Returns the public methods in a task component

    Parameters:
    taskFile - Path to the Task CFC

    getWirebox

    public string getWirebox()


    invokeLifecycleEvent

    public any invokeLifecycleEvent([any taskCFC], [string eventName], [struct args='[runtime expression]'])

    Optionally invokes a lifecyle event based on whether it exists and is valid to be called.

    Parameters:
    taskCFC - The actual Task CFC instance
    eventName - Name of the lifecycle event to call
    args - The args of the actual target method

    onDIComplete

    public any onDIComplete()


    runTask

    public string runTask(string taskFile, string target='run', [any taskArgs='[runtime expression]'], [boolean topLevel='true'])

    Runs a task

    Parameters:
    taskFile - Path to the Task CFC that you want to run
    target - Method in Task CFC to run
    taskArgs - Struct of arguments to pass on to the task
    topLevel - false for target dependecy runs

    setCommandService

    public any setCommandService(any CommandService)

    Parameters:
    CommandService

    setConsoleLogger

    public any setConsoleLogger(any consoleLogger)

    Parameters:
    consoleLogger

    setCr

    public any setCr(any cr)

    Parameters:
    cr

    setFileSystemUtil

    public any setFileSystemUtil(any FileSystemUtil)

    Parameters:
    FileSystemUtil

    setJob

    public any setJob(any job)

    Parameters:
    job

    setLogger

    public any setLogger(any logger)

    Parameters:
    logger

    setMetadataCache

    public any setMetadataCache(any metadataCache)

    Parameters:
    metadataCache

    setShell

    public any setShell(any shell)

    Parameters:
    shell

    setWirebox

    public any setWirebox(any wirebox)

    Parameters:
    wirebox

    taskHasMethod

    public boolean taskHasMethod([any taskCFC], [string method])

    Convenience method to determine if a Task CFC instance has a given method name

    Parameters:
    taskCFC - The actual Task CFC instance
    method - Name of method to check for

    wrapLifecycleEvent

    public any wrapLifecycleEvent([any taskCFC], [string eventName], [struct args='[runtime expression]'])

    Accepts a UDF and wraps it in another callback that adds additional functionality to it, creating a chain of callbacks.

    Parameters:
    taskCFC - The actual Task CFC instance
    eventName - Name of the lifecycle event to wrap
    args - The args of the actual target method