1 19 20 package org.netbeans.mdr.storagemodel; 21 import java.lang.ref.WeakReference ; 22 import java.lang.ref.Reference ; 23 import java.lang.ref.ReferenceQueue ; 24 import java.util.HashMap ; 25 import java.util.ArrayList ; 26 import java.util.Collection ; 27 import java.util.Iterator ; 28 import java.util.Map ; 29 import java.util.List ; 30 import org.netbeans.mdr.persistence.MOFID; 31 import org.netbeans.mdr.persistence.StorageException; 32 import org.netbeans.mdr.persistence.StorageBadRequestException; 33 37 public class TransientStorableClass extends StorableClass implements Transient { 38 39 40 41 public TransientStorableClass() { 42 super (); 43 } 44 45 public TransientStorableClass(MdrStorage mdrStorage, org.netbeans.mdr.persistence.MOFID packageId, org.netbeans.mdr.persistence.MOFID metaId, 46 List attrDescs, List clAttrDescs, Map datatypes, boolean classDerived, 47 boolean instanceDerived, boolean isSingleton, boolean isAbstract) throws StorageException { 48 super (mdrStorage, packageId, metaId, attrDescs, clAttrDescs, datatypes, classDerived, instanceDerived, isSingleton, isAbstract); 49 } 50 51 public Collection allObjects (boolean subclasses) throws StorageException { 52 if (subclasses) { 53 return super.allObjects (subclasses); 54 } 55 else { 56 return collectInstances (); 57 } 58 } 59 60 public boolean isTransient () { 61 return true; 62 } 63 64 65 66 private synchronized Collection collectInstances () throws StorageException { 67 MdrStorage storage = this.getMdrStorage (); 68 return new IndexImmutSet(storage, storage.getTransientStorage ().getMultivaluedIndex (MdrStorage.IDX_OBJECTS_BY_CLASSES), this.getMofId ()); 69 } 70 71 72 } 73 | Popular Tags |