KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > jasperreports > engine > JRVirtualizer


1 /*
2  * ============================================================================
3  * GNU Lesser General Public License
4  * ============================================================================
5  *
6  * JasperReports - Free Java report-generating library.
7  * Copyright (C) 2005 Works, Inc. http://www.works.com/
8  *
9  * 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 /**
38  * @author John Bindel
39  * @version $Id: JRVirtualizer.java 1254 2006-05-15 11:57:30 +0300 (Mon, 15 May 2006) lucianc $
40  * @see net.sf.jasperreports.engine.JRVirtualizationHelper
41  */

42 public interface JRVirtualizer
43 {
44     /**
45      * Lets this virtualizer know that it must track the object.<p>
46      *
47      * All virtualizable object must register with their virtualizer
48      * upon construction.
49      */

50     void registerObject(JRVirtualizable o);
51
52     /**
53      * Lets this virtualizer know that it no longer must track the
54      * object.
55      */

56     void deregisterObject(JRVirtualizable o);
57
58     /**
59      * Lets the virtualizer know that this object is still being used.
60      * This should be called to help the virtualizer determine which
61      * objects to keep in its cache, and which objects to page-out
62      * when it must do some paging-out.<p>
63      *
64      * The virtualizer gets to decide what type of caching strategy
65      * it will use.
66      */

67     void touch(JRVirtualizable o);
68
69     /**
70      * Called when the virtual object must be paged-in.
71      * <p>
72      * If the object's virtual data is not paged-out, the object will only be
73      * {@link #touch(JRVirtualizable) touched}.
74      */

75     void requestData(JRVirtualizable o);
76
77     /**
78      * Called when the virtual object paged-out data should be freed.
79      * <p>
80      * If the object's virtual data is not paged-out, the object will only be
81      * {@link #touch(JRVirtualizable) touched}.
82      */

83     void clearData(JRVirtualizable o);
84
85     /**
86      * Called when the virtual object should be paged-out.
87      */

88     void virtualizeData(JRVirtualizable o);
89     
90     /**
91      * Called when we are done with the virtualizer and wish to
92      * cleanup any resources it has.
93      */

94     void cleanup();
95     
96 }
97
Popular Tags