root/coldbox/trunk/src/system/beans/eventhandlerBean.cfc @ 823

Revision 823, 3.6 kB (checked in by lmajano, 6 years ago)

Almost there.

Line 
1<!-----------------------------------------------------------------------
2********************************************************************************
3Copyright 2005-2007 ColdBox Framework by Luis Majano and Ortus Solutions, Corp
4www.coldboxframework.com | www.luismajano.com | www.ortussolutions.com
5********************************************************************************
6Author   :      Luis Majano
7Date     :      June 30, 2006
8Description :
9        I model a ColdBox Event Handler
10
11Modification History:
12
13----------------------------------------------------------------------->
14<cfcomponent name="eventhandlerBean"
15                         hint="I model a ColdBox event handler"
16                         output="false">
17
18<!------------------------------------------- CONSTRUCTOR ------------------------------------------->
19
20        <cfscript>
21        variables.instance = structnew();
22        instance.invocationPath = "";
23        instance.handler = "";
24        instance.method = "";
25        </cfscript>
26
27
28        <!--- ************************************************************* --->
29
30        <cffunction name="init" access="public" returntype="coldbox.system.beans.eventhandlerBean" output="false">
31                <cfargument name="invocationPath" type="string" required="true" />
32                <cfset setInvocationPath(arguments.invocationPath)>
33                <cfreturn this >
34        </cffunction>
35
36<!------------------------------------------- PUBLIC ------------------------------------------->
37
38        <!--- ************************************************************* --->
39
40        <cffunction name="getMemento" access="public" returntype="any" output="false" hint="Get the memento">
41                <cfreturn variables.instance >
42        </cffunction>
43
44        <!--- ************************************************************* --->
45
46        <cffunction name="setmemento" access="public" returntype="void" output="false" hint="Set the memento">
47                <cfargument name="memento" type="struct" required="true">
48                <cfset variables.instance = arguments.memento>
49        </cffunction>
50
51        <!--- ************************************************************* --->
52
53        <cffunction name="getRunnable" access="public" returntype="any" output="false">
54                <cfreturn getInvocationPath() & "." & getHandler()>
55        </cffunction>
56
57        <!--- ************************************************************* --->
58
59        <cffunction name="setMethod" access="public" returntype="void" output="false">
60                <cfargument name="method" type="string" required="true" />
61                <cfset instance.method = arguments.method>
62        </cffunction>
63
64        <!--- ************************************************************* --->
65
66        <cffunction name="getMethod" access="public" returntype="any" output="false">
67                <cfreturn instance.method >
68        </cffunction>
69
70        <!--- ************************************************************* --->
71
72        <cffunction name="setHandler" access="public" returntype="void" output="false">
73                <cfargument name="handler" type="string" required="true" />
74                <cfset instance.handler = arguments.handler >
75        </cffunction>
76
77        <!--- ************************************************************* --->
78
79        <cffunction name="getHandler" access="public" returntype="any" output="false">
80                <cfreturn instance.handler >
81        </cffunction>
82
83        <!--- ************************************************************* --->
84
85        <cffunction name="setInvocationPath" access="public" returntype="void" output="false">
86                <cfargument name="InvocationPath" type="string" required="true" />
87                <cfset instance.InvocationPath = arguments.InvocationPath >
88        </cffunction>
89
90        <!--- ************************************************************* --->
91
92        <cffunction name="getInvocationPath" access="public" returntype="any" output="false">
93                <cfreturn instance.InvocationPath >
94        </cffunction>
95
96        <!--- ************************************************************* --->
97</cfcomponent>
Note: See TracBrowser for help on using the browser.