Class ProxyImpl

  • All Implemented Interfaces:
    EventListener

    public class ProxyImpl
    extends java.lang.Object
    implements EventListener
    Implementation of the proxy from a source container to a target container.

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

    Author:
    Christopher Mindus
    • Field Summary

      Fields 
      Modifier and TypeFieldDescription
      PropCnrsource
      The source property container.
      PropCnrtarget
      The target property container.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      voidassignOppositeProxy​(ProxyImpl oppositeProxy)
      Assigns the opposite proxy in case two directional updates is used.
      voiddispose()
      Disposes of the proxy implementation.
      voidonEvent​(GEvent e)
      Source events.
      voidsetDebug​(boolean on)
      Enables debugging output of operations.
      voidsyncSourceToTarget()
      Replicates the entire source to target structure for all properties that should be proxied.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • target

        public final PropCnr target
        The target property container.
      • source

        public final PropCnr source
        The source property container.
    • Constructor Detail

      • ProxyImpl

        public ProxyImpl​(PropCnr source,
                         PropCnr target,
                         IProxyRemovedListener sourceRemoved,
                         IProxyImplementor proxyImplementor)
        Constructs the proxy implementation.
        Parameters:
        source - The source property container.
        target - The target property container.
        sourceRemoved - Callback if the source is removed, null for none.
        proxyImplementor - The proxy implementor that decides which properties to proxy, null for none (i.e. all non-private properties).
    • Method Detail

      • assignOppositeProxy

        public void assignOppositeProxy​(ProxyImpl oppositeProxy)
        Assigns the opposite proxy in case two directional updates is used.
        Parameters:
        oppositeProxy - The opposite proxy implementation for target-to-source proxy.
      • setDebug

        public void setDebug​(boolean on)
        Enables debugging output of operations.
        Parameters:
        on - The debug flag.
      • dispose

        public void dispose()
        Disposes of the proxy implementation.
      • syncSourceToTarget

        public void syncSourceToTarget()
        Replicates the entire source to target structure for all properties that should be proxied.
      • onEvent

        public void onEvent​(GEvent e)
        Source events.
        Specified by:
        onEvent in interface EventListener
        Parameters:
        e - The event.