F
Fred
Hi, I need help ensuring that when an error is encountered in any of the
methods called by SystemTickMillThread that an error is written to debug. At
the moment the thread just dies and I am not notified of the failure.
The catch exception at the end is never triggerred and I do not know why. If
an error is encountered in SystemTickMillThread I would like some output.
Thanks.
package com.gunn.ocm.systemmanager;
/**
* updated April 2004
*/
import com.gunn.ocm.data.*;
import com.gunn.ocm.util.*;
public class SystemTickMillThread extends Thread {
private SystemControlTimingObject _scto;
private boolean run = true;
/**
* SystemTickMillThread constructor comment.
*/
public SystemTickMillThread() {
super();
}
/**
* SystemTickMillThread constructor comment.
*/
public SystemTickMillThread(ThreadGroup group,String
threadName,SystemControlTimingObject scto) {
super(group,threadName);
_scto = scto;
}
public void destroy()
{
run = false;
}
public void run()
{
try
{
while (run)
{
if (_scto != null)
{
try
{
//call Tick Mill Process
if (DefaultValues.DEBUG_LEVEL >= DefaultValues.DEBUG_LEVEL_MED)
System.out.println("\tLocking System Tick Mill Process Process");
SystemLock.getToken();
com.gunn.ocm.processes.EventProcesses ep = new
com.gunn.ocm.processes.EventProcesses();
ep.tickMillProcess();
} catch (Exception nonfatal) {throw nonfatal;}
finally
{
SystemLock.returnToken();
Thread.sleep(_scto.getFrequency());
}
}
else
{
//Should not get in here if everything is setup
throw new Exception("Timing for tickMill not setup");
//Thread.sleep(10000000);
}
}
} catch (Exception e)
{
System.out.println("Error in tick mill thread : " + e);
}
}
}
methods called by SystemTickMillThread that an error is written to debug. At
the moment the thread just dies and I am not notified of the failure.
The catch exception at the end is never triggerred and I do not know why. If
an error is encountered in SystemTickMillThread I would like some output.
Thanks.
package com.gunn.ocm.systemmanager;
/**
* updated April 2004
*/
import com.gunn.ocm.data.*;
import com.gunn.ocm.util.*;
public class SystemTickMillThread extends Thread {
private SystemControlTimingObject _scto;
private boolean run = true;
/**
* SystemTickMillThread constructor comment.
*/
public SystemTickMillThread() {
super();
}
/**
* SystemTickMillThread constructor comment.
*/
public SystemTickMillThread(ThreadGroup group,String
threadName,SystemControlTimingObject scto) {
super(group,threadName);
_scto = scto;
}
public void destroy()
{
run = false;
}
public void run()
{
try
{
while (run)
{
if (_scto != null)
{
try
{
//call Tick Mill Process
if (DefaultValues.DEBUG_LEVEL >= DefaultValues.DEBUG_LEVEL_MED)
System.out.println("\tLocking System Tick Mill Process Process");
SystemLock.getToken();
com.gunn.ocm.processes.EventProcesses ep = new
com.gunn.ocm.processes.EventProcesses();
ep.tickMillProcess();
} catch (Exception nonfatal) {throw nonfatal;}
finally
{
SystemLock.returnToken();
Thread.sleep(_scto.getFrequency());
}
}
else
{
//Should not get in here if everything is setup
throw new Exception("Timing for tickMill not setup");
//Thread.sleep(10000000);
}
}
} catch (Exception e)
{
System.out.println("Error in tick mill thread : " + e);
}
}
}