coldbox.system.web.services

Class HandlerService

lucee.Component
    extended by coldbox.system.web.services.BaseService
      extended by coldbox.system.web.services.HandlerService

Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp www.ortussolutions.com --- This service takes care of all event handling in ColdBox

Class Attributes:
  • synchronized : false
  •  
  • accessors : true
  •  
  • persistent : false
  •  
    Property Summary
    type property default serializable required
    struct eventCacheDictionary
          Event caching metadata dictionary.

    • access = public
    • returntype = any
    true false
    boolean eventCaching
          Flag to denote event caching.

    • access = public
    • returntype = any
    true false
    struct handlerCacheDictionary
          Handler cache metadata dictionary.

    • access = public
    • returntype = any
    true false
    boolean handlerCaching
          Flag to denote handler caching.

    • access = public
    • returntype = any
    true false
    Constructor Summary
    init(any controller)
          Constructor.
    Method Summary
    any afterInstanceAutowire([any event], [any interceptData])
         Called by wirebox once instances are autowired to re-fire to `afterHandlerCreation`.
    any clearDictionaries()
         Clear the internal cache dictionaries.
    any defaultActionCheck(any event)
         Do a default action checks on the incoming event string.
    string getEventCacheDictionary()
    string getEventCaching()
    private struct getEventCachingMetadata(any ehBean, any oEventHandler)
         Return the event caching metadata for an action execution context.
    struct getEventMetadataEntry(any targetEvent)
         Get an event string's metdata entry.
    any getHandler(any ehBean, any requestContext)
         Get a validated handler instance using an event handler bean and context.
    any getHandlerBean(string event)
         Parse the incoming event string into an event handler bean that is used for the current execution context.
    string getHandlerCacheDictionary()
    string getHandlerCaching()
    array getHandlerListing(any directory)
         Retrieve handler listings from disk.
    private struct getNewMDEntry()
         Return a new metadata struct object.
    any invalidEvent(string event, any ehBean)
         Invalid Event procedures.
    boolean isViewDispatch(string event, any ehBean)
         Check if the incoming event has a matching implicit view to dispatch.
    any newHandler(any invocationPath)
         Asks wirebox for an instance of a handler.
    any onConfigurationLoad()
         Once configuration file loads setup the services with app specific variables.
    any registerHandlers()
         Register's application event handlers according to convention and external paths.
    any setEventCacheDictionary(struct eventCacheDictionary)
    any setEventCaching(boolean eventCaching)
    any setHandlerCacheDictionary(struct handlerCacheDictionary)
    any setHandlerCaching(boolean handlerCaching)
    private any wireboxSetup()
         Verifies setup of base handler class in WireBox.
     
    Methods inherited from class coldbox.system.web.services.BaseService
    getController, onShutdown, setController
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init(any controller)

    Constructor

    Parameters:
    controller - ColdBox Controller

    Property Detail

    eventCacheDictionary

    property struct eventCacheDictionary

    Event caching metadata dictionary

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

    eventCaching

    property boolean eventCaching

    Flag to denote event caching

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

    handlerCacheDictionary

    property struct handlerCacheDictionary

    Handler cache metadata dictionary

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

    handlerCaching

    property boolean handlerCaching

    Flag to denote handler caching

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

    Method Detail

    afterInstanceAutowire

    public any afterInstanceAutowire([any event], [any interceptData])

    Called by wirebox once instances are autowired to re-fire to `afterHandlerCreation`

    Parameters:
    event
    interceptData

    clearDictionaries

    public any clearDictionaries()

    Clear the internal cache dictionaries

    Returns:
    HandlerService

    defaultActionCheck

    public any defaultActionCheck(any event)

    Do a default action checks on the incoming event string. This method matches it against the internal handlers list. If found, then we append the default action to the event.

    Parameters:
    event - The request context
    Returns:
    HandlerService

    getEventCacheDictionary

    public string getEventCacheDictionary()


    getEventCaching

    public string getEventCaching()


    getEventCachingMetadata

    private struct getEventCachingMetadata(any ehBean, any oEventHandler)

    Return the event caching metadata for an action execution context.

    Parameters:
    ehBean - The event handler bean
    oEventHandler - The event handler to execute
    Returns:
    strc

    getEventMetadataEntry

    public struct getEventMetadataEntry(any targetEvent)

    Get an event string's metdata entry. If not found, then you will get a new metadata entry using the `getNewMDEntry()` method.

    Parameters:
    targetEvent - The event to match for metadata.

    getHandler

    public any getHandler(any ehBean, any requestContext)

    Get a validated handler instance using an event handler bean and context. This is called once event execution is in progress. Before returning this method verifies method of execution, event caching, invalid events and stores metadata

    Parameters:
    ehBean - The event handler bean representation
    requestContext - The request context object

    getHandlerBean

    public any getHandlerBean(string event)

    Parse the incoming event string into an event handler bean that is used for the current execution context

    Parameters:
    event - The full event string
    Returns:
    coldbox.system.web.context.EventHandlerBean

    getHandlerCacheDictionary

    public string getHandlerCacheDictionary()


    getHandlerCaching

    public string getHandlerCaching()


    getHandlerListing

    public array getHandlerListing(any directory)

    Retrieve handler listings from disk

    Parameters:
    directory - The path to retrieve

    getNewMDEntry

    private struct getNewMDEntry()

    Return a new metadata struct object

    Returns:
    { cacheable:boolean, timeout, lastAccessTimeout, cacheKey, suffix }

    invalidEvent

    public any invalidEvent(string event, any ehBean)

    Invalid Event procedures

    Parameters:
    event - The event that was found to be invalid
    ehBean - The event handler bean
    Returns:
    HandlerService
    Throws:
    EventHandlerNotRegisteredException,InvalidEventHandlerException

    isViewDispatch

    public boolean isViewDispatch(string event, any ehBean)

    Check if the incoming event has a matching implicit view to dispatch. This is usually called when there is no existing handler found.

    Parameters:
    event - The event string
    ehBean - The event handler bean

    newHandler

    public any newHandler(any invocationPath)

    Asks wirebox for an instance of a handler. It verifies that there is a mapping in Wirebox for the handler if it does not exist, it maps it first and then retrieves it.

    Parameters:
    invocationPath - The handler invocation path
    Returns:
    Handler Instance

    onConfigurationLoad

    public any onConfigurationLoad()

    Once configuration file loads setup the services with app specific variables

    Overrides:
    onConfigurationLoad in class BaseService

    registerHandlers

    public any registerHandlers()

    Register's application event handlers according to convention and external paths

    Returns:
    HandlerService
    Throws:
    HandlersDirectoryNotFoundException

    setEventCacheDictionary

    public any setEventCacheDictionary(struct eventCacheDictionary)

    Parameters:
    eventCacheDictionary

    setEventCaching

    public any setEventCaching(boolean eventCaching)

    Parameters:
    eventCaching

    setHandlerCacheDictionary

    public any setHandlerCacheDictionary(struct handlerCacheDictionary)

    Parameters:
    handlerCacheDictionary

    setHandlerCaching

    public any setHandlerCaching(boolean handlerCaching)

    Parameters:
    handlerCaching

    wireboxSetup

    private any wireboxSetup()

    Verifies setup of base handler class in WireBox

    Returns:
    HandlerService