box.system.web.services.concurrent.Callable interface">
ColdBox Platform Version 3.1.0

coldbox.system.web.services
Class InterceptorService

WEB-INF.cftags.component
        extended by coldbox.system.web.services.BaseService
            extended by coldbox.system.web.services.InterceptorService

public class InterceptorService
extends BaseService

The coldbox interceptor service


Constructor Summary
init(any controller)
          Constructor
 
Method Summary
 void appendInterceptionPoints(string customPoints)
          Append a list of custom interception points to the CORE interception points
private any createInterceptor(string interceptorClass, [struct interceptorProperties='[runtime expression]'])
          Create an interceptor
 string getInterceptionPoints()
          Get the interceptionPoints ENUM of all registered points of execution
 struct getInterceptionStates()
          Get all the interception states defined in this service
 any getInterceptor([string interceptorName], [boolean deepSearch='false'])
          Get an interceptor according to its name from cache, not from a state
 any getRequestBuffer()
          Get a coldbox request buffer: coldbox
 any getStateContainer(string state)
          Get a State Container, it will return a blank structure if the state is not found
 void onConfigurationLoad()
          Called by loader service when configuration file loads
private struct parseMetadata(any metadata, struct points)
          I get a components valid interception points
 void processState(any state, [any interceptData='[runtime expression]'])
          Process an interception state announcement
private void registerInterceptionPoint(string interceptorKey, string state, any oInterceptor)
          Register an Interception point into a new or created interception state
 void registerInterceptor([string interceptorClass], [any interceptorObject], [struct interceptorProperties='[runtime expression]'], [string customPoints=''], [string interceptorName])
          Register an interceptor
 void registerInterceptors()
          Register all the interceptors according to configuration
 boolean unregister([any interceptorName], [any state=''])
          Unregister an interceptor from an interception state or all states
 
Methods inherited from class coldbox.system.web.services.BaseService
convertToColdBox, getColdboxOCM, getController, getUtil, isFamilyType, onAspectsLoad, onShutdown, setController
 
Methods inherited from class WEB-INF.cftags.component
 

Constructor Detail

init

public init(any controller)
Constructor

Parameters:
controller
Method Detail

appendInterceptionPoints

public void appendInterceptionPoints(string customPoints)
Append a list of custom interception points to the CORE interception points

Parameters:
customPoints - A comma delimmited list of custom interception points to append. If they already exists, then they will not be added again.

createInterceptor

private any createInterceptor(string interceptorClass, [struct interceptorProperties='[runtime expression]'])
Create an interceptor

Parameters:
interceptorClass - The class Path
interceptorProperties - The properties

getInterceptionPoints

public string getInterceptionPoints()
Get the interceptionPoints ENUM of all registered points of execution


getInterceptionStates

public struct getInterceptionStates()
Get all the interception states defined in this service


getInterceptor

public any getInterceptor([string interceptorName], [boolean deepSearch='false'])
Get an interceptor according to its name from cache, not from a state. If retrieved, it does not mean that the interceptor is registered still. It just means, that it is in cache. Use the deepSearch argument if you want to check all the interception states for the interceptor.

Parameters:
interceptorName - The name of the interceptor to search for
deepSearch - By default we search the cache for the interceptor reference. If true, we search all the registered interceptor states for a match.

getRequestBuffer

public any getRequestBuffer()
Get a coldbox request buffer: coldbox.system.core.util.RequestBuffer


getStateContainer

public any getStateContainer(string state)
Get a State Container, it will return a blank structure if the state is not found.

Parameters:
state - The state to retrieve

onConfigurationLoad

public void onConfigurationLoad()
Called by loader service when configuration file loads

Overrides:
onConfigurationLoad in class BaseService

parseMetadata

private struct parseMetadata(any metadata, struct points)
I get a components valid interception points

Parameters:
metadata - The recursive metadata
points - The active points

processState

public void processState(any state, [any interceptData='[runtime expression]'])
Process an interception state announcement

Parameters:
state - An interception state to process
interceptData - A data structure used to pass intercepted information.

registerInterceptionPoint

private void registerInterceptionPoint(string interceptorKey, string state, any oInterceptor)
Register an Interception point into a new or created interception state.

Parameters:
interceptorKey - The interceptor key in the cache.
state - The state to create
oInterceptor - The interceptor to register

registerInterceptor

public void registerInterceptor([string interceptorClass], [any interceptorObject], [struct interceptorProperties='[runtime expression]'], [string customPoints=''], [string interceptorName])
Register an interceptor. This method is here for runtime additions. If the interceptor is already in a state, it will not be added again. You can register an interceptor by class or with an already instantiated and configured object.

Parameters:
interceptorClass - Mutex with interceptorObject, this is the qualified class of the interceptor to register
interceptorObject - Mutex with interceptor Class, this is used to register an already instantiated object as an interceptor
interceptorProperties - The structure of properties to register this interceptor with.
customPoints - A comma delimmited list of custom interception points, if the object or class sent in observes them.
interceptorName - The name to use for the interceptor when stored. If not used, we will use the name found in the object's class

registerInterceptors

public void registerInterceptors()
Register all the interceptors according to configuration. All interception states are lazy loaded in.


unregister

public boolean unregister([any interceptorName], [any state=''])
Unregister an interceptor from an interception state or all states. If the state does not exists, it returns false

Parameters:
interceptorName - The name of the interceptor to search for
state - The named state to unregister this interceptor from. If not passed, then it will be unregistered from all states.

ColdBox Platform Version 3.1.0