Class FinalizeTrigger


  • public class FinalizeTrigger
    extends java.lang.Object
    To use finalizers on PyObjects, read the documentation of FinalizablePyObject.
    • Field Detail

      • NOT_FINALIZABLE_FLAG

        public static final byte NOT_FINALIZABLE_FLAG
        Indicates that the underlying PyObject was never intended to be finalized. It is actually not finalizable and the trigger only exists to notify gc that the underlying object was finalized. This is needed for some advanced gc-functionality.
        See Also:
        Constant Field Values
      • FINALIZED_FLAG

        public static final byte FINALIZED_FLAG
        Indicates that this trigger was already finalized.
        See Also:
        Constant Field Values
      • factory

        public static FinalizeTriggerFactory factory
        This factory hook is reserved for use by JyNI. It allows to replace the default FinalizeTrigger. JyNI needs it to support garbage collection.
      • flags

        public byte flags
    • Method Detail

      • hasActiveTrigger

        public static boolean hasActiveTrigger​(PyObject obj)
      • isFinalizable

        public static boolean isFinalizable​(PyObject obj)
      • ensureFinalizer

        public static void ensureFinalizer​(PyObject resurrect)
        Recreates the FinalizeTrigger of the given object. This makes sure that once the resurrected object is gc'ed again, its __del__-method will be called again.
      • runFinalizer

        public static void runFinalizer​(PyObject toFinalize)
      • runFinalizer

        public static void runFinalizer​(PyObject toFinalize,
                                        boolean runBuiltinOnly)
      • appendFinalizeTriggerForBuiltin

        public static void appendFinalizeTriggerForBuiltin​(PyObject obj)
      • clear

        public void clear()
      • trigger

        public void trigger​(PyObject toFinalize)
      • isActive

        public boolean isActive()
      • performFinalization

        public void performFinalization()
      • isFinalized

        public boolean isFinalized()