| Package: MachII.framework |
| Inherits from: framework.BaseComponent |
| Base Listener component. |
<!--- License: Copyright 2006 Mach-II Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Copyright: Mach-II Corporation Author: Ben Edwards (ben@ben-edwards.com) $Id: Listener.cfc 4466 2006-09-15 16:43:50Z pfarrell $ Created version: 1.0.0 Updated version: 1.1.0 MachComponent: Base listener component Notes: All user-defined listeners extend this base listener component. - Added default invoker (pfarrell) ---> |
| Method Summary | |
|---|---|
| public Listener |
init(AppManager appManager, [struct parameters="#StructNew()#"], [ListenerInvoker invoker])
Used by the framework for initialization. Do not override. |
| public ListenerInvoker |
getDefaultInvoker()
Returns an instance of the default invoker (EventInvoker) for this Listener. |
| public any |
getInvoker()
Gets the ListenerInvoker to use when invoking methods for this Listener. |
| public void |
setInvoker(ListenerInvoker invoker)
Sets the ListenerInvoker to use when invoking methods for this Listener. |
| Methods inherited from framework.BaseComponent: isParameterDefined , setPropertyManager , setParameters , getPropertyManager , announceEvent , getAppManager , setAppManager , configure , hasParameter , getParameter , getProperty , getParameters , setProperty , setParameter |
|---|
| Method Detail |
|---|
| getDefaultInvoker |
|---|
public ListenerInvoker getDefaultInvoker( )
Returns an instance of the default invoker (EventInvoker) for this Listener.
Parameters:
Code:
<cffunction name="getDefaultInvoker" access="public" returntype="MachII.framework.ListenerInvoker" output="false"
hint="Returns an instance of the default invoker (EventInvoker) for this Listener.">
<cfreturn CreateObject('component', 'MachII.framework.invokers.EventInvoker').init() />
</cffunction>
| getInvoker |
|---|
public any getInvoker( )
Gets the ListenerInvoker to use when invoking methods for this Listener.
Parameters:
Code:
<cffunction name="getInvoker" access="public" type="MachII.framework.ListenerInvoker" output="false" hint="Gets the ListenerInvoker to use when invoking methods for this Listener."> <cfreturn variables.invoker /> </cffunction>
| init |
|---|
public Listener init( AppManager appManager, [struct parameters="#StructNew()#"], [ListenerInvoker invoker] )
Used by the framework for initialization. Do not override.
Parameters:
| AppManager appManager |
| [struct parameters="#StructNew()#"] |
| [ListenerInvoker invoker] |
Code:
<cffunction name="init" access="public" returntype="Listener" output="false" hint="Used by the framework for initialization. Do not override."> <cfargument name="appManager" type="MachII.framework.AppManager" required="true" /> <cfargument name="parameters" type="struct" required="false" default="#StructNew()#" /> <cfargument name="invoker" type="MachII.framework.ListenerInvoker" required="false" /> <cfset super.init(arguments.appManager, arguments.parameters) /> <cfif StructKeyExists(arguments, 'invoker')> <cfset setInvoker(arguments.invoker) /> </cfif> <cfreturn this /> </cffunction>
| setInvoker |
|---|
public void setInvoker( ListenerInvoker invoker )
Sets the ListenerInvoker to use when invoking methods for this Listener.
Parameters:
| ListenerInvoker invoker |
Code:
<cffunction name="setInvoker" access="public" returntype="void" output="false" hint="Sets the ListenerInvoker to use when invoking methods for this Listener."> <cfargument name="invoker" type="MachII.framework.ListenerInvoker" required="true" /> <cfset variables.invoker = arguments.invoker /> </cffunction>