KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sape > carbon > services > console > SingletonExceptionViewer


1 package org.sape.carbon.services.console;
2
3 import org.sape.carbon.services.exception.ExceptionViewer;
4
5 /**
6  * <p>This is the template for Classes.</p>
7  *
8  *
9  * Copyright 2002 Sapient
10  * @since carbon 1.0
11  * @author Greg Hinkle, January 2002
12  * @version $Revision: 1.3 $($Author: ghinkl $ / $Date: 2003/04/04 01:11:49 $)
13  */

14 public class SingletonExceptionViewer extends ExceptionViewer {
15     
16     private static SingletonExceptionViewer viewer;
17     
18     private SingletonExceptionViewer() {
19         super();
20     }
21     
22     
23     public static synchronized SingletonExceptionViewer getInstance() {
24         if (SingletonExceptionViewer.viewer == null) {
25             SingletonExceptionViewer.viewer = new SingletonExceptionViewer();
26         }
27         
28         return SingletonExceptionViewer.viewer;
29     }
30     
31     public void addException(Throwable JavaDoc exception) {
32         super.addException(exception);
33         this.setVisible(true);
34     }
35     
36     public void exitForm(java.awt.event.WindowEvent JavaDoc evt) {
37         // Don't exit
38
}
39 }
40
Popular Tags