Looks up FinalizableReference.finalizeReferent() method.
()
| 169 | */ |
| 170 | |
| 171 | private Method getFinalizeReferentMethod() { |
| 172 | Class<?> finalizableReferenceClass = finalizableReferenceClassReference.get(); |
| 173 | if (finalizableReferenceClass == null) { |
| 174 | /* |
| 175 | * FinalizableReference's class loader was reclaimed. While there's a chance that other |
| 176 | * finalizable references could be enqueued subsequently (at which point the class loader |
| 177 | * would be resurrected by virtue of us having a strong reference to it), we should pretty |
| 178 | * much just shut down and make sure we don't keep it alive any longer than necessary. |
| 179 | */ |
| 180 | return null; |
| 181 | } |
| 182 | try { |
| 183 | return finalizableReferenceClass.getMethod("finalizeReferent"); |
| 184 | } catch (NoSuchMethodException e) { |
| 185 | throw new AssertionError(e); |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | |
| 190 | public static Field getInheritableThreadLocalsField() { |