ColdBox Platform Version 3.7.0

coldbox.system.web.context
Class InterceptorState

WEB-INF.cftags.component
        extended by coldbox.system.core.events.EventPool
            extended by coldbox.system.web.context.InterceptorState

public class InterceptorState
extends EventPool

I am a pool of interceptors that can execute on a state or interception value.


Constructor Summary
init(any state, any logbox)
          constructor
 
Method Summary
 boolean exists(any interceptorKey)
          Checks if the passed interceptor key already exists
 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
private any invokerAsync(any event, any interceptData, any interceptorKey, [any asyncPriority='normal'])
          Execute an interceptor execution point asynchronously
 any 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
private any processAsync([any event], [any interceptData], [any asyncPriority='NORMAL'])
          Process an execution asynchronously
private any processAsyncAll([any event], [any interceptData], [any asyncAllJoin='true'], [any asyncPriority='NORMAL'], [any asyncJoinTimeout='0'], [any buffer])
          Process an execution asynchronously for each interceptor state
private 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 unregister(any interceptorKey)
          Unregister an interceptor class from this state
 
Methods inherited from class coldbox.system.core.events.EventPool
getObject, getPool, getState, setState
 
Methods inherited from class WEB-INF.cftags.component
 

Constructor Detail

init

public init(any state, any logbox)
constructor

Parameters:
state - The interception state I model
logbox - An instance of logbox
Method Detail

exists

public boolean 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

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

Overrides:
invoker in class EventPool
Parameters:
interceptor - The interceptor reference from cache
event - The event context
interceptData - A metadata structure used to pass intercepted information.
interceptorKey - The interceptor key to invoke
buffer - 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'])
Execute an interceptor execution point asynchronously

Parameters:
event - The event context
interceptData - A metadata structure used to pass intercepted information.
interceptorKey - The interceptor key to invoke
asyncPriority - The thread priority for the execution

isExecutable

public any 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 object.
targetKey - The target interceptor key to check.

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 - The request buffer object that can be used to produce output from interceptor chains

processAsync

private any processAsync([any event], [any interceptData], [any asyncPriority='NORMAL'])
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

processAsyncAll

private any processAsyncAll([any event], [any interceptData], [any asyncAllJoin='true'], [any asyncPriority='NORMAL'], [any asyncJoinTimeout='0'], [any buffer])
Process an execution asynchronously for each interceptor state

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 - The request buffer object that can be used to produce output from interceptor chains

processSync

private 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 - 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.

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 Unregister

ColdBox Platform Version 3.7.0