home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / VCafe / prosrc.bin / ExceptionEvent.java < prev    next >
Encoding:
Java Source  |  1998-03-18  |  2.8 KB  |  92 lines

  1. /*
  2.  * @(#ExceptionEvent.java
  3.  *
  4.  * Copyright (c) 1997 Symantec Corporation. All Rights Reserved.
  5.  *
  6.  */
  7.  
  8. //This class specifies an Exception event for an given Exception. The Exception event's parameters include
  9. //   the Exception name, which should be descriptive enough
  10.  
  11. //  the event type, which is one of EXCEPTION_SQL, EXCEPTION_APPLICATION.
  12.  
  13. //  the object that created the event.
  14. //  the data item referred to by the event
  15.  
  16. package symantec.itools.db.beans.binding;
  17.  
  18.  
  19. public  class ExceptionEvent extends java.util.EventObject
  20. {
  21.      //EXCEPTION_SQL
  22.      //Event type sent by a source to announce a SQLException.
  23. public static final int EXCEPTION_SQL =0;
  24.  
  25.      //EXCEPTION_APPLICATION
  26.      //Event type sent by a source to indicate that an application Exception.
  27. public static final int EXCEPTION_APPLICATION =1;
  28.  
  29.       //EXCEPTION_CAST
  30.      //Event type sent by a source to indicate that an application Exception.
  31. public static final int EXCEPTION_CAST =2;
  32.  
  33.      //EXCEPTION_NOROWS
  34.      //Event type sent by QueryNavigator to indicate that the RecordSet has no rows at all.
  35. public static final int EXCEPTION_NOROWS =3;
  36.  
  37.     //EXCEPTION_FIRSTROW
  38.      //Event type sent by QueryNavigator to indicate that the RecordSet has been reaching the first row.
  39. public static final int EXCEPTION_FIRSTROW=5;
  40.  
  41.     //EXCEPTION_LASTROW
  42.       //Event type sent by QueryNavigator to indicate that the RecordSet has been reaching the last row.
  43. public static final int EXCEPTION_LASTROW =6;
  44.         //EXCEPTION_PARENT_INVALID_RECORD
  45.       //Event type sent by QueryNavigator to indicate that navigation is tried in the details of a new inserted Master
  46. public static final int EXCEPTION_PARENT_INVALID_RECORD =7;
  47.  
  48.       //Event type sent by QueryNavigator to indicate that we try to make a M/D with the same QN
  49. public static final int EXCEPTION_ILLEGAL_RELATIONSHIP =7;
  50.          //Event type sent by QueryNavigator to indicate that we couldn't solve the relationship between 
  51.          //the Master and the Detail in the QuerySynchronizer
  52. public static final int EXCEPTION_RELATIONSHIP_PENDING=8;
  53.  
  54.     // this event type is used for debugging purpose. All the lines of codes including this line should be comment out when shipping
  55. public static final int DEBUGGING_MESSAGE=100;
  56.  
  57.  
  58. private int ty;
  59. private String itNa;
  60. private Exception ex;
  61.  
  62. public ExceptionEvent(int type, String itemName, Object source)  
  63. {
  64.     super(source);
  65.     ty=type;
  66.     itNa=itemName;
  67. }
  68.  
  69. public ExceptionEvent(int type, String itemName, Object source, Exception e)
  70. {
  71.     super(source);
  72.     ty=type;
  73.     itNa=itemName;
  74.     ex=e;
  75. }
  76.  
  77.  
  78. public synchronized Exception getException()
  79. {
  80.     return ex;
  81. }
  82.  
  83. public synchronized int getEventType()
  84. {
  85.     return ty;
  86. }
  87.  
  88. public synchronized String getExceptionName()
  89.      {
  90.         return itNa;
  91.      }
  92. }