/** * Ultimately remove an object (oid), when there are no more external or internal references. */ protected void removeObject(Object id) { // #ifndef MIDP assert nocheck || generator.isId(id); // #endif // Remove the object itself (needs to be done before removing its references to avoid recursion) Map content = (Map)objects.remove(id); weakobjects.put(id, content); // objectspertype.remove(types.get(id), id); if(content==null) throw new RuntimeException("Object not found: "+id); deletedobjects.put(id, content); assert getObjectUsages(id)==null || getObjectUsages(id).isEmpty() : getObjectUsages(id); objectusages.remove(id); // type will be removed in notifyEventListeners() }
/** * Test if reading the object (oid) is allowed. * Reading is allowed on removed objects as long as there are external references. * @param id The object (oid). * @return True, if valid. */ protected boolean checkValidStateObjectRead(Object id) { // #ifndef MIDP assert nocheck || generator.isId(id); // #endif return checkValidStateObject(id) || weakobjects.containsKey(id); }
/** * Test if reading the object (oid) is allowed. * Reading is allowed on removed objects as long as there are external references. * @param id The object (oid). * @return True, if valid. */ protected boolean checkValidStateObjectRead(Object id) { // #ifndef MIDP assert nocheck || generator.isId(id); // #endif return checkValidStateObject(id) || weakobjects.containsKey(id); }
/** * Ultimately remove an object (oid), when there are no more external or internal references. */ protected void removeObject(Object id) { // #ifndef MIDP assert nocheck || generator.isId(id); // #endif // Remove the object itself (needs to be done before removing its references to avoid recursion) Map content = (Map)objects.remove(id); weakobjects.put(id, content); // objectspertype.remove(types.get(id), id); if(content==null) throw new RuntimeException("Object not found: "+id); deletedobjects.put(id, content); assert getObjectUsages(id)==null || getObjectUsages(id).isEmpty() : getObjectUsages(id); objectusages.remove(id); // type will be removed in notifyEventListeners() }