FinalizerHandler.java
1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* org.slf4j.Logger
* org.slf4j.LoggerFactory
*/
package com.day.util;
import com.day.util.Finalizer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Stack;
public class FinalizerHandler {
private static final Logger log;
private final Stack registered = new Stack();
public void registerObject(Finalizer object) {
this.registered.push(object);
}
public void unregister(Finalizer object) {
this.registered.remove(object);
}
public void unregisterAll() {
this.registered.clear();
}
public boolean isEmpty() {
return this.registered.isEmpty();
}
public void callFinalizers() {
while (!this.registered.isEmpty()) {
Finalizer fin = (Finalizer)this.registered.pop();
try {
fin.doFinalize();
}
catch (Throwable t) {
log.error("callFinalizers: Unexpected Exception/Error: {}", (Object)t.toString());
log.debug("dump", t);
}
}
}
static {
Class class_ = FinalizerHandler.class;
log = LoggerFactory.getLogger((Class)class_);
}
}