coldbox.system.web.context

Class InterceptorState

lucee.Component
    extended by coldbox.system.core.events.EventPool
      extended by coldbox.system.web.context.InterceptorState

Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp www.ortussolutions.com --- This object models an interception state

Class Attributes:
  • synchronized : false
  •  
  • accessors : true
  •  
  • persistent : false
  •  
    Property Summary
    type property default serializable required
    any controller
          Controller reference.

    • access = public
    • returntype = any
    true false
    any metadataMap
          Metadata map for objects.

    • access = public
    • returntype = any
    true false
    Constructor Summary
    init(any state, any logbox, any controller)
          Constructor.
    Method Summary
    any exists(any interceptorKey)
         Checks if the passed interceptor key already exists.
    string getController()
    any getInterceptor(any interceptorKey)
         Get an interceptor from this state.
    any getInterceptors()
         Get the interceptors linked hash map.
    any getMetadataMap([any interceptorKey])
         Return the state's metadata map for it's registered interecptors.
    private any invoker(any interceptor, any event, any interceptData, any interceptorKey, any buffer)
         Execute an interceptor execution point asynchronously.
    private any invokerAsync(any event, any interceptData, any interceptorKey, [any asyncPriority='NORMAL'], any buffer)
         Execute an interceptor execution point asynchronously.
    boolean isExecutable(any target, any event, any targetKey)
         Checks if an interceptor is executable or not.
    any process(any event, any interceptData, [boolean async='false'], [boolean asyncAll='false'], [boolean asyncAllJoin='true'], [string asyncPriority='NORMAL'], [numeric asyncJoinTimeout='0'], any buffer)
         Process this state's interceptors.
    any processAsync(any event, any interceptData, [string asyncPriority='NORMAL'], any buffer)
         Process an execution asynchronously.
    any processAsyncAll(any event, any interceptData, [boolean asyncAllJoin='true'], [string asyncPriority='NORMAL'], [numeric asyncJoinTimeout='0'], any buffer)
         Process an execution asynchronously.
    any processSync(any event, any interceptData, any buffer)
         Process an execution synchronously.
    any register(any interceptorKey, any interceptor, any interceptorMD)
         Register an interceptor class with this state.
    any setController(any controller)
    any setMetadataMap(any metadataMap)
    any unregister(any interceptorKey)
         Unregister an interceptor class from this state.
     
    Methods inherited from class coldbox.system.core.events.EventPool
    getObject, getPool, getState, setPool, setState
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init(any state, any logbox, any controller)

    Constructor

    Parameters:
    state - The interception state to model
    logbox - LogBox reference
    controller - The ColdBox Controller

    Property Detail

    controller

    property any controller

    Controller reference

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

    metadataMap

    property any metadataMap

    Metadata map for objects

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

    Method Detail

    exists

    public any exists(any interceptorKey)

    Checks if the passed interceptor key already exists

    Overrides:
    exists in class EventPool
    Parameters:
    interceptorKey - The interceptor key class to verify it exists

    getController

    public string getController()


    getInterceptor

    public any getInterceptor(any interceptorKey)

    Get an interceptor from this state. Else return a blank structure if not found

    Parameters:
    interceptorKey - The interceptor key class to retrieve

    getInterceptors

    public any getInterceptors()

    Get the interceptors linked hash map


    getMetadataMap

    public any getMetadataMap([any interceptorKey])

    Return the state's metadata map for it's registered interecptors

    Parameters:
    interceptorKey - Pass a key and retrieve that interceptor's metadata map only

    invoker

    private any invoker(any interceptor, any event, any interceptData, any interceptorKey, any buffer)

    Execute an interceptor execution point asynchronously

    Overrides:
    invoker in class EventPool
    Parameters:
    interceptor - The interceptor
    event - The event context object.
    interceptData - A data structure used to pass intercepted information.
    interceptorKey - The interceptor key to invoke
    buffer - hint="The request buffer object that can be used to produce output from interceptor chains

    invokerAsync

    private any invokerAsync(any event, any interceptData, any interceptorKey, [any asyncPriority='NORMAL'], any buffer)

    Execute an interceptor execution point asynchronously

    Parameters:
    event - The event context object.
    interceptData - A data structure used to pass intercepted information.
    interceptorKey - The interceptor key to invoke
    asyncPriority - The thread priority for execution
    buffer - hint="The request buffer object that can be used to produce output from interceptor chains

    isExecutable

    public boolean isExecutable(any target, any event, any targetKey)

    Checks if an interceptor is executable or not. Boolean

    Parameters:
    target - The target interceptor to check
    event - The event context
    targetKey - The target interceptor key

    process

    public any process(any event, any interceptData, [boolean async='false'], [boolean asyncAll='false'], [boolean asyncAllJoin='true'], [string asyncPriority='NORMAL'], [numeric asyncJoinTimeout='0'], any buffer)

    Process this state's interceptors. If you use the asynchronous facilities, you will get a thread structure report as a result

    Overrides:
    process in class EventPool
    Parameters:
    event - The event context object.
    interceptData - A data structure used to pass intercepted information.
    async - If true, the entire interception chain will be ran in a separate thread.
    asyncAll - If true, each interceptor in the interception chain will be ran in a separate thread and then joined together at the end.
    asyncAllJoin - If true, each interceptor in the interception chain will be ran in a separate thread and joined together at the end by default. If you set this flag to false then there will be no joining and waiting for the threads to finalize.
    asyncPriority - The thread priority to be used. Either LOW, NORMAL or HIGH. The default value is NORMAL
    asyncJoinTimeout - The timeout in milliseconds for the join thread to wait for interceptor threads to finish. By default there is no timeout.
    buffer - hint="The request buffer object that can be used to produce output from interceptor chains

    processAsync

    public any processAsync(any event, any interceptData, [string asyncPriority='NORMAL'], any buffer)

    Process an execution asynchronously

    Parameters:
    event - The event context object.
    interceptData - A data structure used to pass intercepted information.
    asyncPriority - The thread priority to be used. Either LOW, NORMAL or HIGH. The default value is NORMAL
    buffer - hint="The request buffer object that can be used to produce output from interceptor chains

    processAsyncAll

    public any processAsyncAll(any event, any interceptData, [boolean asyncAllJoin='true'], [string asyncPriority='NORMAL'], [numeric asyncJoinTimeout='0'], any buffer)

    Process an execution asynchronously

    Parameters:
    event - The event context object.
    interceptData - A data structure used to pass intercepted information.
    asyncAllJoin - If true, each interceptor in the interception chain will be ran in a separate thread and joined together at the end by default. If you set this flag to false then there will be no joining and waiting for the threads to finalize.
    asyncPriority - The thread priority to be used. Either LOW, NORMAL or HIGH. The default value is NORMAL
    asyncJoinTimeout - The timeout in milliseconds for the join thread to wait for interceptor threads to finish. By default there is no timeout.
    buffer - hint="The request buffer object that can be used to produce output from interceptor chains

    processSync

    public any processSync(any event, any interceptData, any buffer)

    Process an execution synchronously

    Parameters:
    event - The event context object.
    interceptData - A data structure used to pass intercepted information.
    buffer - hint="The request buffer object that can be used to produce output from interceptor chains

    register

    public any register(any interceptorKey, any interceptor, any interceptorMD)

    Register an interceptor class with this state

    Overrides:
    register in class EventPool
    Parameters:
    interceptorKey - The interceptor key class to register
    interceptor - The interceptor reference from the cache.
    interceptorMD - The interceptor state metadata.

    setController

    public any setController(any controller)

    Parameters:
    controller

    setMetadataMap

    public any setMetadataMap(any metadataMap)

    Parameters:
    metadataMap

    unregister

    public any unregister(any interceptorKey)

    Unregister an interceptor class from this state

    Overrides:
    unregister in class EventPool
    Parameters:
    interceptorKey - The interceptor key class to register