The Stardust 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:
partitionCreated - propagates that a new audit trail partition was createdpartitionDropped - propagates that a specific audit trail partition was deletedTo 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:
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.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) {
}
}