Package com.iizix.api

Interface IInstanceLifecycleListener


  • public interface IInstanceLifecycleListener
    Interface that any Java class that is hooked into the framework can implement. It enables being called after virtualization has completed successfully, and when the instance is no longer needed due to disposal of the owner. This makes it possible for a class instance to use resources that can be freed up upon dispose and does not have to wait until garbage collection is run.

    The construction of an instance of this class is done during the virtualization phase of the owner property.

    Author:
    Christopher Mindus
    • Method Detail

      • onVirtualized

        void onVirtualized​(IAppSessionGyro appGyro,
                           IClientSessionGyro clientGyro,
                           VirtualSpace virtualSpace,
                           PropCnr virtualizedProp,
                           PropCnr owner)
        This method is called after the virtualization has completed and that all references, etc, are ready but before any kind of other action is done.
        Parameters:
        appGyro - The application gyro instance performing the virtualization.
        clientGyro - The client gyro session, can be null if not initialized from the client gyro.
        virtualSpace - The virtualized VirtualSpace.
        virtualizedProp - The property being virtualized, e.g. VirtualSpace, UIPanelBase or a data connector property.
        owner - The owner property container.
      • onDisposed

        void onDisposed​(PropCnr owner)
        Called when the virtualized owner property is disposed of, i.e. no longer used (e.g. client session closed, panel removed from virtual panels).

        Note: in case of failures in the virtualization process, the call to onVirtualized(IAppSessionGyro, IClientSessionGyro, VirtualSpace, PropCnr, PropCnr) may not have been done, so the assumption that "onVirtualized" has been called cannot be made.

        Parameters:
        owner - The owner property container. The owner may be null only in the case the ClassReference property holding this instance has been removed from it's parent programmatically (the framework does not perform such action).