jTracer  1.03
Stack trace visualization tool
void org.libcsdbg.jtracer.StatusBar.stopUptimeTimer ( final boolean  reset,
final boolean  normal 
)

Stop and reset the server uptime timer.

Parameters
[in]resettrue if the timer must be resetted to zero
[in]normalfalse indicates a server fault, true normal termination

Definition at line 244 of file StatusBar.java.

References org.libcsdbg.jtracer.Registry.get(), org.libcsdbg.jtracer.StatusBar.renderUptime(), org.libcsdbg.jtracer.StatusBar.stopUptimeTimer(), org.libcsdbg.jtracer.StatusBar.timer, and org.libcsdbg.jtracer.StatusBar.uptime.

245  {
246  /* If the rendering is done by the event dispatching thread */
247  if (EventQueue.isDispatchThread()) {
248  timer.stop();
249  timer = null;
250 
251  Registry conf = Registry.getCurrent();
252  JLabel field = fields.get("uptime");
253  field.getParent().setBackground((Color) conf.get("statusbar", "bgcolor"));
254 
255  if (!normal)
256  field.setForeground((Color) conf.get("statusbar", "fgcolor-error"));
257 
258  if (reset) {
259  uptime = 0;
260  renderUptime();
261  }
262 
263  return;
264  }
265 
266  /*
267  * If the rendering is done from any other thread, create a Worker task and
268  * register it to be called by the event dispatching thread
269  */
270  class Worker implements Runnable {
271  public void run()
272  {
273  /* The task is to recursively call the same method */
274  stopUptimeTimer(reset, normal);
275  }
276  }
277 
278  try {
279  SwingUtilities.invokeLater(new Worker());
280  }
281 
282  catch (Throwable t) {
283  Registry.debug(t);
284  }
285  }
void stopUptimeTimer()
Stop and reset the server uptime timer.
Definition: StatusBar.java:231
Timer timer
Uptime timer.
Definition: StatusBar.java:41
long uptime
Server uptime (seconds)
Definition: StatusBar.java:38
void renderUptime()
Update the server uptime field.
Definition: StatusBar.java:330

+ Here is the call graph for this function: