Monitoring Runtime Environment Events

The Infinity Process Platform provides the Service Provider Interface IRuntimeEnvironmentMonitor to monitor process execution. Please refer to the according JavaDoc IRuntimeEnvironmentMonitor for detailed information on the interface.

import org.eclipse.stardust.common.annotations.SPI;
import org.eclipse.stardust.common.annotations.Status;
import org.eclipse.stardust.common.annotations.UseRestriction;
import org.eclipse.stardust.engine.core.runtime.beans.IAuditTrailPartition;

@SPI(useRestriction = UseRestriction.Public, status = Status.Stable)
public interface IRuntimeEnvironmentMonitor
{

   /**
    * Propagate creation of a new audittrail partition.
    *
    * @param partition The new partition.
    */
   void partitionCreated(IAuditTrailPartition partition);

   /**
    * Propagate deletion of an audittrail partition.
    *
    * @param partition The deleted partition.
    */
   void partitionDropped(IAuditTrailPartition partition);

}

The interface has several methods for propagating runtime environment events:

Creating a custom Implementation

To implement the IRuntimeEnvironmentMonitor interface and publish the implementation to the engine, a file named by the interface's factory has to be created in the /META-INF/services folder of the jar. Perform the following steps:

  1. Implement the interface as shown below
  2. Create a text file named org.eclipse.stardust.engine.core.spi.monitoring.IRuntimeEnvironmentMonitor. The file contents needs to be the fully qualified name of your implementation class, e.g. org.eclipse.stardust.example.RuntimeEnvironmentMonitorImpl.
  3. Place the file into the META-INF/services folder of the jar that will contain your implementation class
package org.eclipse.stardust.example;

import org.eclipse.stardust.engine.core.runtime.beans.IAuditTrailPartition;
import org.eclipse.stardust.engine.core.spi.monitoring.IRuntimeEnvironmentMonitor;

public class RuntimeEnvironmentMonitorImpl implements IRuntimeEnvironmentMonitor {

   @Override
   void partitionCreated(IAuditTrailPartition partition) {
   }
   
   @Override
   void partitionDropped(IAuditTrailPartition partition) {
   }
   
}