ExecuteCommand

Package: MachII.framework.commands
Inherits from: framework.Command
An Command for executing a subroutine.

<!--- 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: Peter J. Farrell (peter@mach-ii.com) $Id: ExecuteCommand.cfc 625 2008-01-29 21:45:06Z peterfarrell $ Created version: 1.5.0 Updated version: 1.5.0 Notes: --->

Method Summary
public ExecuteCommand init(string subroutineName)

Used by the framework for initialization.

public boolean execute(Event event, EventContext eventContext)

Executes the command.

private string getSubroutineName()
private void setSubroutineName(string subroutineName)
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="true"
		hint="Executes the command.">
		<cfargument name="event" type="MachII.framework.Event" required="true" />
		<cfargument name="eventContext" type="MachII.framework.EventContext" required="true" />
		<cfreturn arguments.eventContext.executeSubroutine(getSubroutineName(), arguments.event) />
	</cffunction> 

getSubroutineName

private string getSubroutineName( )

Parameters:

Code:

	<cffunction name="getSubroutineName" access="private" returntype="string" output="false">
		<cfreturn variables.subroutineName />
	</cffunction> 

init

public ExecuteCommand init( string subroutineName )

Used by the framework for initialization.

Parameters:
string subroutineName

Code:

	<cffunction name="init" access="public" returntype="ExecuteCommand" output="false"
		hint="Used by the framework for initialization.">
		<cfargument name="subroutineName" type="string" required="true" />
		
		<cfset setSubroutineName(arguments.subroutineName) />
		
		<cfreturn this />
	</cffunction> 

setSubroutineName

private void setSubroutineName( string subroutineName )

Parameters:
string subroutineName

Code:

	<cffunction name="setSubroutineName" access="private" returntype="void" output="false">
		<cfargument name="subroutineName" type="string" required="true" />
		<cfset variables.subroutineName = arguments.subroutineName />
	</cffunction>