coldbox.system.remote

Class ColdboxProxy

lucee.Component
    extended by coldbox.system.remote.ColdboxProxy

Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp www.ortussolutions.com --- This object is a proxy object that can be used by components to tap into ColdBox MVC. It can be used when building RESTful/SOAP/Services or ORM Event handling,etc. It's intent is to provide a way for ANY cfc to talk to a running ColdBox application or even start one up.

Class Attributes:
  • synchronized : false
  •  
  • accessors : true
  •  
  • persistent : false
  •  
  • serializable : false
  •  
  • author : Luis Majano
  •  
    Property Summary
    type property default serializable required
    any COLDBOX_APP_KEY
          Internal key used to track the location in the application scope.

    • access = public
    • returntype = any
    true false
    Method Summary
    private boolean announce(any state, [struct data='[runtime expression]'])
         Announce an interception.
    private any announceInterception(any state, [struct interceptData='[runtime expression]'], [boolean async='false'], [boolean asyncAll='false'], [boolean asyncAllJoin='true'], [any asyncPriority='NORMAL'], [numeric asyncJoinTimeout='0'])
    string getCOLDBOX_APP_KEY()
    private any getCache([string cacheName='default'])
         Get a CacheBox Cache Provider.
    private any getCacheBox()
         Get the running app CacheBox instance.
    private any getColdboxAppKey()
         Get the ColdBox app key used in the application scope.
    private any getController()
         Get the running ColdBox Controller instance.
    private any getInstance([any name], [struct initArguments='[runtime expression]'], [any dsl], [any targetObject=''], [any injector])
         Locates, Creates, Injects and Configures an object model instance.
    private any getInterceptor([string interceptorName], [boolean deepSearch='false'])
         Get an interceptor.
    private any getLogBox()
         Get the running app LogBox instance.
    private any getLogger(any category)
         Get a named logger reference.
    private any getRemotingUtil()
         Get a reference to the ColdBox Remoting utility class.
    private any getRootLogger()
         Get the running app root logger instance.
    private any getUtil()
         Create and return the ColdBox utility object.
    private any getWireBox()
         Get the running app WireBox instance.
    private void handleException(any exceptionObject)
         Handle a ColdBox Proxy Exception.
    private void loadColdbox(string appMapping, [string configLocation=''], [boolean reloadApp='false'], string appKey='[runtime expression]')
         Load a coldbox application, and place the coldbox controller in application scope for usage.
    private any process()
         Process a remote call into ColdBox's event model and return data/objects back.
    private any selfAutoWire()
         Autowire the proxy on creation.
    any setCOLDBOX_APP_KEY(any COLDBOX_APP_KEY)
    private boolean verifyColdBox([boolean throwOnNotExist='true'])
         Verify the coldbox app exists in application scope.
     
    Methods inherited from class lucee.Component
    None

    Property Detail

    COLDBOX_APP_KEY

    property any COLDBOX_APP_KEY

    Internal key used to track the location in the application scope

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

    Method Detail

    announce

    private boolean announce(any state, [struct data='[runtime expression]'])

    Announce an interception

    Parameters:
    state - The interception state to announce
    data - A data structure used to pass intercepted information.

    announceInterception Deprecated

    private any announceInterception(any state, [struct interceptData='[runtime expression]'], [boolean async='false'], [boolean asyncAll='false'], [boolean asyncAllJoin='true'], [any asyncPriority='NORMAL'], [numeric asyncJoinTimeout='0'])

    Deprecated:
    Please use the new `emit()` function
    Parameters:
    state
    interceptData
    async
    asyncAll
    asyncAllJoin
    asyncPriority
    asyncJoinTimeout

    getCOLDBOX_APP_KEY

    public string getCOLDBOX_APP_KEY()


    getCache

    private any getCache([string cacheName='default'])

    Get a CacheBox Cache Provider

    Parameters:
    cacheName

    getCacheBox

    private any getCacheBox()

    Get the running app CacheBox instance


    getColdboxAppKey

    private any getColdboxAppKey()

    Get the ColdBox app key used in the application scope.


    getController

    private any getController()

    Get the running ColdBox Controller instance

    Throws:
    ControllerIllegalState - If app not found

    getInstance

    private any getInstance([any name], [struct initArguments='[runtime expression]'], [any dsl], [any targetObject=''], [any injector])

    Locates, Creates, Injects and Configures an object model instance

    Parameters:
    name - The mapping name or CFC instance path to try to build up
    initArguments - The constructor structure of arguments to passthrough when initializing the instance
    dsl - The dsl string to use to retrieve the instance model object, mutually exclusive with 'name
    targetObject - The object requesting the dependency, usually only used by DSL lookups
    injector - The child injector to use when retrieving the instance
    Returns:
    The requested instance
    Throws:
    InvalidChildInjector - When you request an instance from an invalid child injector name

    getInterceptor

    private any getInterceptor([string interceptorName], [boolean deepSearch='false'])

    Get an interceptor

    Parameters:
    interceptorName
    deepSearch

    getLogBox

    private any getLogBox()

    Get the running app LogBox instance


    getLogger

    private any getLogger(any category)

    Get a named logger reference.

    Parameters:
    category - The category name to use in this logger or pass in the target object will log from and we will inspect the object and use its metadata name

    getRemotingUtil

    private any getRemotingUtil()

    Get a reference to the ColdBox Remoting utility class

    Returns:
    coldbox.system.remote.RemotingUtil

    getRootLogger

    private any getRootLogger()

    Get the running app root logger instance


    getUtil

    private any getUtil()

    Create and return the ColdBox utility object

    Returns:
    coldbox.system.core.util.Util

    getWireBox

    private any getWireBox()

    Get the running app WireBox instance


    handleException

    private void handleException(any exceptionObject)

    Handle a ColdBox Proxy Exception

    Parameters:
    exceptionObject - The exception object to handle

    loadColdbox

    private void loadColdbox(string appMapping, [string configLocation=''], [boolean reloadApp='false'], string appKey='[runtime expression]')

    Load a coldbox application, and place the coldbox controller in application scope for usage. If the application is already running, then it will not re-do it, unless you specify the reload argument or the application expired.

    Parameters:
    appMapping - The app to load via mapping
    configLocation - The config cfc to load else use by convention config/Coldboc.cfc
    reloadApp - To reload the app if running
    appKey - The running app key in application scope

    process

    private any process()

    Process a remote call into ColdBox's event model and return data/objects back.

    Returns:
    If no results where found, this method returns null/void
    Throws:
    ColdBoxProxy.NoEventDetected - When no passed even is incoming via arguments[ "event" ]

    selfAutoWire

    private any selfAutoWire()

    Autowire the proxy on creation. This references the super class only, we use cgi information to get the actual proxy component path


    setCOLDBOX_APP_KEY

    public any setCOLDBOX_APP_KEY(any COLDBOX_APP_KEY)

    Parameters:
    COLDBOX_APP_KEY

    verifyColdBox

    private boolean verifyColdBox([boolean throwOnNotExist='true'])

    Verify the coldbox app exists in application scope

    Parameters:
    throwOnNotExist
    Throws:
    ControllerIllegalState - If app not found and throwOnNotExist = true