Interface ProvidedObject

All Known Implementing Classes:
ProvidedObjectImpl

public interface ProvidedObject
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Signals the provided object to delete itself.
    Returns the ID of this Provided Object
    Returns the label of this provided object
    Same as calling getObject(true);
    getObject(boolean waitIfFuture)
    Returns the object stored in this provided object.
    Returns the type of the object contained in this Provided Object.
    boolean
    Returns whether or not this object has been deleted.
    void
    Sets the label of this provided object to the new label.
    void
    setObject(Object object)
    Changes the content of this provided object by replacing the original object with the new object.
  • Method Details

    • getID

      Returns the ID of this Provided Object
      Returns:
    • getLabel

      String getLabel()
      Returns the label of this provided object
      Returns:
    • setLabel

      void setLabel(String label) throws ProvidedObjectDeletedException
      Sets the label of this provided object to the new label.
      Parameters:
      label - the new label of the object
      Throws:
      ProvidedObjectDeletedException - If the object was removed from memory because there were no useful references to it anymore
    • getObject

      Object getObject(boolean waitIfFuture) throws ProvidedObjectDeletedException
      Returns the object stored in this provided object. If the object is not an instance of ProMFuture, then the object itself is returned. Otherwise, it depends on the parameter whether the ProMFuture is returned, or the calling thread is blocked until the future finished (or is cancelled)
      Parameters:
      waitIfFuture - if set to false, the returned object might be an instance of ProMFuture. Otherwise not.
      Returns:
      Throws:
      ProvidedObjectDeletedException - If the object was removed from memory because there were no useful references to it anymore
    • getObject

      Same as calling getObject(true);
      Returns:
      Throws:
      ProvidedObjectDeletedException - If the object was removed from memory because there were no useful references to it anymore
    • setObject

      void setObject(Object object) throws ProvidedObjectDeletedException
      Changes the content of this provided object by replacing the original object with the new object. This can only be done if the current object has not been deleted yet.
      Parameters:
      object -
      Throws:
      ProvidedObjectDeletedException - If the object was removed from memory because there were no useful references to it anymore
    • isDeleted

      boolean isDeleted()
      Returns whether or not this object has been deleted. Note that if this method returns false, no ProvidedObjectDeletedExceptions are thrown in subsequent, synchronized calls to this provided object.
      Returns:
    • deleteObject

      void deleteObject()
      Signals the provided object to delete itself. After calling this method, isDeleted() will return true and where applicable, ProvidedObjectDeletedExceptions will be thrown.
    • getType

      Returns the type of the object contained in this Provided Object. If the internal object is a ProMFuture, then the result type of the future is returned, i.e. ProMFuture.class is never returned by this method.
      Returns:
      Throws:
      ProvidedObjectDeletedException - If the object was removed from memory because there were no useful references to it anymore