01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.objectserver.core.api;
05:
06: import com.tc.object.ObjectID;
07: import com.tc.objectserver.api.GCStats;
08: import com.tc.objectserver.api.ObjectManagerEventListener;
09: import com.tc.text.PrettyPrintable;
10: import com.tc.util.concurrent.LifeCycleState;
11: import com.tc.util.concurrent.StoppableThread;
12:
13: import java.util.Collection;
14: import java.util.Set;
15:
16: public interface GarbageCollector extends PrettyPrintable {
17:
18: public void enableGC();
19:
20: public boolean disableGC();
21:
22: public boolean isDisabled();
23:
24: public boolean isPausingOrPaused();
25:
26: public boolean isPaused();
27:
28: /**
29: * Called by object manager. Notifies the garbage collector that it's ok to perform GC.
30: */
31: public void notifyReadyToGC();
32:
33: /**
34: * Request to pause when the system state stabalizes
35: */
36: public void requestGCPause();
37:
38: /**
39: * Called by the GC thread. Notifies the garbage collector has started deleting Garbage
40: */
41: public void notifyGCDeleteStarted();
42:
43: /**
44: * Called by the GC thread. Notifies the garbage collector that GC is complete.
45: */
46: public void notifyGCComplete();
47:
48: /**
49: * @param traverser Determines whether or not to traverse a given tree node.
50: * @param roots
51: * @param managedObjects
52: * @return An set on the objects that can be deleted
53: */
54: public Set collect(Filter traverser, Collection roots,
55: Set managedObjectIds);
56:
57: public Set collect(Filter traverser, Collection roots,
58: Set managedObjectIds, LifeCycleState state);
59:
60: public void changed(ObjectID changedObject, ObjectID oldReference,
61: ObjectID newReference);
62:
63: public void gc();
64:
65: public void addNewReferencesTo(Set rescueIds);
66:
67: public void start();
68:
69: public void stop();
70:
71: public boolean isStarted();
72:
73: public void setState(StoppableThread st);
74:
75: public void addListener(ObjectManagerEventListener listener);
76:
77: public GCStats[] getGarbageCollectorStats();
78: }
|