01: /* SwingML
02: * Copyright (C) 2002 Robert Morris.
03: *
04: * This library is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 2 of the License, or (at your option) any later version.
08: *
09: * This library is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the
16: * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17: * Boston, MA 02111-1307, USA.
18: *
19: * Authors:
20: * Robert Morris <robertj@morris.net>
21: *
22: */
23:
24: package org.swingml.event;
25:
26: import java.awt.Component;
27:
28: /**
29: * Represents the basic functionality necessary to create a SwingML
30: * invokable event. An InvokableEvent is any Java class that provides
31: * event-driven functionality outside of that provided by the renderer.
32: *
33: * @author <a href="mailto:robertj@morris.net">Robert J. Morris</a>
34: *
35: * @see org.swingml.event.EventHandler
36: * @see org.swingml.event.ExternalEventManager
37: * @see org.swingml.event.RetainedInMemory
38: */
39: public interface InvokableEventHandler {
40: /**
41: * This method provides an initialization routine for an
42: * InvokableEvent implementation. This method is called upon
43: * every invocation of the event, regardless of whether or
44: * not the implementation is retained in memory.
45: *
46: * @param component A reference the component specified in the
47: * <EXTERNAL-ACTION> tag's COMPONENT attribute.
48: *
49: * @param params An array of ActionParamModel objects.
50: */
51: public void initialize(Component aComponent, Object[] parameters);
52:
53: /**
54: * This method provides the actual action performed by the
55: * InvokableEvent implementation. Called immediately after the
56: * initialize() method.
57: */
58: public void invoke();
59:
60: /**
61: * This method is called immediately after the completion of the
62: * invoke() method. This method should be used to release any
63: * allocated resource (database, files, etc) allocated during
64: * the initialize() or invoke() methods.
65: */
66: public void destroy();
67: }
|