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: /**
27: *
28: * This interface indicates to the EventHandler that
29: * its implementers should be retained in memory rather
30: * than instantiated with each invocation.
31: *
32: * @author <a href="mailto:robertj@morris.net">Robert J. Morris</a>
33: *
34: * @see org.swingml.event.InvokableEventHandler
35: * @see org.swingml.event.EventHandler
36: * @see org.swingml.event.ExternalEventManager
37: */
38: public interface RetainedInMemory {
39: public static int MEM_VOLATILE = 0;
40: public static int MEM_GLOBAL = 1;
41: public static int MEM_DOCUMENT = 2;
42:
43: /**
44: * Returns one of the following values to the
45: * ExternalEventManager indicating how the implementing
46: * object should be stored:
47: *
48: * MEM_VOLATILE - Only Keep this object for each invocation. Otherwise
49: * release it.
50: *
51: * MEM_GLOBAL - Keep this object in the global cache, available for all
52: * documents to use.
53: *
54: * MEM_DOCUMENT - Keep this object in the document-level cache. Objects
55: * in the document-level cache are released when their associated document
56: * goes out of scope.
57: *
58: * @return An int indicating how the ExternalEventManager
59: * should retain this instance in memory.
60: *
61: * @see org.swingml.event.ExternalEventManager
62: */
63: public int retainInMemory();
64: }
|