Examples of ObjectAndPersistInfo


Examples of net.sf.joafip.store.entity.objectio.ObjectAndPersistInfo

  @Override
  public ObjectAndPersistInfo createObjectPersistInfoOfObject(
      final Object object, final Boolean proxyInstance,
      final ClassInfo objectClassInfo, final boolean persisted)
      throws ObjectIOException {
    final ObjectAndPersistInfo objectAndPersistInfo;
    final boolean objectIsProxyInstance;
    if (proxyInstance == null) {
      objectIsProxyInstance = object == null ? false : ProxyManager2
          .isProxyOrEnhanced(object);
    } else {
      objectIsProxyInstance = proxyInstance.booleanValue();
    }
    try {
      objectAndPersistInfo = new ObjectAndPersistInfo(object,
          objectIsProxyInstance, objectClassInfo);
    } catch (ClassInfoException exception) {
      throw new ObjectIOException(exception);
    }
    if (persisted) {
View Full Code Here

Examples of net.sf.joafip.store.entity.objectio.ObjectAndPersistInfo

  public ObjectAndPersistInfo getOrCreateObjectPersistInfoOfObject(
      final Object object, final boolean proxyInstance,
      final ClassInfo objectClassInfo,
      final DataRecordIdentifier dataRecordIdentifier)
      throws ObjectIOException {
    ObjectAndPersistInfo objectAndPersistInfo = objectAndPersistInfoMap
        .get(new ObjectIdentityKey(object));
    if (objectAndPersistInfo == null) {
      objectAndPersistInfo = createObjectPersistInfoOfObject(object,
          proxyInstance, objectClassInfo, dataRecordIdentifier);
    }
View Full Code Here

Examples of net.sf.joafip.store.entity.objectio.ObjectAndPersistInfo

  public ObjectAndPersistInfo createObjectPersistInfoOfObject(
      final Object object, final boolean proxyInstance,
      final ClassInfo objectClassInfo,
      final DataRecordIdentifier dataRecordIdentifier)
      throws ObjectIOException {
    final ObjectAndPersistInfo objectAndPersistInfo;
    if (object == null) {
      objectAndPersistInfo = ObjectAndPersistInfo.NULL;
    } else {
      try {
        objectAndPersistInfo = new ObjectAndPersistInfo(object,
            proxyInstance, objectClassInfo);
      } catch (ClassInfoException exception) {
        throw new ObjectIOException(exception);
      }
      objectAndPersistInfo.setDataRecordIdentifier(dataRecordIdentifier);
      objectAndPersistInfoMap.put(objectAndPersistInfo,
          objectAndPersistInfo);
    }
    return objectAndPersistInfo;
  }
View Full Code Here

Examples of net.sf.joafip.store.entity.objectio.ObjectAndPersistInfo

  @Override
  public ObjectAndPersistInfo getOrCreateObjectPersistInfoOfObject(
      final Object object, final Boolean proxyInstance,
      final boolean persisted) throws ObjectIOException,
      ObjectIODataCorruptedException {
    ObjectAndPersistInfo objectAndPersistInfo;
    try {
      objectAndPersistInfo = new ObjectAndPersistInfo(object,
          proxyInstance, classInfoFactory.getNoProxyClassInfo(object
              .getClass()));
    } catch (ClassInfoException exception) {
      throw new ObjectIOException(exception);
    }
View Full Code Here

Examples of net.sf.joafip.store.entity.objectio.ObjectAndPersistInfo

  @Override
  public ObjectAndPersistInfo getOrCreateObjectPersistInfoOfObject(
      final Object object, final Boolean proxyInstance,
      final ClassInfo objectClassInfo, final boolean persisted)
      throws ObjectIOException {
    ObjectAndPersistInfo objectAndPersistInfo = objectAndPersistInfoMap
        .get(new ObjectIdentityKey(object));
    if (objectAndPersistInfo == null) {
      objectAndPersistInfo = createObjectPersistInfoOfObject(object,
          proxyInstance, objectClassInfo, persisted);
    }
View Full Code Here

Examples of net.sf.joafip.store.entity.objectio.ObjectAndPersistInfo

  @Override
  public ObjectAndPersistInfo createObjectPersistInfoOfObject(
      final Object object, final Boolean proxyInstance,
      final ClassInfo objectClassInfo, final boolean persisted)
      throws ObjectIOException {
    final ObjectAndPersistInfo objectAndPersistInfo;
    try {
      objectAndPersistInfo = new ObjectAndPersistInfo(object,
          proxyInstance, objectClassInfo);
    } catch (ClassInfoException exception) {
      throw new ObjectIOException(exception);
    }
    if (persisted) {
View Full Code Here

Examples of net.sf.joafip.store.entity.objectio.ObjectAndPersistInfo

  public ObjectAndPersistInfo getOrCreateObjectPersistInfoOfObject(
      final Object object, final boolean proxyInstance,
      final ClassInfo objectClassInfo,
      final DataRecordIdentifier dataRecordIdentifier)
      throws ObjectIOException {
    ObjectAndPersistInfo objectAndPersistInfo = objectAndPersistInfoMap
        .get(new ObjectIdentityKey(object));
    if (objectAndPersistInfo == null) {
      objectAndPersistInfo = createObjectPersistInfoOfObject(object,
          proxyInstance, objectClassInfo, dataRecordIdentifier);
    }
View Full Code Here

Examples of net.sf.joafip.store.entity.objectio.ObjectAndPersistInfo

  public ObjectAndPersistInfo createObjectPersistInfoOfObject(
      final Object object, final boolean proxyInstance,
      final ClassInfo objectClassInfo,
      final DataRecordIdentifier dataRecordIdentifier)
      throws ObjectIOException {
    final ObjectAndPersistInfo objectAndPersistInfo;
    try {
      objectAndPersistInfo = new ObjectAndPersistInfo(object,
          proxyInstance, objectClassInfo);
    } catch (ClassInfoException exception) {
      throw new ObjectIOException(exception);
    }
    objectAndPersistInfo.setDataRecordIdentifier(dataRecordIdentifier);
    objectAndPersistInfoMap.put(objectAndPersistInfo, objectAndPersistInfo);
    return objectAndPersistInfo;
  }
View Full Code Here

Examples of net.sf.joafip.store.entity.objectio.ObjectAndPersistInfo

    final IObjectIOManagerForProxyObjectIO objectIoManager = proxyCallBack
        .getObjectIOManager$JOAFIP$();
    assertSame("bad file persistence association",
        objectIOManagerOfFilePersistence, objectIoManager);
    final ObjectAndPersistInfo objectAndPersistInfo = objectIOManagerOfFilePersistence
        .getObjectAndPersistInfoOfObject(node);
    assertNotNull("must has persistence state", objectAndPersistInfo);
    session.close();
  }
View Full Code Here

Examples of net.sf.joafip.store.entity.objectio.ObjectAndPersistInfo

    saveDoneFlag = false;
    session.setObject(KEY, bob1);
    assertTrue(MUST_SAVE, saveDoneFlag);
    // bob1 = null;// NOPMD release/unreference the object
    session.save(); // to clear bob1 persistence state
    final ObjectAndPersistInfo opiBob1 = filePersistence
        .getObjectAndPersistInfoOfObjectFromQueue(bob1);
    bob1 = null;// NOPMD release/unreference the object
    session.save(); // to clear bob1 persistence state

    // useMemory(opiBob1);
    MemoryEater.useAllMemoryThenRelease();
    assertTrue("must be free", opiBob1.hasNoReferences());

    saveDoneFlag = false;
    bob1 = (Bob1) session.getObject(KEY);
    assertTrue(MUST_SAVE, saveDoneFlag);

    assertNotNull("must retrieve bob1", bob1);
    saveDoneFlag = false;
    assertTrue("must be a proxy", ProxyManager2.isProxyOrEnhanced(bob1));
    assertFalse("must not be loaded",
        ProxyManager2.proxiedObjectIsLoaded(bob1));
    assertFalse("must not change", saveDoneFlag);// check proxy manager not
    // alter state
    bob1.setBob2(new Bob2());// must trigger auto save
    assertTrue(MUST_SAVE, saveDoneFlag);
    // assert not loaded, not loaded because of auto save
    assertFalse("must not be loaded",
        ProxyManager2.proxiedObjectIsLoaded(bob1));

    Bob2 bob2 = bob1.getBob2();
    assertFalse("must not be a proxy " + bob2.toString(),
        ProxyManager2.isProxyOrEnhanced(bob2));
    // bob2 = null;// NOPMD
    /* save to erase bob2 persistence state => bob2 no more referenced */
    session.save();
    final ObjectAndPersistInfo opiBob2 = filePersistence
        .getObjectAndPersistInfoOfObjectFromQueue(bob2);
    bob2 = null;// NOPMD
    session.save();

    // useMemory(opiBob2);
    MemoryEater.useAllMemoryThenRelease();
    assertTrue("must be free", opiBob2.hasNoReferences());

    bob2 = bob1.getBob2();
    assertTrue("must be a proxy", ProxyManager2.isProxyOrEnhanced(bob2));

    session.close();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.