Class HostSessionProps

java.lang.Object
com.iizix.prop.GProp<Object>
com.iizix.term.prop.HostSessionProps
All Implemented Interfaces:
EventListener, IGProp<Object>, Cloneable

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

  • Constructor Details

    • 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 "$".
      Parameters:
      propertyAtom - the name of the component, unique within it's parent.
  • Method Details

    • clone

      Clones the property is NOT ALLOWED, thus a CloneNotSupportedException is always thrown.
      Overrides:
      clone in class GProp<Object>
      Throws:
      CloneNotSupportedException - Always thrown.
    • validatePropType

      public void validatePropType(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<Object>
      Specified by:
      validatePropType in class GProp<Object>
      Parameters:
      newValue - The new value to set.
      Throws:
      PropTypeException - when the new value isn't of the correct class.
    • getValueClasses

      public 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<Object>
      Specified by:
      getValueClasses in class GProp<Object>
      Returns:
      An array Java class of length 1 containing the Object class.
    • getPropValue0

      protected Object getPropValue0(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<Object>
      Parameters:
      value - The property value.
      index - The index in the Class array returned by getValueClasses().
      Returns:
      The property value in the requested class, after conversion.
    • toNativeValue0

      protected Object toNativeValue0(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<Object>
      Parameters:
      value - The input value to convert to native value.
      index - The index in the array returned by getValueClasses(), or -1 if not found.
      Returns:
      The converted input value in the preferred property value object type.
    • addPreSendListener

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

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

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

      protected void appendPropValue(PropMgr propertyManager, SendTransaction trans, Object value)
      Appends the property value and all its children to a transaction using the AtomManager.
      Specified by:
      appendPropValue in class GProp<Object>
      Parameters:
      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<Object>
      Parameters:
      propertyManager - the property manager.
      trans - the transaction to initialize the property with.
      Returns:
      true if any data has been added, false otherwise.
      Throws:
      PropException - In case of transaction error.
    • get

      public ReadTransaction get()
      Gets the next read-transaction.
      Returns:
      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.
      Parameters:
      trans - The transaction to perform.