Interface IProcessIntermediateEventBean

  • All Known Implementing Classes:
    AbstractProcessIntermediateEventBean

    public interface IProcessIntermediateEventBean
    Interface that must be implemented by process intermediate event bean. These Beans are instantiated by ivy and can then fire events which will wake up tasks that are in state TaskState.WAITING_FOR_INTERMEDIATE_EVENT. The beans can be configured in the intermediate event process element.
    Since:
    19.01.2008
    API:
    This is a public API.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      String getDescription()
      Gets a description what this process intermediate event bean does.
      String getName()
      Gets the name of the process intermediate event bean
      void initialize​(IProcessIntermediateEventBeanRuntime eventRuntime, String configuration)
      Initializes the process intermediate event bean
      boolean isMoreThanOneInstanceSupported()
      Does this event bean allow/support that it is instanciated more than once for a certain path.
      boolean isRunning()
      True if the process intermediate event bean was started.
      void poll()
      This method is called by the process intermediate event bean runtime perodically.
      void start​(org.eclipse.core.runtime.IProgressMonitor monitor)
      Starts the process intermediate event bean.
      void stop​(org.eclipse.core.runtime.IProgressMonitor monitor)
      Stops the process intermediate event bean.
    • Method Detail

      • initialize

        void initialize​(IProcessIntermediateEventBeanRuntime eventRuntime,
                        String configuration)
        Initializes the process intermediate event bean
        Parameters:
        eventRuntime - the event runtime. The process intermediate event bean can fire events to the event runtime
        configuration - the configuration of the process intermediate event bean
        API:
        This public API is available in Java.
      • getName

        String getName()
        Gets the name of the process intermediate event bean
        Returns:
        name of the process intermediate event bean
        API:
        This public API is available in Java.
      • getDescription

        String getDescription()
        Gets a description what this process intermediate event bean does.
        Returns:
        description what this process intermediate event bean does.
        API:
        This public API is available in Java.
      • start

        void start​(org.eclipse.core.runtime.IProgressMonitor monitor)
            throws ch.ivyteam.ivy.service.ServiceException
        Starts the process intermediate event bean. The process intermediate event bean is allowed to fire events after it is started. The event bean must not fire events if it is not started.
        Parameters:
        monitor - the progress monitor
        Throws:
        ch.ivyteam.ivy.service.ServiceException - if event bean cannot be started. isRunning() must return false if start has thrown this exception.
        API:
        This public API is available in Java.
      • stop

        void stop​(org.eclipse.core.runtime.IProgressMonitor monitor)
           throws ch.ivyteam.ivy.service.ServiceException
        Stops the process intermediate event bean. The process intermediate event bean must not fire events if it is stopped.
        Parameters:
        monitor - the progress monitor
        Throws:
        ch.ivyteam.ivy.service.ServiceException - if process intermediate event bean cannot be stopped. isRunning() must return true if stop has thrown this exception.
        API:
        This public API is available in Java.
      • isRunning

        boolean isRunning()
        True if the process intermediate event bean was started. The process intermediate event bean is by default not started. E.g. if the event bean is instanciated the method must return false. After the method start(org.eclipse.core.runtime.IProgressMonitor) was called the method should return true.
        Returns:
        true if started, false if stopped.
        API:
        This public API is available in Java.
      • poll

        void poll()
        This method is called by the process intermediate event bean runtime perodically. Default time interval is one minute. It can be used to poll for something that fires an event.
        This allows to share polling threads between event beans.
        Note that it is not necessary to create an own thread to fire an event as this was necessary with earlier version (<=3.8). You can configure the time interval by using IProcessIntermediateEventBeanRuntime.setPollTimeInterval(long). Note that the runtime can call this method more than once on an instance if the poll method last longer than the configured runtime interval. Implementors have to consider this fact.
        API:
        This public API is available in Java.
      • isMoreThanOneInstanceSupported

        boolean isMoreThanOneInstanceSupported()
        Does this event bean allow/support that it is instanciated more than once for a certain path. If not supported the process intermediate event bean is instanced only once. On a cluster typically on the master node. If supported the process intermediate event bean can be instanced more once. On a cluster typically once on each node.
        Returns:
        true if more than one instance is supported, otherwise false
        API:
        This public API is available in Java.