Class AbstractWComponent.WComponentRef

  • All Implemented Interfaces:
    WComponent, WebComponent, Serializable
    Enclosing class:
    AbstractWComponent

    public static final class AbstractWComponent.WComponentRef
    extends AbstractWComponent

    This class is used to hold a reference to the shared singleton instance of a wcomponent for the purpose of serialisation. Serialization of WComponent session information is tricky because of the separation of the session state data (the UIContext) and the shared application definition (the wcompontent stored in the UIRegistry). When serializing a UIContext, we don't want to serialize the entire shared application definition in each users session. The problem is that the data stored in the UIContext is keyed using the shared WComponent instances, so we must convert them all to references in order to prevent the entire application from being serialized.

    This extends WComponent in order to fulfil the readResolve contract, however it overrides writeObject/readObject to only write out the data needed to find the shared instance.

    Author:
    Yiannis Paschalidis
    See Also:
    Serialized Form
    • Constructor Detail

      • WComponentRef

        public WComponentRef​(String repositoryKey,
                             int[] nodeLocation)
        Creates a WComponentRef.
        Parameters:
        repositoryKey - the UIRegistry key under which the UI root component is registered.
        nodeLocation - the location of the component in the UI tree.
    • Method Detail

      • toString

        public String toString()
        Creates a String representation of this component; usually for debugging purposes.
        Overrides:
        toString in class AbstractWComponent
        Returns:
        a String representation of this component.