Class VSActionReference

All Implemented Interfaces:
EventListener, IGProp<String>, IPropReference, IReferencingGProp, Cloneable
Direct Known Subclasses:
VSActionActorParticipant

public class VSActionReference extends VSRelativeReference<VSAction>
The VirtualSpace Action Reference property class hold the relative reference to a VSAction instance.
Author:
Christopher Mindus
  • Constructor Details

    • VSActionReference

      public VSActionReference()
      Creates a VirtualSpace Action Reference property with no name and with a null value.
    • VSActionReference

      public VSActionReference(Atom propertyAtom)
      Creates a VirtualSpace Action Reference property with the specified name with a null value.
      Parameters:
      propertyAtom - the property atom.
    • VSActionReference

      public VSActionReference(Atom propertyAtom, String newValue)
      Creates a VirtualSpace Action Reference property with the specified name and value.
      Parameters:
      propertyAtom - the property atom.
      newValue - the new string value for the property.
  • Method Details

    • clone

      public VSActionReference clone()
      Overrides clone to clear existing parent listener.
      Overrides:
      clone in class VSRelativeReference<VSAction>
      Returns:
      A new cloned String property.
    • getCurrentListener

      protected IVSActionListener getCurrentListener()
      Gets the current listener, i.e. the parent property.
      Returns:
      The current listener, or null for none.
    • getPropertyClass

      public Class<? extends GProp<?>> getPropertyClass()
      Gets the class wanted.
      Specified by:
      getPropertyClass in class VSRelativeReference<VSAction>
    • getReferenceType

      public IPropReference.IRefType getReferenceType()
      Gets the reference Type.
      Specified by:
      getReferenceType in interface IPropReference
      Specified by:
      getReferenceType in interface IReferencingGProp
      Specified by:
      getReferenceType in class VSRelativeReference<VSAction>
      Returns:
      IPropReference.RefType.VSAction.
    • onResolved

      protected void onResolved(VSAction target)
      Called when the property reference has been resolved.
      Specified by:
      onResolved in class VSRelativeReference<VSAction>
      Parameters:
      target - The target reference.
    • onRemoved

      protected void onRemoved(VSAction oldTarget)
      Called when the property reference has been disposed of e.g. due to new reference or pure disposal of this property.
      Specified by:
      onRemoved in class VSRelativeReference<VSAction>
      Parameters:
      oldTarget - The old target reference.
    • invokeAction

      public String invokeAction(IClientSessionGyro clientGyro, GProp<?> trigger, boolean isRemote, IVSActionProcessComplete completeCallback)
      Invokes the action. The action is posted to the appropriate worker thread for execution, or run in a separate thread depending on settings.

      If not enabled or read-only, the method will fail with an error message. The same message will then also be logged as a warning,

      If this method is called from a Run Mode not being any of the Server Run Modes, the method will just log an informational message and return null

      Parameters:
      clientGyro - Client gyro to use, null to look-it up if needed from current thread.
      trigger - The trigger property, null for none.
      isRemote - Flag indicating that the reason for the action invocation is remote, i.e. from the Client.
      completeCallback - Called when complete (in the action execution thread), null for none.
      Returns:
      null for success, otherwise an error message. The return from this method may be done prior to completion of the TX process (use the completeCallback to monitor completion).
    • paramString

      protected String paramString()
      Returns the parameter string representing the state of this event. This string is useful for debugging. Subclasses adds extra information to the string by preceding it with a comma followed by the extra information.
      Overrides:
      paramString in class VSRelativeReference<VSAction>
      Returns:
      the parameter string of this event.