public class MockupContext
extends java.lang.Object
implements org.processmining.framework.plugin.PluginContext
Constructor and Description |
---|
MockupContext() |
MockupContext(java.lang.Class<?>[] returnTypes,
java.lang.String[] returnNames,
org.processmining.framework.plugin.PluginDescriptor plugin) |
Modifier and Type | Method and Description |
---|---|
<T extends org.processmining.framework.connections.Connection> |
addConnection(T c)
Registers the given connection in the global context.
|
void |
clear() |
org.processmining.framework.plugin.PluginContext |
createChildContext(java.lang.String label)
Returns a new plugin context instance, which can be used to invoke other
plugins.
|
org.processmining.framework.plugin.PluginContextID |
createNewPluginContextID()
The GlobalContext implementation should create IDs for all PluginContexts
instantiated for it.
|
boolean |
deleteChild(org.processmining.framework.plugin.PluginContext child)
Delete this child from this context.
|
java.util.List<org.processmining.framework.plugin.PluginContext> |
getChildContexts()
Returns a list of all child contexts which have been created with
createChildContext().
|
org.processmining.framework.connections.ConnectionManager |
getConnectionManager()
Returns the connection manager.
|
java.util.concurrent.Executor |
getExecutor()
Returns an executor which can be used to execute plugins in child
contexts.
|
org.processmining.framework.plugin.ProMFuture<?> |
getFutureResult(int i)
This method should only be used by a plugin, in the body of that plugin.
|
org.processmining.framework.plugin.PluginContextID |
getID()
Each PluginContext should carry an ID.
|
java.lang.String |
getLabel()
Returns the label of this context.
|
org.processmining.framework.plugin.events.Logger.ListenerList |
getLoggingListeners()
Returns the list of logging listeners registered to this context.
|
org.processmining.framework.plugin.PluginContext |
getParentContext()
Returns the context which created this context or null if it has no
parent.
|
java.lang.Class<? extends org.processmining.framework.plugin.PluginContext> |
getPluginContextType()
Returns the specific type of the PluginContext.
|
org.processmining.framework.util.Pair<org.processmining.framework.plugin.PluginDescriptor,java.lang.Integer> |
getPluginDescriptor()
Return the plugin descriptor and method index of the plugin which is
invoked in this context.
|
org.processmining.framework.plugin.events.PluginLifeCycleEventListener.List |
getPluginLifeCycleEventListeners()
Returns the list of registered plugin life cycle listeners.
|
org.processmining.framework.plugin.PluginManager |
getPluginManager()
Returns the plugin manager.
|
org.processmining.framework.plugin.Progress |
getProgress()
Returns the progress object corresponding to this context
|
org.processmining.framework.plugin.events.ProgressEventListener.ListenerList |
getProgressEventListeners()
Returns the list of registered progress listeners
|
org.processmining.framework.providedobjects.ProvidedObjectManager |
getProvidedObjectManager()
Returns the providedObject manager.
|
org.processmining.framework.plugin.PluginExecutionResult |
getResult()
This method returns the PluginExecutionResult of the plugin which is
invoked in this context.
|
org.processmining.framework.plugin.PluginContext |
getRootContext()
Returns the root plugin context.
|
boolean |
hasPluginDescriptorInPath(org.processmining.framework.plugin.PluginDescriptor descriptor,
int methodIndex) |
void |
invokeBinding(org.processmining.framework.plugin.PluginParameterBinding binding,
java.lang.Object... objects)
This method invokes the specified binding in a context which is a child
of the main plugin context maintained by this globalContext.
|
void |
invokePlugin(org.processmining.framework.plugin.PluginDescriptor plugin,
int index,
java.lang.Object... objects)
This method invokes the specified plugin in a context which is a child of
the main plugin context maintained by this globalContext.
|
boolean |
isDistantChildOf(org.processmining.framework.plugin.PluginContext context)
Returns true if this is a distant child of context, i.e.
|
void |
log(java.lang.String message)
Same as calling log(message, MessageLevel.NORMAL);
|
void |
log(java.lang.String message,
org.processmining.framework.plugin.events.Logger.MessageLevel level)
The provided String is provided to the context for information.
|
void |
log(java.lang.Throwable exception)
The provided Exception is provided to the context.
|
void |
setFuture(org.processmining.framework.plugin.PluginExecutionResult resultToBe) |
void |
setPluginDescriptor(org.processmining.framework.plugin.PluginDescriptor descriptor,
int methodIndex) |
<T,C extends org.processmining.framework.connections.Connection> |
tryToFindOrConstructAllObjects(java.lang.Class<T> type,
java.lang.Class<C> connectionType,
java.lang.String role,
java.lang.Object... input)
Finds as many objects of the given type as can be found through the
connections of the other given type.
|
<T,C extends org.processmining.framework.connections.Connection> |
tryToFindOrConstructFirstNamedObject(java.lang.Class<T> type,
java.lang.String name,
java.lang.Class<C> connectionType,
java.lang.String role,
java.lang.Object... input)
Returns the first object of the given type as can be found through the
connections of the other given type.
|
<T,C extends org.processmining.framework.connections.Connection> |
tryToFindOrConstructFirstObject(java.lang.Class<T> type,
java.lang.Class<C> connectionType,
java.lang.String role,
java.lang.Object... input)
Returns the first object of the given type as can be found through the
connections of the other given type.
|
public MockupContext()
public MockupContext(java.lang.Class<?>[] returnTypes, java.lang.String[] returnNames, org.processmining.framework.plugin.PluginDescriptor plugin)
public org.processmining.framework.plugin.PluginManager getPluginManager()
org.processmining.framework.plugin.GlobalContext
getPluginManager
in interface org.processmining.framework.plugin.GlobalContext
public org.processmining.framework.providedobjects.ProvidedObjectManager getProvidedObjectManager()
org.processmining.framework.plugin.GlobalContext
getProvidedObjectManager
in interface org.processmining.framework.plugin.GlobalContext
public org.processmining.framework.connections.ConnectionManager getConnectionManager()
org.processmining.framework.plugin.GlobalContext
getConnectionManager
in interface org.processmining.framework.plugin.GlobalContext
public org.processmining.framework.plugin.PluginContextID createNewPluginContextID()
org.processmining.framework.plugin.GlobalContext
createNewPluginContextID
in interface org.processmining.framework.plugin.GlobalContext
public void invokePlugin(org.processmining.framework.plugin.PluginDescriptor plugin, int index, java.lang.Object... objects)
org.processmining.framework.plugin.GlobalContext
invokePlugin
in interface org.processmining.framework.plugin.GlobalContext
plugin
- The plugin that should be invoked by the frameworkindex
- The index of the plugin method that should be invoked.objects
- The objects to serve as input as accepted by the method at
index of the pluginpublic void invokeBinding(org.processmining.framework.plugin.PluginParameterBinding binding, java.lang.Object... objects)
org.processmining.framework.plugin.GlobalContext
invokeBinding
in interface org.processmining.framework.plugin.GlobalContext
binding
- The binding that should be invoked by the frameworkobjects
- The objects to serve as input as accepted by the given
binding.public java.lang.Class<? extends org.processmining.framework.plugin.PluginContext> getPluginContextType()
org.processmining.framework.plugin.GlobalContext
getPluginContextType
in interface org.processmining.framework.plugin.GlobalContext
public <T,C extends org.processmining.framework.connections.Connection> java.util.Collection<T> tryToFindOrConstructAllObjects(java.lang.Class<T> type, java.lang.Class<C> connectionType, java.lang.String role, java.lang.Object... input) throws org.processmining.framework.connections.ConnectionCannotBeObtained
org.processmining.framework.plugin.ObjectConstructor
tryToFindOrConstructAllObjects
in interface org.processmining.framework.plugin.ObjectConstructor
T
- The type of the return object required.type
- the type of the return object required.connectionType
- the type of the connections to use when trying to find the
objects.role
- the assumed role of the object in the connection. Given a
connection, the object can be retrieved through the role.input
- the input on which the plugin should workorg.processmining.framework.connections.ConnectionCannotBeObtained
public <T,C extends org.processmining.framework.connections.Connection> T tryToFindOrConstructFirstObject(java.lang.Class<T> type, java.lang.Class<C> connectionType, java.lang.String role, java.lang.Object... input) throws org.processmining.framework.connections.ConnectionCannotBeObtained
org.processmining.framework.plugin.ObjectConstructor
tryToFindOrConstructFirstObject
in interface org.processmining.framework.plugin.ObjectConstructor
T
- The type of the return object required.type
- the type of the return object required.connectionType
- the type of the connections to use when trying to find the
objects.role
- the assumed role of the object in the connection. Given a
connection, the object can be retrieved through the role.input
- the input on which the plugin should workorg.processmining.framework.connections.ConnectionCannotBeObtained
public <T,C extends org.processmining.framework.connections.Connection> T tryToFindOrConstructFirstNamedObject(java.lang.Class<T> type, java.lang.String name, java.lang.Class<C> connectionType, java.lang.String role, java.lang.Object... input) throws org.processmining.framework.connections.ConnectionCannotBeObtained
org.processmining.framework.plugin.ObjectConstructor
tryToFindOrConstructFirstNamedObject
in interface org.processmining.framework.plugin.ObjectConstructor
T
- The type of the return object required.type
- the type of the return object required.name
- the name of the plugin to use.connectionType
- the type of the connections to use when trying to find the
objects.role
- the assumed role of the object in the connection. Given a
connection, the object can be retrieved through the role.input
- the input on which the plugin should workorg.processmining.framework.connections.ConnectionCannotBeObtained
public org.processmining.framework.plugin.PluginContext createChildContext(java.lang.String label)
org.processmining.framework.plugin.PluginContext
createChildContext
in interface org.processmining.framework.plugin.PluginContext
public org.processmining.framework.plugin.Progress getProgress()
org.processmining.framework.plugin.PluginContext
getProgress
in interface org.processmining.framework.plugin.PluginContext
public org.processmining.framework.plugin.events.ProgressEventListener.ListenerList getProgressEventListeners()
org.processmining.framework.plugin.PluginContext
getProgressEventListeners
in interface org.processmining.framework.plugin.PluginContext
public org.processmining.framework.plugin.events.PluginLifeCycleEventListener.List getPluginLifeCycleEventListeners()
org.processmining.framework.plugin.PluginContext
getPluginLifeCycleEventListeners
in interface org.processmining.framework.plugin.PluginContext
public org.processmining.framework.plugin.PluginContextID getID()
org.processmining.framework.plugin.PluginContext
getID
in interface org.processmining.framework.plugin.PluginContext
public java.lang.String getLabel()
org.processmining.framework.plugin.PluginContext
getLabel
in interface org.processmining.framework.plugin.PluginContext
public org.processmining.framework.util.Pair<org.processmining.framework.plugin.PluginDescriptor,java.lang.Integer> getPluginDescriptor()
org.processmining.framework.plugin.PluginContext
getPluginDescriptor
in interface org.processmining.framework.plugin.PluginContext
public org.processmining.framework.plugin.PluginContext getParentContext()
org.processmining.framework.plugin.PluginContext
getParentContext
in interface org.processmining.framework.plugin.PluginContext
public java.util.List<org.processmining.framework.plugin.PluginContext> getChildContexts()
org.processmining.framework.plugin.PluginContext
getChildContexts
in interface org.processmining.framework.plugin.PluginContext
public org.processmining.framework.plugin.PluginExecutionResult getResult()
org.processmining.framework.plugin.PluginContext
getResult
in interface org.processmining.framework.plugin.PluginContext
public org.processmining.framework.plugin.ProMFuture<?> getFutureResult(int i)
org.processmining.framework.plugin.PluginContext
getFutureResult
in interface org.processmining.framework.plugin.PluginContext
public java.util.concurrent.Executor getExecutor()
org.processmining.framework.plugin.PluginContext
getExecutor
in interface org.processmining.framework.plugin.PluginContext
public boolean isDistantChildOf(org.processmining.framework.plugin.PluginContext context)
org.processmining.framework.plugin.PluginContext
isDistantChildOf
in interface org.processmining.framework.plugin.PluginContext
public void setFuture(org.processmining.framework.plugin.PluginExecutionResult resultToBe)
setFuture
in interface org.processmining.framework.plugin.PluginContext
public void setPluginDescriptor(org.processmining.framework.plugin.PluginDescriptor descriptor, int methodIndex) throws org.processmining.framework.plugin.impl.FieldSetException, org.processmining.framework.plugin.RecursiveCallException
setPluginDescriptor
in interface org.processmining.framework.plugin.PluginContext
org.processmining.framework.plugin.impl.FieldSetException
org.processmining.framework.plugin.RecursiveCallException
public boolean hasPluginDescriptorInPath(org.processmining.framework.plugin.PluginDescriptor descriptor, int methodIndex)
hasPluginDescriptorInPath
in interface org.processmining.framework.plugin.PluginContext
public void log(java.lang.String message, org.processmining.framework.plugin.events.Logger.MessageLevel level)
org.processmining.framework.plugin.PluginContext
log
in interface org.processmining.framework.plugin.PluginContext
message
- the message to loglevel
- the message levelpublic void log(java.lang.String message)
org.processmining.framework.plugin.PluginContext
log
in interface org.processmining.framework.plugin.PluginContext
message
- The messagepublic void log(java.lang.Throwable exception)
org.processmining.framework.plugin.PluginContext
log
in interface org.processmining.framework.plugin.PluginContext
exception
- the exception thrownpublic org.processmining.framework.plugin.events.Logger.ListenerList getLoggingListeners()
org.processmining.framework.plugin.PluginContext
getLoggingListeners
in interface org.processmining.framework.plugin.PluginContext
public org.processmining.framework.plugin.PluginContext getRootContext()
org.processmining.framework.plugin.PluginContext
getRootContext
in interface org.processmining.framework.plugin.PluginContext
public boolean deleteChild(org.processmining.framework.plugin.PluginContext child)
org.processmining.framework.plugin.PluginContext
deleteChild
in interface org.processmining.framework.plugin.PluginContext
public <T extends org.processmining.framework.connections.Connection> T addConnection(T c)
org.processmining.framework.plugin.PluginContext
addConnection
in interface org.processmining.framework.plugin.PluginContext
public void clear()
clear
in interface org.processmining.framework.plugin.PluginContext