Interface ProvidedObject
-
- All Known Implementing Classes:
ProvidedObjectImpl
public interface ProvidedObject
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
deleteObject()
Signals the provided object to delete itself.ProvidedObjectID
getID()
Returns the ID of this Provided Objectjava.lang.String
getLabel()
Returns the label of this provided objectjava.lang.Object
getObject()
Same as calling getObject(true);java.lang.Object
getObject(boolean waitIfFuture)
Returns the object stored in this provided object.java.lang.Class<?>
getType()
Returns the type of the object contained in this Provided Object.boolean
isDeleted()
Returns whether or not this object has been deleted.void
setLabel(java.lang.String label)
Sets the label of this provided object to the new label.void
setObject(java.lang.Object object)
Changes the content of this provided object by replacing the original object with the new object.
-
-
-
Method Detail
-
getID
ProvidedObjectID getID()
Returns the ID of this Provided Object- Returns:
-
getLabel
java.lang.String getLabel()
Returns the label of this provided object- Returns:
-
setLabel
void setLabel(java.lang.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
java.lang.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
java.lang.Object getObject() throws ProvidedObjectDeletedException
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(java.lang.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
java.lang.Class<?> getType() throws ProvidedObjectDeletedException
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
-
-