| Package: MachII.framework.commands |
| Inherits from: framework.EventCommand |
| An EventCommand for setting up an event mapping for an event handler. |
<!--- 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: EventMappingCommand.cfc 4352 2006-08-29 20:35:15Z pfarrell $ Created version: 1.0.0 Updated version: 1.1.0 ---> |
| Method Summary | |
|---|---|
| public EventMappingCommand |
init(string eventName, string mappingName)
Used by the framework for initialization. |
| public boolean |
execute(Event event, EventContext eventContext)
Executes the command. |
| private string | getEventName() |
| private string | getMappingName() |
| private void | setEventName(string eventName) |
| private void | setMappingName(string mappingName) |
| Methods inherited from framework.EventCommand: setParameter , getParameter , setParameters |
|---|
| 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" 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()) /> <cfreturn true /> </cffunction>
| getEventName |
|---|
private string getEventName( )
Parameters:
Code:
<cffunction name="getEventName" access="private" returntype="string" output="false"> <cfreturn variables.eventName /> </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 )
Used by the framework for initialization.
Parameters:
| string eventName |
| string mappingName |
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" /> <cfset setEventName(arguments.eventName) /> <cfset setMappingName(arguments.mappingName) /> <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>
| 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>