"DeferredObject" related changes BLD200310010100
authordprusa@netbeans.org
Tue, 30 Sep 2003 20:32:36 +0000
changeset 1350227a8014e7bb
parent 1349 9bc222ae3503
child 1351 02c7685a5fa1
"DeferredObject" related changes
mdr/src/org/netbeans/mdr/handlers/BaseObjectHandler.java
     1.1 --- a/mdr/src/org/netbeans/mdr/handlers/BaseObjectHandler.java	Tue Sep 30 20:31:59 2003 +0000
     1.2 +++ b/mdr/src/org/netbeans/mdr/handlers/BaseObjectHandler.java	Tue Sep 30 20:32:36 2003 +0000
     1.3 @@ -154,7 +154,12 @@
     1.4              return null;
     1.5          }
     1.6  
     1.7 -        synchronized (s.getMdrStorage().getStorageByMofId(s.getMofId())) {
     1.8 +        // [PENDING]
     1.9 +        Object lock = s.getMdrStorage().getStorageByMofId(s.getMofId());
    1.10 +        if (lock == null)
    1.11 +            lock = facilityCache;
    1.12 +        
    1.13 +        synchronized (lock) {
    1.14  //        synchronized (facilityCache) {
    1.15              RefBaseObject refBO = (RefBaseObject) (facilityCache.get(s.getMofId()));
    1.16  
    1.17 @@ -205,10 +210,17 @@
    1.18              else if (cls.equals (TransientStorableAssociation.class)) {
    1.19                  cls = StorableAssociation.class;
    1.20              }
    1.21 +            else if (cls.getName ().equals ("org.netbeans.modules.classmodel.jmiimpl.physical.DeferredObject")) {
    1.22 +                cls = StorableObject.class; // [PENDING]
    1.23 +            }
    1.24              /* create handler object, if necessary */
    1.25              Constructor cons = cl.getConstructor(new Class[] {cls});
    1.26 -
    1.27 -            synchronized (s.getMdrStorage().getStorageByMofId(s.getMofId())) {
    1.28 +            
    1.29 +            // [PENDING]
    1.30 +            Object lock = s.getMdrStorage().getStorageByMofId(s.getMofId());
    1.31 +            if (lock == null)
    1.32 +                lock = facilityCache;
    1.33 +            synchronized (lock) {
    1.34  //                synchronized (facilityCache) {
    1.35                      Object oldRecord = facilityCache.get(s.getMofId());
    1.36                      if (oldRecord == null) {
    1.37 @@ -298,9 +310,19 @@
    1.38          //this.storableDelegate = storable;
    1.39          this.mdrStorage = storable.getMdrStorage();
    1.40          try {
    1.41 +            // [PENDING]
    1.42 +            /*
    1.43              if (storable instanceof StorableObject && ((StorableObject)storable).getClassProxy ().isTransient ()) {
    1.44                  this.storable = storable;
    1.45 -            }   
    1.46 +            }
    1.47 +             */
    1.48 +            if (storable instanceof StorableObject && 
    1.49 +                (((StorableObject)storable).getClassProxy ().isTransient ()) || 
    1.50 +                (storable.getClass().getName().equals("org.netbeans.modules.classmodel.jmiimpl.physical.DeferredObject"))
    1.51 +                ) {
    1.52 +                this.storable = storable;
    1.53 +            }
    1.54 +            
    1.55              else {
    1.56                  this.storable = null;
    1.57              }