Interface Disposable

  • All Known Subinterfaces:
    Disposable.Disposedable


    public interface Disposable
    Any type not being a mature component, which nevertheless can be destroyed, implements this Disposable interface. This avoids the necessity to depend on the refcodes-component artifact. In addition the semantic distinction between a component in terms of refcodes-component and a plain old java class or bean is clear.

    ATTENTION: In case you intend to add support dispose() functionality to your mature components (in terms of refcodes-component), please implement the org.refcodes.component.Component interface with its org.refcodes.component.Destroyable#destroy() method.

    • Method Detail

      • dispose

        void dispose​()
        Disposes the implementing class's instance. The method DisposedAccessor.isDisposed() must then return true. Forces an object to be disposed. The programmer implementing this method has to take care that all objects are to be released which are referenced by the object implementing this interface and the GenericDisposeabelPublic interface. All references are to be set to a null pointer in order for the garbage collector to work more effectively. If this method has been called than the method isDisposed() in the interface GenericDisposeablePublic has to return true. If dispose() has been called, than ALL OTHER methods in the class implementing this interface and the corresponding interface GenericDisposeablePublic except the isDispoed() and the dispose() methods have to throw a DisposedPredictableException - the programmer implementing the interface has to take care of it.