01: /*
02: * All content copyright (c) 2003-2007 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.objectserver.impl;
05:
06: import com.tc.management.beans.object.ObjectManagementMonitor.GCComptroller;
07: import com.tc.objectserver.core.api.GarbageCollector;
08:
09: public class GCComptrollerImpl implements GCComptroller {
10:
11: private final ObjectManagerConfig config;
12: private final GarbageCollector collector;
13:
14: public GCComptrollerImpl(ObjectManagerConfig config,
15: GarbageCollector collector) {
16: this .config = config;
17: this .collector = collector;
18: }
19:
20: public boolean gcEnabledInConfig() {
21: return config.doGC();
22: }
23:
24: public boolean isGCStarted() {
25: return collector.isStarted();
26: }
27:
28: public boolean isGCDisabled() {
29: return collector.isDisabled();
30: }
31:
32: public void startGC() {
33: collector.gc();
34: }
35:
36: }
|