ObjStore

From Buni.org

Jump to: navigation, search

ObjStore

More information later. We don't use this in meldware or anything at the moment. This is an experimental library for storing/retrieving Java object using FileStore. You can view the source: here. The unit tests are the best example of usage available at the moment.

       int MAX_SESSIONS = 10;
       FileStoreSessionPool pool = new FileStoreSessionPool(ObjStoreUtl.config(), MAX_SESSIONS);
       ObjStore store = new ObjStore(pool);
       String val = "hello";
       long id = 0;
       TestObj foo = new TestObj(val);
       FileStoreSession session = pool.getSession();
       StoredObject obj = store.store(session, foo);
       id = obj.getId();
       obj.close();
       foo = (TestObj)store.retrieve(session,id);
       obj.close();
       session.close();