home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &… the Search for Life CD 3 / 0_CD-ROM.iso / install / jre1_3 / lib / rt.jar / javax / naming / NamingException.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  2.7 KB  |  150 lines

  1. package javax.naming;
  2.  
  3. import java.io.PrintStream;
  4. import java.io.PrintWriter;
  5.  
  6. public class NamingException extends Exception {
  7.    protected Name resolvedName;
  8.    protected Object resolvedObj;
  9.    protected Name remainingName;
  10.    protected Throwable rootException = null;
  11.    private static final long serialVersionUID = -1299181962103167177L;
  12.  
  13.    public NamingException(String var1) {
  14.       super(var1);
  15.       this.resolvedName = this.remainingName = null;
  16.       this.resolvedObj = null;
  17.    }
  18.  
  19.    public NamingException() {
  20.       this.resolvedName = this.remainingName = null;
  21.       this.resolvedObj = null;
  22.    }
  23.  
  24.    public Name getResolvedName() {
  25.       return this.resolvedName;
  26.    }
  27.  
  28.    public Name getRemainingName() {
  29.       return this.remainingName;
  30.    }
  31.  
  32.    public Object getResolvedObj() {
  33.       return this.resolvedObj;
  34.    }
  35.  
  36.    public String getExplanation() {
  37.       return ((Throwable)this).getMessage();
  38.    }
  39.  
  40.    public void setResolvedName(Name var1) {
  41.       if (var1 != null) {
  42.          this.resolvedName = (Name)var1.clone();
  43.       } else {
  44.          this.resolvedName = null;
  45.       }
  46.  
  47.    }
  48.  
  49.    public void setRemainingName(Name var1) {
  50.       if (var1 != null) {
  51.          this.remainingName = (Name)var1.clone();
  52.       } else {
  53.          this.remainingName = null;
  54.       }
  55.  
  56.    }
  57.  
  58.    public void setResolvedObj(Object var1) {
  59.       this.resolvedObj = var1;
  60.    }
  61.  
  62.    public void appendRemainingComponent(String var1) {
  63.       if (var1 != null) {
  64.          try {
  65.             if (this.remainingName == null) {
  66.                this.remainingName = new CompositeName();
  67.             }
  68.  
  69.             this.remainingName.add(var1);
  70.          } catch (NamingException var3) {
  71.             throw new IllegalArgumentException(var3.toString());
  72.          }
  73.       }
  74.  
  75.    }
  76.  
  77.    public void appendRemainingName(Name var1) {
  78.       if (var1 != null) {
  79.          if (this.remainingName != null) {
  80.             try {
  81.                this.remainingName.addAll(var1);
  82.             } catch (NamingException var3) {
  83.                throw new IllegalArgumentException(var3.toString());
  84.             }
  85.          } else {
  86.             this.remainingName = (Name)var1.clone();
  87.          }
  88.  
  89.       }
  90.    }
  91.  
  92.    public Throwable getRootCause() {
  93.       return this.rootException;
  94.    }
  95.  
  96.    public void setRootCause(Throwable var1) {
  97.       if (var1 != this) {
  98.          this.rootException = var1;
  99.       }
  100.  
  101.    }
  102.  
  103.    public String toString() {
  104.       String var1 = super.toString();
  105.       if (this.rootException != null) {
  106.          var1 = var1 + " [Root exception is " + this.rootException + "]";
  107.       }
  108.  
  109.       if (this.remainingName != null) {
  110.          var1 = var1 + "; remaining name '" + this.remainingName + "'";
  111.       }
  112.  
  113.       return var1;
  114.    }
  115.  
  116.    public String toString(boolean var1) {
  117.       return var1 && this.resolvedObj != null ? this.toString() + "; resolved object " + this.resolvedObj : this.toString();
  118.    }
  119.  
  120.    public void printStackTrace() {
  121.       this.printStackTrace(System.err);
  122.    }
  123.  
  124.    public void printStackTrace(PrintStream var1) {
  125.       if (this.rootException != null) {
  126.          String var2 = super.toString();
  127.          synchronized(var1) {
  128.             var1.print(var2 + (var2.endsWith(".") ? "" : ".") + "  Root exception is ");
  129.             this.rootException.printStackTrace(var1);
  130.          }
  131.       } else {
  132.          super.printStackTrace(var1);
  133.       }
  134.  
  135.    }
  136.  
  137.    public void printStackTrace(PrintWriter var1) {
  138.       if (this.rootException != null) {
  139.          String var2 = super.toString();
  140.          synchronized(var1) {
  141.             var1.print(var2 + (var2.endsWith(".") ? "" : ".") + "  Root exception is ");
  142.             this.rootException.printStackTrace(var1);
  143.          }
  144.       } else {
  145.          super.printStackTrace(var1);
  146.       }
  147.  
  148.    }
  149. }
  150.