logging of stacktraces related to deletion of jmi objects added release50_beta2-BLD200511112121
authordprusa@netbeans.org
Tue, 08 Nov 2005 14:27:30 +0000
changeset 1734673492c2c185
parent 1733 a8f369964e1c
child 1735 4eea9d0d5e59
logging of stacktraces related to deletion of jmi objects added
mdr/src/org/netbeans/mdr/handlers/BaseObjectHandler.java
mdr/src/org/netbeans/mdr/handlers/InstanceHandler.java
     1.1 --- a/mdr/src/org/netbeans/mdr/handlers/BaseObjectHandler.java	Tue Oct 25 12:46:21 2005 +0000
     1.2 +++ b/mdr/src/org/netbeans/mdr/handlers/BaseObjectHandler.java	Tue Nov 08 14:27:30 2005 +0000
     1.3 @@ -42,6 +42,8 @@
     1.4      private static MDRClassLoader defaultLoader = null;
     1.5      private static ClassLoaderProvider provider = null;
     1.6      
     1.7 +    static Map deletedInstances = new WeakHashMap();
     1.8 +    
     1.9      /* --------------------------------------------------------------------- */
    1.10      /* -- Static setters/getters ------------------------------------------- */
    1.11      /* --------------------------------------------------------------------- */
    1.12 @@ -350,11 +352,19 @@
    1.13              else
    1.14                  result = mdrStorage.getObject(mofId);     // Persistent object
    1.15              if (result == null) {
    1.16 -                throw new InvalidObjectException(null, "Object with MOFID " + mofId + " no longer exists.");
    1.17 +                Exception exc = (Exception)deletedInstances.get(this);
    1.18 +                if (exc != null) {
    1.19 +                    Logger.getDefault().notify(Logger.INFORMATIONAL, exc);
    1.20 +                }
    1.21 +                throw new InvalidObjectException(null, "Object with MOFID " + mofId + " no longer exists, class: " + getClass().getName());
    1.22              }
    1.23              return result;
    1.24          } catch (StorageBadRequestException e) {
    1.25 -            throw new InvalidObjectException(null, "Object with MOFID " + mofId + " no longer exists.");
    1.26 +            Exception exc = (Exception)deletedInstances.get(this);
    1.27 +            if (exc != null) {
    1.28 +                Logger.getDefault().notify(Logger.INFORMATIONAL, exc);
    1.29 +            }
    1.30 +            throw new InvalidObjectException(null, "Object with MOFID " + mofId + " no longer exists, class: " + getClass().getName());
    1.31          } catch (StorageException e) {
    1.32              throw new DebugException(e.toString());
    1.33          }
     2.1 --- a/mdr/src/org/netbeans/mdr/handlers/InstanceHandler.java	Tue Oct 25 12:46:21 2005 +0000
     2.2 +++ b/mdr/src/org/netbeans/mdr/handlers/InstanceHandler.java	Tue Nov 08 14:27:30 2005 +0000
     2.3 @@ -304,6 +304,8 @@
     2.4                  _getMdrStorage().getEventNotifier().INSTANCE.firePlannedChange(this, event);
     2.5              }
     2.6              _delete();
     2.7 +            Exception deletionStackTrace = new Exception("mofId: " + refMofId() + ", class: " + getClass().getName());
     2.8 +            BaseObjectHandler.deletedInstances.put(this, deletionStackTrace);
     2.9              fail = false;
    2.10          } finally {
    2.11              _unlock(fail);