1 11 package org.eclipse.core.internal.indexing; 12 13 abstract class IndexedStoreObject extends StoredObject { 14 15 public IndexedStoreObject() { 16 super(); 17 } 18 19 23 public IndexedStoreObject(Field f, ObjectStore store, ObjectAddress address) throws ObjectStoreException { 24 super(f, store, address); 25 } 26 27 30 protected final IndexAnchor acquireAnchor(ObjectAddress address) throws IndexedStoreException { 31 return (IndexAnchor) acquireObject(address); 32 } 33 34 37 protected final IndexNode acquireNode(ObjectAddress address) throws IndexedStoreException { 38 return (IndexNode) acquireObject(address); 39 } 40 41 44 protected final StoredObject acquireObject(ObjectAddress address) throws IndexedStoreException { 45 StoredObject object; 46 try { 47 object = store.acquireObject(address); 48 } catch (ObjectStoreException e) { 49 throw new IndexedStoreException(IndexedStoreException.ObjectNotAcquired, e); 50 } 51 return object; 52 } 53 54 57 protected final ObjectAddress insertObject(StoredObject object) throws IndexedStoreException { 58 try { 59 ObjectAddress address = store.insertObject(object); 60 return address; 61 } catch (ObjectStoreException e) { 62 throw new IndexedStoreException(IndexedStoreException.ObjectNotStored, e); 63 } 64 } 65 66 69 protected final void release() throws IndexedStoreException { 70 try { 71 store.releaseObject(this); 72 } catch (ObjectStoreException e) { 73 throw new IndexedStoreException(IndexedStoreException.ObjectNotReleased, e); 74 } 75 } 76 77 80 protected final void removeObject(ObjectAddress address) throws IndexedStoreException { 81 try { 82 store.removeObject(address); 83 } catch (ObjectStoreException e) { 84 throw new IndexedStoreException(IndexedStoreException.ObjectNotRemoved, e); 85 } 86 } 87 } 88 | Popular Tags |