Class ProxyPropCnr

  • All Implemented Interfaces:
    EventListener, IGProp<GProp<?>[]>, IPropCnr, IProxyProp, java.lang.Cloneable

    public class ProxyPropCnr
    extends PropCnr
    implements IProxyProp
    The proxy property container class extends the standard property container and allows it to synchronize property states so that several clients can use the "same" property container and the communication mechanism.

    The proxy property does not transport private properties or properties with null values, or with errors, these properties are removed.

    Author:
    Christopher Mindus
    • Constructor Detail

      • ProxyPropCnr

        public ProxyPropCnr​(PropCnr source,
                            boolean allowTargetToSourceChanges,
                            boolean enableCommunication,
                            IProxyRemovedListener sourceRemoved)
        Creates the proxy property container.
        Parameters:
        source - The property container to proxy.
        allowTargetToSourceChanges - Flag indicating this target container proxy is allowed to set property values that is transported back to the source container.
        enableCommunication - Enable communication or not.
        sourceRemoved - Runnable called when source is removed, null for none.
      • ProxyPropCnr

        public ProxyPropCnr​(Atom alternateName,
                            PropCnr source,
                            boolean allowTargetToSourceChanges,
                            boolean enableCommunication,
                            IProxyRemovedListener sourceRemoved)
        Creates the proxy property container.
        Parameters:
        alternateName - Alternate name for proxied property.
        source - The property container to proxy.
        allowTargetToSourceChanges - Flag indicating this target container proxy is allowed to set property values that is transported back to the source container.
        enableCommunication - Enable communication or not.
        sourceRemoved - Runnable called when source is removed, null for none.
    • Method Detail

      • assignRootParent

        public void assignRootParent​(PropCnr root)
        Assigns a root parent proxying is done for e.g. Cast to Device when the root parent may change with a new module model.
        Parameters:
        root - The new root parent.
        Throws:
        java.lang.NullPointerException - If root is null.
      • getRootParent

        protected PropCnr getRootParent​(GProp<?> requestor)
        Gets the root container in the property tree.
        Overrides:
        getRootParent in class GProp<GProp<?>[]>
        Parameters:
        requestor - The requestor.
        Returns:
        PropCnr The root parent or null for none.
      • onPropDispose

        protected void onPropDispose()
        Property is disposed of.
        Overrides:
        onPropDispose in class PropCnr
      • getProxyClass

        public java.lang.Class<?> getProxyClass()
        Gets the "real" class to use when sending the property over a transaction.
        Specified by:
        getProxyClass in interface IProxyProp
        Returns:
        The class of the proxied class.
      • clone

        public PropCnr clone()
                      throws java.lang.CloneNotSupportedException
        ProxyPropCnr does not support cloning.
        Overrides:
        clone in class PropCnr
        Throws:
        java.lang.CloneNotSupportedException - Always thrown.
      • setUndo

        public void setUndo​(IProxyEditController controller)
        Sets the undo edit controller into for incoming transactions.
        Parameters:
        controller - The controller instance or null to remove undo support.
      • setDebug

        public void setDebug​(boolean on)
        Enables debugging output of operations.
      • getProxiedInterface

        public <T> T getProxiedInterface​(java.lang.Class<T> interfaze)
        Checks if the proxied property is instance of an interface.
        Specified by:
        getProxiedInterface in interface IProxyProp
        Parameters:
        interfaze - The interface.
        Returns:
        The proxy instance interface, or null if it is not implemented.