Interface PluginExecutionResult
-
- All Known Implementing Classes:
PluginExecutionResultImpl
public interface PluginExecutionResultThis class represents the result of a plugin execution. It can be used to obtain all details after executing a plugin. Typically, plugins are executed a-synchronously, but by calling synchronize() on this object, the current thread is suspended untill all results are in (or exceptions are thrown)- Author:
- bfvdonge
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PluginDescriptorgetPlugin()Returns the plugin used to generate this resultProvidedObjectIDgetProvidedObjectID(int i)Returns the ProvidedObjectID under which the object at index i is known to the framework's ProvidedObject manager<T> TgetResult(int resultIndex)returns the result at the given index, casted to the given returntype.java.lang.StringgetResultName(int resultIndex)this method returns the name of the result at the given index.java.lang.String[]getResultNames()This method returns the names of the resultsjava.lang.Object[]getResults()returns the results of this plugin in an array.intgetSize()Returns the size of this result, i.e.<T> java.lang.Class<? super T>getType(int i)Returns the type of the object at index i, as declared by the pluginvoidsetProvidedObjectID(int i, ProvidedObjectID id)Tells this result under which provided object ID the object at index i is known to the frameworkvoidsynchronize()Synchronizes on any futures that might still exist in the result.
-
-
-
Method Detail
-
getSize
int getSize()
Returns the size of this result, i.e. how many objects were returned by the plugin- Returns:
-
synchronize
void synchronize() throws java.util.concurrent.CancellationException, java.util.concurrent.ExecutionException, java.lang.InterruptedExceptionSynchronizes on any futures that might still exist in the result. If no futures exist, this method does terminate normally- Throws:
java.util.concurrent.CancellationExceptionjava.util.concurrent.ExecutionExceptionjava.lang.InterruptedException
-
getResults
java.lang.Object[] getResults()
returns the results of this plugin in an array. If synchronize() was called, this method returns the actual objects. Otherwise, it might return ProMFutures on the actual objects (or any combination thereof).- Returns:
-
getResult
<T> T getResult(int resultIndex) throws java.lang.ClassCastExceptionreturns the result at the given index, casted to the given returntype. If synchronize() was called, this method returns the actual object. Otherwise, it might return a ProMFutureon the actual object. Note that 0<= resultIndex < getSize() - Type Parameters:
T-- Parameters:
resultIndex-- Returns:
- Throws:
java.lang.ClassCastException
-
getResultNames
java.lang.String[] getResultNames()
This method returns the names of the results- Returns:
-
getResultName
java.lang.String getResultName(int resultIndex)
this method returns the name of the result at the given index. Note that 0<= resultIndex < getSize()- Parameters:
resultIndex-- Returns:
-
setProvidedObjectID
void setProvidedObjectID(int i, ProvidedObjectID id)Tells this result under which provided object ID the object at index i is known to the framework- Parameters:
i- index of the objectid- the id of the provided object refering to the objet at index i
-
getProvidedObjectID
ProvidedObjectID getProvidedObjectID(int i)
Returns the ProvidedObjectID under which the object at index i is known to the framework's ProvidedObject manager- Parameters:
i- index of the object
-
getType
<T> java.lang.Class<? super T> getType(int i)
Returns the type of the object at index i, as declared by the plugin- Parameters:
i-- Returns:
-
getPlugin
PluginDescriptor getPlugin()
Returns the plugin used to generate this result- Returns:
-
-