Class ProvidedObjectImpl
java.lang.Object
org.processmining.framework.providedobjects.impl.ProvidedObjectImpl
- All Implemented Interfaces:
EventListener
,FutureListener
,NameChangeListener
,ProvidedObject
public class ProvidedObjectImpl
extends 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
ConstructorDescriptionProvidedObjectImpl
(String label, ProvidedObjectID id, T object, Class<? super T> type, ProvidedObjectManager manager) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Signals the provided object to delete itself.boolean
void
futureReady
(ProMFuture<? extends Object> future) getID()
Returns the ID of this Provided ObjectgetLabel()
Returns the label of this provided objectSame as calling getObject(true);getObject
(boolean waitIfFuture) Returns the object stored in this provided object.getType()
Returns the type of the object contained in this Provided Object.int
hashCode()
boolean
Returns whether or not this object has been deleted.void
nameChanged
(String newName) void
pluginCancelled
(PluginContext context) void
Sets the label of this provided object to the new label.void
Changes the content of this provided object by replacing the original object with the new object.toString()
-
Constructor Details
-
ProvidedObjectImpl
public ProvidedObjectImpl(String label, ProvidedObjectID id, T object, Class<? super T> type, ProvidedObjectManager manager) throws NullPointerException - Throws:
NullPointerException
-
-
Method Details
-
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
Description copied from interface:ProvidedObject
Returns the ID of this Provided Object- Specified by:
getID
in interfaceProvidedObject
- Returns:
-
getObject
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
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
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
-
getLabel
Description copied from interface:ProvidedObject
Returns the label of this provided object- Specified by:
getLabel
in interfaceProvidedObject
- Returns:
-
hashCode
public int hashCode() -
equals
-
nameChanged
- Specified by:
nameChanged
in interfaceNameChangeListener
-
setLabel
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
-
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
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
- Specified by:
futureReady
in interfaceFutureListener
-