Class ProvidedObjectImpl
- java.lang.Object
-
- org.processmining.framework.providedobjects.impl.ProvidedObjectImpl
-
- All Implemented Interfaces:
java.util.EventListener
,FutureListener
,NameChangeListener
,ProvidedObject
public class ProvidedObjectImpl extends java.lang.Object implements ProvidedObject, NameChangeListener, FutureListener
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.processmining.framework.plugin.events.FutureListener
FutureListener.ListenerList
-
Nested classes/interfaces inherited from interface org.processmining.framework.plugin.events.NameChangeListener
NameChangeListener.ListenerList
-
-
Constructor Summary
Constructors Constructor Description ProvidedObjectImpl(java.lang.String label, ProvidedObjectID id, T object, java.lang.Class<? super T> type, ProvidedObjectManager manager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deleteObject()
Signals the provided object to delete itself.boolean
equals(java.lang.Object o)
void
futureReady(ProMFuture<? extends java.lang.Object> future)
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<? extends java.lang.Object>
getType()
Returns the type of the object contained in this Provided Object.int
hashCode()
boolean
isDeleted()
Returns whether or not this object has been deleted.void
nameChanged(java.lang.String newName)
void
pluginCancelled(PluginContext context)
void
setLabel(java.lang.String label)
Sets the label of this provided object to the new label.void
setObject(java.lang.Object newObject)
Changes the content of this provided object by replacing the original object with the new object.java.lang.String
toString()
-
-
-
Constructor Detail
-
ProvidedObjectImpl
public ProvidedObjectImpl(java.lang.String label, ProvidedObjectID id, T object, java.lang.Class<? super T> type, ProvidedObjectManager manager) throws java.lang.NullPointerException
- Throws:
java.lang.NullPointerException
-
-
Method Detail
-
deleteObject
public void deleteObject()
Description copied from interface:ProvidedObject
Signals the provided object to delete itself. After calling this method, isDeleted() will return true and where applicable, ProvidedObjectDeletedExceptions will be thrown.- Specified by:
deleteObject
in interfaceProvidedObject
-
getID
public ProvidedObjectID getID()
Description copied from interface:ProvidedObject
Returns the ID of this Provided Object- Specified by:
getID
in interfaceProvidedObject
- Returns:
-
getObject
public java.lang.Object getObject() throws ProvidedObjectDeletedException
Description copied from interface:ProvidedObject
Same as calling getObject(true);- Specified by:
getObject
in interfaceProvidedObject
- Returns:
- Throws:
ProvidedObjectDeletedException
- If the object was removed from memory because there were no useful references to it anymore
-
getObject
public java.lang.Object getObject(boolean waitIfFuture) throws ProvidedObjectDeletedException
Description copied from interface:ProvidedObject
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)- Specified by:
getObject
in interfaceProvidedObject
- 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
-
setObject
public void setObject(java.lang.Object newObject) throws ProvidedObjectDeletedException
Description copied from interface:ProvidedObject
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.- Specified by:
setObject
in interfaceProvidedObject
- Throws:
ProvidedObjectDeletedException
- If the object was removed from memory because there were no useful references to it anymore
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getLabel
public java.lang.String getLabel()
Description copied from interface:ProvidedObject
Returns the label of this provided object- Specified by:
getLabel
in interfaceProvidedObject
- Returns:
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
nameChanged
public void nameChanged(java.lang.String newName)
- Specified by:
nameChanged
in interfaceNameChangeListener
-
setLabel
public void setLabel(java.lang.String label) throws ProvidedObjectDeletedException
Description copied from interface:ProvidedObject
Sets the label of this provided object to the new label.- Specified by:
setLabel
in interfaceProvidedObject
- 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
-
pluginCancelled
public void pluginCancelled(PluginContext context)
-
isDeleted
public boolean isDeleted()
Description copied from interface:ProvidedObject
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.- Specified by:
isDeleted
in interfaceProvidedObject
- Returns:
-
getType
public java.lang.Class<? extends java.lang.Object> getType() throws ProvidedObjectDeletedException
Description copied from interface:ProvidedObject
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.- Specified by:
getType
in interfaceProvidedObject
- Returns:
- Throws:
ProvidedObjectDeletedException
- If the object was removed from memory because there were no useful references to it anymore
-
futureReady
public void futureReady(ProMFuture<? extends java.lang.Object> future)
- Specified by:
futureReady
in interfaceFutureListener
-
-