Class HostSessionProps

  • All Implemented Interfaces:
    EventListener, IGProp<java.lang.Object>, java.lang.Cloneable

    public class HostSessionProps
    extends GProp<java.lang.Object>
    This property handles communication between the server and client in full duplex using Transaction's. It is NOT persistent.
    Christopher Mindus
    • Constructor Detail

      • HostSessionProps

        public HostSessionProps()
        Creates the HostSessionProps property without a name. The name must be set in all cases using the setPropertyAtom call.
      • HostSessionProps

        public HostSessionProps​(Atom propertyAtom)
        Creates the HostSessionProps property with the specified name. All system-reserved names for components begins with "$".
        propertyAtom - the name of the component, unique within it's parent.
    • Method Detail

      • clone

        public HostSessionProps clone()
                               throws java.lang.CloneNotSupportedException
        Clones the property is NOT ALLOWED, thus a CloneNotSupportedException is always thrown.
        clone in class GProp<java.lang.Object>
        java.lang.CloneNotSupportedException - Always thrown.
      • validatePropType

        public void validatePropType​(java.lang.Object newValue)
                              throws PropTypeException
        Validates the newValue against the property object type. Subclasses must override this method to perform optional value type validation.

        Note: When this method is called, synchronization is done at the property itself, so no synchronization on the tree should be done.

        Specified by:
        validatePropType in interface IGProp<java.lang.Object>
        Specified by:
        validatePropType in class GProp<java.lang.Object>
        newValue - The new value to set.
        PropTypeException - when the new value isn't of the correct class.
      • getValueClasses

        public java.lang.Class<?>[] getValueClasses()
        Gets the list of possible native Java classes that can be used to set a value using setPropertyValue, in order of importance. Only one is supported, the Object class.
        Specified by:
        getValueClasses in interface IGProp<java.lang.Object>
        Specified by:
        getValueClasses in class GProp<java.lang.Object>
        An array Java class of length 1 containing the Object class.
      • getPropValue0

        protected java.lang.Object getPropValue0​(java.lang.Object value,
                                                 int index)
        Description copied from class: GProp
        Gets the property value in another class form than the "native" one. This method tries conversion of a "native" property value into another class type. This method is used when filling in a POJO variable (Plain Old Java Object Field) from a "native" property value.

        Subclasses overrides this method getPropertyValue0 in order to provide the appropriate conversion.

        Specified by:
        getPropValue0 in class GProp<java.lang.Object>
        value - The property value.
        index - The index in the Class array returned by getValueClasses().
        The property value in the requested class, after conversion.
      • toNativeValue0

        protected java.lang.Object toNativeValue0​(java.lang.Object value,
                                                  int index)
        Description copied from class: GProp
        Tries conversion of possibly accepted properties values using the setPropertyValue method into the most preferred property value type. If the input value already is of the preferred type, the same object is returned.

        Subclasses overrides the method toNativeValue0 in order to provide the appropriate conversion.

        Specified by:
        toNativeValue0 in class GProp<java.lang.Object>
        value - The input value to convert to native value.
        index - The index in the array returned by getValueClasses(), or -1 if not found.
        The converted input value in the preferred property value object type.
      • addPreSendListener

        public void addPreSendListener​(IPreSendHostSessionProps listener)
        Adds a pre-send event listener.
        listener - The listener.
      • removePreSendListener

        public void removePreSendListener​(IPreSendHostSessionProps listener)
        Removes a pre-send event listener.
        listener - The listener.
      • flagEvent

        public void flagEvent()
        Flag this property value as changed.
      • appendPropValue

        protected void appendPropValue​(PropMgr propertyManager,
                                       SendTransaction trans,
                                       java.lang.Object value)
        Appends the property value and all its children to a transaction using the AtomManager.
        Specified by:
        appendPropValue in class GProp<java.lang.Object>
        propertyManager - the property manager instance.
        trans - transaction to append the properties to.
        value - the value to append to the transaction, a reference to the current property value.
      • initializeValue

        public boolean initializeValue​(PropMgr propertyManager,
                                       ReadTransaction trans)
                                throws PropException
        Initializes the property value from a transaction.
        Specified by:
        initializeValue in class GProp<java.lang.Object>
        propertyManager - the property manager.
        trans - the transaction to initialize the property with.
        true if any data has been added, false otherwise.
        PropException - In case of transaction error.
      • get

        public ReadTransaction get()
        Gets the next read-transaction.
        A transaction to process or null if no more transactions are present.
      • add

        public void add​(SendTransaction trans)
        Queues a transaction for execution on the remote side whenever possible.
        trans - The transaction to perform.