Package ptolemy.copernicus.kernel
Class WatchDogTimer
- java.lang.Object
-
- soot.Transformer
-
- soot.SceneTransformer
-
- ptolemy.copernicus.kernel.WatchDogTimer
-
- All Implemented Interfaces:
soot.HasPhaseOptions
public class WatchDogTimer extends soot.SceneTransformer implements soot.HasPhaseOptionsA transformer that calls System.exit() after a certain amount of time. This transformer is useful for killing tests that are in tight loops. We use a transformer instead of building this directly into the KernelMain class to get parameter handling for free.- Since:
- Ptolemy II 2.0
- Version:
- $Id$
- Author:
- Stephen Neuendorffer, Christopher Hylands
- Pt.AcceptedRating:
- Red (cxh)
- Pt.ProposedRating:
- Red (cxh)
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel()java.lang.StringgetDeclaredOptions()java.lang.StringgetDefaultOptions()java.lang.StringgetPhaseName()protected voidinternalTransform(java.lang.String phaseName, java.util.Map options)Start up a watch dog timer that will call System.exit().static WatchDogTimerv()
-
-
-
Method Detail
-
v
public static WatchDogTimer v()
-
cancel
public void cancel()
-
getPhaseName
public java.lang.String getPhaseName()
- Specified by:
getPhaseNamein interfacesoot.HasPhaseOptions
-
getDefaultOptions
public java.lang.String getDefaultOptions()
- Specified by:
getDefaultOptionsin interfacesoot.HasPhaseOptions
-
getDeclaredOptions
public java.lang.String getDeclaredOptions()
- Specified by:
getDeclaredOptionsin interfacesoot.HasPhaseOptions
-
internalTransform
protected void internalTransform(java.lang.String phaseName, java.util.Map options)Start up a watch dog timer that will call System.exit(). Sample option arguments:-p wjtp.watchDogTimer time:10000means that exit will be called in 10,000 ms, or 10 seconds- Specified by:
internalTransformin classsoot.SceneTransformer- Parameters:
phaseName- The name of the phase, for examplewjtp.watchDogTimer.options- The options Map. This method uses thetimeoption to specify the number of milliseconds until System.exit() should be called.
-
-