| Package: MachII.framework.commands |
| Inherits from: framework.Command |
| An Command for setting up an event mapping for an event handler. |
<!--- License: Copyright 2008 GreatBizTools, LLC 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: GreatBizTools, LLC Author: Ben Edwards (ben@ben-edwards.com) $Id: EventMappingCommand.cfc 771 2008-05-11 03:20:54Z peterfarrell $ Created version: 1.0.0 Updated version: 1.5.0 Notes: ---> |
| Method Summary | |
|---|---|
| public EventMappingCommand |
init(string eventName, string mappingName, string mappingModule)
Used by the framework for initialization. |
| public boolean |
execute(Event event, EventContext eventContext)
Executes the command. |
| private string | getEventName() |
| private string | getMappingModule() |
| private string | getMappingName() |
| private void | setEventName(string eventName) |
| private void | setMappingModule(string mappingModule) |
| private void | setMappingName(string mappingName) |
| Methods inherited from framework.Command: getLog , setParameter , getPropertyManager , setParameters , setLog , setExpressionEvaluator , getExpressionEvaluator , getParameter , setPropertyManager |
|---|
| Method Detail |
|---|
| execute |
|---|
public boolean execute( Event event, EventContext eventContext )
Executes the command.
Parameters:
| Event event |
| EventContext eventContext |
Code:
<cffunction name="execute" access="public" returntype="boolean" output="false" hint="Executes the command."> <cfargument name="event" type="MachII.framework.Event" required="true" /> <cfargument name="eventContext" type="MachII.framework.EventContext" required="true" /> <cfset arguments.eventContext.setEventMapping(getEventName(), getMappingName(), getMappingModule()) /> <cfreturn true /> </cffunction>
| getEventName |
|---|
private string getEventName( )
Parameters:
Code:
<cffunction name="getEventName" access="private" returntype="string" output="false"> <cfreturn variables.eventName /> </cffunction>
| getMappingModule |
|---|
private string getMappingModule( )
Parameters:
Code:
<cffunction name="getMappingModule" access="private" returntype="string" output="false"> <cfreturn variables.mappingModule /> </cffunction>
| getMappingName |
|---|
private string getMappingName( )
Parameters:
Code:
<cffunction name="getMappingName" access="private" returntype="string" output="false"> <cfreturn variables.mappingName /> </cffunction>
| init |
|---|
public EventMappingCommand init( string eventName, string mappingName, string mappingModule )
Used by the framework for initialization.
Parameters:
| string eventName |
| string mappingName |
| string mappingModule |
Code:
<cffunction name="init" access="public" returntype="EventMappingCommand" output="false" hint="Used by the framework for initialization."> <cfargument name="eventName" type="string" required="true" /> <cfargument name="mappingName" type="string" required="true" /> <cfargument name="mappingModule" type="string" required="true" /> <cfset setEventName(arguments.eventName) /> <cfset setMappingName(arguments.mappingName) /> <cfset setMappingModule(arguments.mappingModule) /> <cfreturn this /> </cffunction>
| setEventName |
|---|
private void setEventName( string eventName )
Parameters:
| string eventName |
Code:
<cffunction name="setEventName" access="private" returntype="void" output="false"> <cfargument name="eventName" type="string" required="true" /> <cfset variables.eventName = arguments.eventName /> </cffunction>
| setMappingModule |
|---|
private void setMappingModule( string mappingModule )
Parameters:
| string mappingModule |
Code:
<cffunction name="setMappingModule" access="private" returntype="void" output="false"> <cfargument name="mappingModule" type="string" required="true" /> <cfset variables.mappingModule = arguments.mappingModule /> </cffunction>
| setMappingName |
|---|
private void setMappingName( string mappingName )
Parameters:
| string mappingName |
Code:
<cffunction name="setMappingName" access="private" returntype="void" output="false"> <cfargument name="mappingName" type="string" required="true" /> <cfset variables.mappingName = arguments.mappingName /> </cffunction>