01: /*
02: * ============================================================================
03: * GNU Lesser General Public License
04: * ============================================================================
05: *
06: * JasperReports - Free Java report-generating library.
07: * Copyright (C) 2005 Works, Inc. http://www.works.com/
08: *
09: * This library is free software; you can redistribute it and/or
10: * modify it under the terms of the GNU Lesser General Public
11: * License as published by the Free Software Foundation; either
12: * version 2.1 of the License, or (at your option) any later version.
13: *
14: * This library is distributed in the hope that it will be useful,
15: * but WITHOUT ANY WARRANTY; without even the implied warranty of
16: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17: * Lesser General Public License for more details.
18: *
19: * You should have received a copy of the GNU Lesser General Public
20: * License along with this library; if not, write to the Free Software
21: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
22: *
23: * Works, Inc.
24: * 6034 West Courtyard Drive
25: * Suite 210
26: * Austin, TX 78730-5032
27: * USA
28: * http://www.works.com/
29: */
30:
31: /*
32: * Licensed to JasperSoft Corporation under a Contributer Agreement
33: */
34: package net.sf.jasperreports.engine;
35:
36: /**
37: * @author John Bindel
38: * @version $Id: JRVirtualizer.java 1254 2006-05-15 08:57:30Z lucianc $
39: * @see net.sf.jasperreports.engine.JRVirtualizationHelper
40: */
41: public interface JRVirtualizer {
42: /**
43: * Lets this virtualizer know that it must track the object.<p>
44: *
45: * All virtualizable object must register with their virtualizer
46: * upon construction.
47: */
48: void registerObject(JRVirtualizable o);
49:
50: /**
51: * Lets this virtualizer know that it no longer must track the
52: * object.
53: */
54: void deregisterObject(JRVirtualizable o);
55:
56: /**
57: * Lets the virtualizer know that this object is still being used.
58: * This should be called to help the virtualizer determine which
59: * objects to keep in its cache, and which objects to page-out
60: * when it must do some paging-out.<p>
61: *
62: * The virtualizer gets to decide what type of caching strategy
63: * it will use.
64: */
65: void touch(JRVirtualizable o);
66:
67: /**
68: * Called when the virtual object must be paged-in.
69: * <p>
70: * If the object's virtual data is not paged-out, the object will only be
71: * {@link #touch(JRVirtualizable) touched}.
72: */
73: void requestData(JRVirtualizable o);
74:
75: /**
76: * Called when the virtual object paged-out data should be freed.
77: * <p>
78: * If the object's virtual data is not paged-out, the object will only be
79: * {@link #touch(JRVirtualizable) touched}.
80: */
81: void clearData(JRVirtualizable o);
82:
83: /**
84: * Called when the virtual object should be paged-out.
85: */
86: void virtualizeData(JRVirtualizable o);
87:
88: /**
89: * Called when we are done with the virtualizer and wish to
90: * cleanup any resources it has.
91: */
92: void cleanup();
93:
94: }
|