01: /**
02: * Copyright (C) 2007 NetMind Consulting Bt.
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 3 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 Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: */package hu.netmind.persistence;
18:
19: import java.util.*;
20: import hu.netmind.persistence.parser.*;
21:
22: /**
23: * A container class which can be used with the container handler must
24: * implement this interface.
25: * @author Brautigam Robert
26: * @version CVS Revision: $Revision$
27: */
28: public interface Container {
29: /**
30: * Clear all values in this container.
31: */
32: void clear();
33:
34: /**
35: * Retain all container elements inside the other container.
36: */
37: boolean retainAll(Object c);
38:
39: /**
40: * Add all items in the other container.
41: */
42: boolean addAll(Object c);
43:
44: /**
45: * Get the items' classname.
46: */
47: String getItemClassName();
48:
49: /**
50: * Get the size of the container.
51: */
52: int size();
53:
54: /**
55: * Returns whether the container changes internally since last save().
56: */
57: boolean hasChanged();
58:
59: /**
60: * Save the container to database.
61: */
62: void save(Transaction transaction, Long currentSerial,
63: Set waitingObjects, List events);
64:
65: /**
66: * Reload container from database. This will free any
67: * resources and current yet not saved modifications.
68: */
69: void reload();
70:
71: /**
72: * Get the serial number of last modification.
73: */
74: Long getLastSerial();
75:
76: /**
77: * Initialize impl.
78: */
79: void init(StoreContext context, ClassInfo classInfo, Object obj,
80: String attributeName, String itemClassName,
81: Long lastSerial, TimeControl timeControl);
82: }
|