Class StochasticNetUtils.DummyConsolePluginContext

  • All Implemented Interfaces:
    org.processmining.framework.plugin.GlobalContext, org.processmining.framework.plugin.ObjectConstructor, org.processmining.framework.plugin.PluginContext
    Enclosing class:
    StochasticNetUtils

    public static class StochasticNetUtils.DummyConsolePluginContext
    extends java.lang.Object
    implements org.processmining.framework.plugin.PluginContext
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <T extends org.processmining.framework.connections.Connection>
      T
      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>
      java.util.Collection<T>
      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>
      T
      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>
      T
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DummyConsolePluginContext

        public DummyConsolePluginContext()
    • Method Detail

      • getPluginManager

        public org.processmining.framework.plugin.PluginManager getPluginManager()
        Description copied from interface: org.processmining.framework.plugin.GlobalContext
        Returns the plugin manager. The plugin manager can be used to query for plugins which are registered in ProM.
        Specified by:
        getPluginManager in interface org.processmining.framework.plugin.GlobalContext
        Returns:
        the plugin manager
      • getProvidedObjectManager

        public org.processmining.framework.providedobjects.ProvidedObjectManager getProvidedObjectManager()
        Description copied from interface: org.processmining.framework.plugin.GlobalContext
        Returns the providedObject manager. The providedObject manager can be used to query for providedObjects which are registered in ProM. The manager should be a ProvidedObjectListener on all PluginInstanceContexts created by createRootInstanceContext.
        Specified by:
        getProvidedObjectManager in interface org.processmining.framework.plugin.GlobalContext
        Returns:
        the providedObject manager
      • getConnectionManager

        public org.processmining.framework.connections.ConnectionManager getConnectionManager()
        Description copied from interface: org.processmining.framework.plugin.GlobalContext
        Returns the connection manager. The connection manager can be used to query for connections which are registered in ProM.
        Specified by:
        getConnectionManager in interface org.processmining.framework.plugin.GlobalContext
        Returns:
        the connection manager
      • createNewPluginContextID

        public org.processmining.framework.plugin.PluginContextID createNewPluginContextID()
        Description copied from interface: org.processmining.framework.plugin.GlobalContext
        The GlobalContext implementation should create IDs for all PluginContexts instantiated for it.
        Specified by:
        createNewPluginContextID in interface org.processmining.framework.plugin.GlobalContext
        Returns:
      • invokePlugin

        public void invokePlugin​(org.processmining.framework.plugin.PluginDescriptor plugin,
                                 int index,
                                 java.lang.Object... objects)
        Description copied from interface: org.processmining.framework.plugin.GlobalContext
        This method invokes the specified plugin in a context which is a child of the main plugin context maintained by this globalContext. No results are provided to the method calling this method and the plugin is executed some time in the future, as decided by the implementing class.
        Specified by:
        invokePlugin in interface org.processmining.framework.plugin.GlobalContext
        Parameters:
        plugin - The plugin that should be invoked by the framework
        index - 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 plugin
      • invokeBinding

        public void invokeBinding​(org.processmining.framework.plugin.PluginParameterBinding binding,
                                  java.lang.Object... objects)
        Description copied from interface: org.processmining.framework.plugin.GlobalContext
        This method invokes the specified binding in a context which is a child of the main plugin context maintained by this globalContext. No results are provided to the method calling this method and the plugin is executed some time in the future, as decided by the implementing class.
        Specified by:
        invokeBinding in interface org.processmining.framework.plugin.GlobalContext
        Parameters:
        binding - The binding that should be invoked by the framework
        objects - The objects to serve as input as accepted by the given binding.
      • getPluginContextType

        public java.lang.Class<? extends org.processmining.framework.plugin.PluginContext> getPluginContextType()
        Description copied from interface: org.processmining.framework.plugin.GlobalContext
        Returns the specific type of the PluginContext. This type is used to instantiate new contexts in which to invoke plugins.
        Specified by:
        getPluginContextType in interface org.processmining.framework.plugin.GlobalContext
        Returns:
        the type of PluginContext provided by this global context
      • tryToFindOrConstructAllObjects

        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
        Description copied from interface: org.processmining.framework.plugin.ObjectConstructor
        Finds as many objects of the given type as can be found through the connections of the other given type. If no objects can be found, it constructs as many objects of the given type as there are plugins available to the framework to do so. These plugins should be able to execute in a child of the given context and accept, in any order, exactly the input provided. Any other objects returned by the plugin, not being the requested type are added to the provided objects of the framework. Also, listeners are notified where applicable. If no plugings exist, or if these plugins fail, a ConnectionDoesntExistException is thrown.
        Specified by:
        tryToFindOrConstructAllObjects in interface org.processmining.framework.plugin.ObjectConstructor
        Type Parameters:
        T - The type of the return object required.
        Parameters:
        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 work
        Returns:
        a collection of objects as found or returned by the plugins.
        Throws:
        org.processmining.framework.connections.ConnectionCannotBeObtained
      • tryToFindOrConstructFirstObject

        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
        Description copied from interface: org.processmining.framework.plugin.ObjectConstructor
        Returns the first object of the given type as can be found through the connections of the other given type. If no objects can be found, it constructs as an object of the given type using a plugin available to the framework to do so. This plugins should be able to execute in a child of the given context and accept, in any order, exactly the input provided. Any other objects returned by the plugin, not being the requested type are added to the provided objects of the framework. Also, listeners are notified where applicable. If no plugins exist, or if these plugins fail, a ConnectionDoesntExistException is thrown.
        Specified by:
        tryToFindOrConstructFirstObject in interface org.processmining.framework.plugin.ObjectConstructor
        Type Parameters:
        T - The type of the return object required.
        Parameters:
        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 work
        Returns:
        a collection of objects as returned by the plugins.
        Throws:
        org.processmining.framework.connections.ConnectionCannotBeObtained
      • tryToFindOrConstructFirstNamedObject

        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
        Description copied from interface: org.processmining.framework.plugin.ObjectConstructor
        Returns the first object of the given type as can be found through the connections of the other given type. If no objects can be found, it constructs as an object of the given type using a plugin available to the framework to do so. This plugins should be able to execute in a child of the given context and accept, in any order, exactly the input provided. Furthermore, the returned object should have the right label assigned to it in the plugin definition. Any other objects returned by the plugin, not being the requested type are added to the provided objects of the framework. Also, listeners are notified where applicable. If no plugins exist, or if these plugins fail, a ConnectionDoesntExistException is thrown.
        Specified by:
        tryToFindOrConstructFirstNamedObject in interface org.processmining.framework.plugin.ObjectConstructor
        Type Parameters:
        T - The type of the return object required.
        Parameters:
        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 work
        Returns:
        a collection of objects as returned by the plugins.
        Throws:
        org.processmining.framework.connections.ConnectionCannotBeObtained
      • createChildContext

        public org.processmining.framework.plugin.PluginContext createChildContext​(java.lang.String label)
        Description copied from interface: org.processmining.framework.plugin.PluginContext
        Returns a new plugin context instance, which can be used to invoke other plugins.
        Specified by:
        createChildContext in interface org.processmining.framework.plugin.PluginContext
        Returns:
        the new plugin context instance
      • getProgress

        public org.processmining.framework.plugin.Progress getProgress()
        Description copied from interface: org.processmining.framework.plugin.PluginContext
        Returns the progress object corresponding to this context
        Specified by:
        getProgress in interface org.processmining.framework.plugin.PluginContext
        Returns:
        the progress object corresponding to this context
      • getProgressEventListeners

        public org.processmining.framework.plugin.events.ProgressEventListener.ListenerList getProgressEventListeners()
        Description copied from interface: org.processmining.framework.plugin.PluginContext
        Returns the list of registered progress listeners
        Specified by:
        getProgressEventListeners in interface org.processmining.framework.plugin.PluginContext
        Returns:
        the list of registered progress listeners
      • getPluginLifeCycleEventListeners

        public org.processmining.framework.plugin.events.PluginLifeCycleEventListener.List getPluginLifeCycleEventListeners()
        Description copied from interface: org.processmining.framework.plugin.PluginContext
        Returns the list of registered plugin life cycle listeners.
        Specified by:
        getPluginLifeCycleEventListeners in interface org.processmining.framework.plugin.PluginContext
        Returns:
        the list of registered plugin life cycle listeners.
      • getID

        public org.processmining.framework.plugin.PluginContextID getID()
        Description copied from interface: org.processmining.framework.plugin.PluginContext
        Each PluginContext should carry an ID. This ID is unique within this plugin context's global context.
        Specified by:
        getID in interface org.processmining.framework.plugin.PluginContext
        Returns:
        the ID of this context
      • getLabel

        public java.lang.String getLabel()
        Description copied from interface: org.processmining.framework.plugin.PluginContext
        Returns the label of this context.
        Specified by:
        getLabel in interface org.processmining.framework.plugin.PluginContext
        Returns:
      • getPluginDescriptor

        public org.processmining.framework.util.Pair<org.processmining.framework.plugin.PluginDescriptor,​java.lang.Integer> getPluginDescriptor()
        Description copied from interface: org.processmining.framework.plugin.PluginContext
        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.
        Specified by:
        getPluginDescriptor in interface org.processmining.framework.plugin.PluginContext
        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

        public org.processmining.framework.plugin.PluginContext getParentContext()
        Description copied from interface: org.processmining.framework.plugin.PluginContext
        Returns the context which created this context or null if it has no parent.
        Specified by:
        getParentContext in interface org.processmining.framework.plugin.PluginContext
        Returns:
      • getChildContexts

        public java.util.List<org.processmining.framework.plugin.PluginContext> getChildContexts()
        Description copied from interface: org.processmining.framework.plugin.PluginContext
        Returns a list of all child contexts which have been created with createChildContext().
        Specified by:
        getChildContexts in interface org.processmining.framework.plugin.PluginContext
        Returns:
      • getResult

        public org.processmining.framework.plugin.PluginExecutionResult getResult()
        Description copied from interface: org.processmining.framework.plugin.PluginContext
        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.
        Specified by:
        getResult in interface org.processmining.framework.plugin.PluginContext
        Returns:
        The PluginExecutionResult that represents the result of this plugin invocation
      • getFutureResult

        public org.processmining.framework.plugin.ProMFuture<?> getFutureResult​(int i)
        Description copied from interface: org.processmining.framework.plugin.PluginContext
        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.
        Specified by:
        getFutureResult in interface org.processmining.framework.plugin.PluginContext
        Returns:
      • getExecutor

        public java.util.concurrent.Executor getExecutor()
        Description copied from interface: org.processmining.framework.plugin.PluginContext
        Returns an executor which can be used to execute plugins in child contexts.
        Specified by:
        getExecutor in interface org.processmining.framework.plugin.PluginContext
        Returns:
      • isDistantChildOf

        public boolean isDistantChildOf​(org.processmining.framework.plugin.PluginContext context)
        Description copied from interface: org.processmining.framework.plugin.PluginContext
        Returns true if this is a distant child of context, i.e. true if getParent.getID().equals(context.getID()) || getParent().isDistantChildOf(context);
        Specified by:
        isDistantChildOf in interface org.processmining.framework.plugin.PluginContext
        Returns:
      • setFuture

        public void setFuture​(org.processmining.framework.plugin.PluginExecutionResult resultToBe)
        Specified by:
        setFuture in interface org.processmining.framework.plugin.PluginContext
      • setPluginDescriptor

        public void setPluginDescriptor​(org.processmining.framework.plugin.PluginDescriptor descriptor,
                                        int methodIndex)
                                 throws org.processmining.framework.plugin.impl.FieldSetException,
                                        org.processmining.framework.plugin.RecursiveCallException
        Specified by:
        setPluginDescriptor in interface org.processmining.framework.plugin.PluginContext
        Throws:
        org.processmining.framework.plugin.impl.FieldSetException
        org.processmining.framework.plugin.RecursiveCallException
      • hasPluginDescriptorInPath

        public boolean hasPluginDescriptorInPath​(org.processmining.framework.plugin.PluginDescriptor descriptor,
                                                 int methodIndex)
        Specified by:
        hasPluginDescriptorInPath in interface org.processmining.framework.plugin.PluginContext
      • log

        public void log​(java.lang.String message,
                        org.processmining.framework.plugin.events.Logger.MessageLevel level)
        Description copied from interface: org.processmining.framework.plugin.PluginContext
        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.
        Specified by:
        log in interface org.processmining.framework.plugin.PluginContext
        Parameters:
        message - the message to log
        level - the message level
      • log

        public void log​(java.lang.String message)
        Description copied from interface: org.processmining.framework.plugin.PluginContext
        Same as calling log(message, MessageLevel.NORMAL);
        Specified by:
        log in interface org.processmining.framework.plugin.PluginContext
        Parameters:
        message - The message
      • log

        public void log​(java.lang.Throwable exception)
        Description copied from interface: org.processmining.framework.plugin.PluginContext
        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!
        Specified by:
        log in interface org.processmining.framework.plugin.PluginContext
        Parameters:
        exception - the exception thrown
      • getLoggingListeners

        public org.processmining.framework.plugin.events.Logger.ListenerList getLoggingListeners()
        Description copied from interface: org.processmining.framework.plugin.PluginContext
        Returns the list of logging listeners registered to this context.
        Specified by:
        getLoggingListeners in interface org.processmining.framework.plugin.PluginContext
        Returns:
      • getRootContext

        public org.processmining.framework.plugin.PluginContext getRootContext()
        Description copied from interface: org.processmining.framework.plugin.PluginContext
        Returns the root plugin context. This is an instance of PluginContext of which all other contexts are distant childs.
        Specified by:
        getRootContext in interface org.processmining.framework.plugin.PluginContext
        Returns:
      • deleteChild

        public boolean deleteChild​(org.processmining.framework.plugin.PluginContext child)
        Description copied from interface: org.processmining.framework.plugin.PluginContext
        Delete this child from this context.
        Specified by:
        deleteChild in interface org.processmining.framework.plugin.PluginContext
      • addConnection

        public <T extends org.processmining.framework.connections.Connection> T addConnection​(T c)
        Description copied from interface: org.processmining.framework.plugin.PluginContext
        Registers the given connection in the global context. The implementation is addConnection(this,c);
        Specified by:
        addConnection in interface org.processmining.framework.plugin.PluginContext
      • clear

        public void clear()
        Specified by:
        clear in interface org.processmining.framework.plugin.PluginContext