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 voiddeleteObject()Signals the provided object to delete itself.booleanequals(java.lang.Object o)voidfutureReady(ProMFuture<? extends java.lang.Object> future)ProvidedObjectIDgetID()Returns the ID of this Provided Objectjava.lang.StringgetLabel()Returns the label of this provided objectjava.lang.ObjectgetObject()Same as calling getObject(true);java.lang.ObjectgetObject(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.inthashCode()booleanisDeleted()Returns whether or not this object has been deleted.voidnameChanged(java.lang.String newName)voidpluginCancelled(PluginContext context)voidsetLabel(java.lang.String label)Sets the label of this provided object to the new label.voidsetObject(java.lang.Object newObject)Changes the content of this provided object by replacing the original object with the new object.java.lang.StringtoString()
-
-
-
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:ProvidedObjectSignals the provided object to delete itself. After calling this method, isDeleted() will return true and where applicable, ProvidedObjectDeletedExceptions will be thrown.- Specified by:
deleteObjectin interfaceProvidedObject
-
getID
public ProvidedObjectID getID()
Description copied from interface:ProvidedObjectReturns the ID of this Provided Object- Specified by:
getIDin interfaceProvidedObject- Returns:
-
getObject
public java.lang.Object getObject() throws ProvidedObjectDeletedExceptionDescription copied from interface:ProvidedObjectSame as calling getObject(true);- Specified by:
getObjectin 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 ProvidedObjectDeletedExceptionDescription copied from interface:ProvidedObjectReturns 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:
getObjectin 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 ProvidedObjectDeletedExceptionDescription copied from interface:ProvidedObjectChanges 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:
setObjectin 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:
toStringin classjava.lang.Object
-
getLabel
public java.lang.String getLabel()
Description copied from interface:ProvidedObjectReturns the label of this provided object- Specified by:
getLabelin interfaceProvidedObject- Returns:
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
nameChanged
public void nameChanged(java.lang.String newName)
- Specified by:
nameChangedin interfaceNameChangeListener
-
setLabel
public void setLabel(java.lang.String label) throws ProvidedObjectDeletedExceptionDescription copied from interface:ProvidedObjectSets the label of this provided object to the new label.- Specified by:
setLabelin 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:ProvidedObjectReturns 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:
isDeletedin interfaceProvidedObject- Returns:
-
getType
public java.lang.Class<? extends java.lang.Object> getType() throws ProvidedObjectDeletedExceptionDescription copied from interface:ProvidedObjectReturns 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:
getTypein 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:
futureReadyin interfaceFutureListener
-
-