Interface PluginContext
- All Superinterfaces:
GlobalContext
,ObjectConstructor
- All Known Implementing Classes:
AbstractPluginContext
,CLIPluginContext
,UIPluginContext
-
Method Summary
Modifier and TypeMethodDescription<T extends Connection>
TaddConnection
(T c) Registers the given connection in the global context.void
clear()
createChildContext
(String label) Returns a new plugin context instance, which can be used to invoke other plugins.boolean
deleteChild
(PluginContext child) Delete this child from this context.Returns a list of all child contexts which have been created with createChildContext().Returns an executor which can be used to execute plugins in child contexts.ProMFuture<?>
getFutureResult
(int i) This method should only be used by a plugin, in the body of that plugin.getID()
Each PluginContext should carry an ID.getLabel()
Returns the label of this context.Returns the list of logging listeners registered to this context.Returns the context which created this context or null if it has no parent.Return the plugin descriptor and method index of the plugin which is invoked in this context.Returns the list of registered plugin life cycle listeners.Returns the progress object corresponding to this contextReturns the list of registered progress listenersThis method returns the PluginExecutionResult of the plugin which is invoked in this context.Returns the root plugin context.boolean
hasPluginDescriptorInPath
(PluginDescriptor descriptor, int methodIndex) boolean
isDistantChildOf
(PluginContext context) Returns true if this is a distant child of context, i.e.void
Same as calling log(message, MessageLevel.NORMAL);void
log
(String message, Logger.MessageLevel level) The provided String is provided to the context for information.void
The provided Exception is provided to the context.void
setFuture
(PluginExecutionResult resultToBe) void
setPluginDescriptor
(PluginDescriptor descriptor, int methodIndex) Methods inherited from interface org.processmining.framework.plugin.GlobalContext
createNewPluginContextID, getConnectionManager, getPluginContextType, getPluginManager, getProvidedObjectManager, invokeBinding, invokePlugin
Methods inherited from interface org.processmining.framework.plugin.ObjectConstructor
tryToFindOrConstructAllObjects, tryToFindOrConstructFirstNamedObject, tryToFindOrConstructFirstObject
-
Method Details
-
createChildContext
Returns a new plugin context instance, which can be used to invoke other plugins.- Returns:
- the new plugin context instance
-
getProgress
Progress getProgress()Returns the progress object corresponding to this context- Returns:
- the progress object corresponding to this context
-
getProgressEventListeners
ProgressEventListener.ListenerList getProgressEventListeners()Returns the list of registered progress listeners- Returns:
- the list of registered progress listeners
-
getPluginLifeCycleEventListeners
PluginLifeCycleEventListener.List getPluginLifeCycleEventListeners()Returns the list of registered plugin life cycle listeners.- Returns:
- the list of registered plugin life cycle listeners.
-
getID
PluginContextID getID()Each PluginContext should carry an ID. This ID is unique within this plugin context's global context.- Returns:
- the ID of this context
-
getLabel
String getLabel()Returns the label of this context.- Returns:
-
getPluginDescriptor
Pair<PluginDescriptor,Integer> getPluginDescriptor()Return the plugin descriptor and method index of the plugin which is invoked in this context. This descriptor is set by the PluginDescriptor.invoke() method and will not be set yet before PluginManager.invoke() is called.- Returns:
- the descriptor of the plugin which is invoked in this context If the plugin is not set yet, a pair of (null,-1) is returned
-
getParentContext
PluginContext getParentContext()Returns the context which created this context or null if it has no parent.- Returns:
-
getChildContexts
List<PluginContext> getChildContexts()Returns a list of all child contexts which have been created with createChildContext().- Returns:
-
getResult
PluginExecutionResult getResult()This method returns the PluginExecutionResult of the plugin which is invoked in this context. This future result is set by PluginManager.invoke() and will not be available (will be null) until the invoke() method is called.- Returns:
- The PluginExecutionResult that represents the result of this plugin invocation
- Throws:
FieldNotSetException
- If the future is not know to this context
-
getFutureResult
This method should only be used by a plugin, in the body of that plugin. That is the only location, where it is guaranteed that each result object in getResults() can safely be cast to a ProMFuture.- Parameters:
i
-- Returns:
-
getExecutor
Executor getExecutor()Returns an executor which can be used to execute plugins in child contexts.- Returns:
-
isDistantChildOf
Returns true if this is a distant child of context, i.e. true if getParent.getID().equals(context.getID()) || getParent().isDistantChildOf(context);- Parameters:
context
-- Returns:
-
setFuture
-
setPluginDescriptor
void setPluginDescriptor(PluginDescriptor descriptor, int methodIndex) throws FieldSetException, RecursiveCallException -
hasPluginDescriptorInPath
-
log
The provided String is provided to the context for information. It can for example signal a state change of a plugin. Note that some contexts can completely ignore this message.- Parameters:
message
- the message to loglevel
- the message level
-
log
Same as calling log(message, MessageLevel.NORMAL);- Parameters:
message
- The message
-
log
The provided Exception is provided to the context. It signals the context about an error in the plugin, that specifically lead to abnormal termination. The plugin signaling the exception is no longer executing!- Parameters:
exception
- the exception thrown
-
getLoggingListeners
Logger.ListenerList getLoggingListeners()Returns the list of logging listeners registered to this context.- Returns:
-
getRootContext
PluginContext getRootContext()Returns the root plugin context. This is an instance of PluginContext of which all other contexts are distant childs.- Returns:
-
deleteChild
Delete this child from this context.- Parameters:
child
-
-
addConnection
Registers the given connection in the global context. The implementation is addConnection(this,c);- Parameters:
c
-
-
clear
void clear()
-