Error handling newbe

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);
}
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top