Examples of ObjectAndPersistInfo


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

   */
  public ObjectAndPersistInfo getValue(final FieldInfo fieldInfo)
      throws ConversionException {
    // ASSERTX
    assert fieldInfo != null : "field information must be set";
    final ObjectAndPersistInfo value;
    final Integer index = fieldValueIndexByFieldInfoMap.get(fieldInfo);
    if (index == null) {
      value = null;
    } else {
      value = fieldsValue.get(index.intValue());
View Full Code Here

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

    final ObjectAndPersistInfo[] elementData = new ObjectAndPersistInfo[size];
    fieldsValue.toArray(elementData);

    for (int index = 0; index < size; index++) {
      final int newIndex = newIndexList[index];
      final ObjectAndPersistInfo fieldValue = elementData[index];
      fieldsValue.set(newIndex, fieldValue);
      final FieldInfo fieldInfo = fieldInfos[index];
      if (fieldInfo != null) {
        fieldInfoByIndex.put(newIndex, fieldInfo);
        fieldValueIndexByFieldInfoMap.put(fieldInfo, newIndex);
View Full Code Here

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

    Object[] referenceds = toSerializeAndReferenced.getReferenceds();

    // initial write
    WriteResult writeResult = write(toSerialize, classInfo);
    ObjectClassInfoAndDeclared[] sons = writeResult.getSons();
    ObjectAndPersistInfo objectAndPersistInfo = writeResult
        .getObjectAndPersistInfo();
    final byte[] binary = writeResult.getBinary();

    // check sons wrote
    assertSons(toSerialize, sons, referenceds);
    ObjectClassInfoAndDeclared[] originalValue = objectAndPersistInfo.originalValue;
    assertSons(toSerialize, originalValue, referenceds);
    // dummy data record identifier for object
    final DataRecordIdentifier dataRecordIdentifier =
    /**/getOrCreateDataRecordIdentifierAssociatedToObject(objectAndPersistInfo);

    // create the object by reading
    final IObjectInput objectInput = new ObjectInputImmediateSerializable(
        this, classInfoFactory, proxyManager2, helperBinaryConversion);

    final StorageInfo storageInfo = new StorageInfo();
    // storageInfo.setHeaderDataSize(0);
    ObjectAndPersistInfo unserializedAndPersistInfo = objectInput
        .createObject(dataRecordIdentifier, binary, classInfo,
            storageInfo);
    originalValue = unserializedAndPersistInfo.originalValue;
    assertSons(toSerialize, originalValue, referenceds);
    final Object unserialized = unserializedAndPersistInfo.getObject();
    if (testEquals) {
      assertEquals("read and wrote must have the same value",
          toSerialize, unserialized);
    }
    assertUnserialized(unserialized);
View Full Code Here

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

      ObjectIODataRecordNotFoundException,
      ObjectIOClassNotFoundException, ObjectIODataCorruptedException,
      ObjectIOTooBigForSerializationException {
    final StorageInfo storageInfo = new StorageInfo();
    final int offset = storageInfo.getHeaderDataSize();
    final ObjectAndPersistInfo objectAndPersistInfo =
    /**/new ObjectAndPersistInfo(toSerialize, false, classInfo,
        storageInfo);
    final IObjectOutput objectOutput = new ObjectOutputSerializable(this,
        classInfoFactory, proxyManager2, helperBinaryConversion);
    // prepare write
    objectOutput.prepareWrite(objectAndPersistInfo);
View Full Code Here

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

        classInfoFactory, proxyManager2, helperBinaryConversion);
    final ClassInfo classInfo = classInfoFactory
        .getNoProxyClassInfo(Integer.class);
    final Integer integer = Integer.valueOf(10);
    final StorageInfo storageInfo = new StorageInfo();
    final ObjectAndPersistInfo objectAndItsClassInfo =
    /**/new ObjectAndPersistInfo(integer, false, classInfo, storageInfo);
    objectOutput.prepareWrite(objectAndItsClassInfo);
    final byte[] binary = new byte[1000];
    final int offset = storageInfo.getHeaderDataSize();
    storageInfo.setHeaderDataSize(offset);
    // int byte size to skip class name information
View Full Code Here

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

        .getNoProxyClassInfo(Bob1.class);
    // FIXMELUC ___must use objectStateMap as factory
    // final ObjectAndPersistInfo objectAndItsClassInfo = new
    // ObjectAndPersistInfo(
    // bob1, false, bob1ClassInfo, new StorageInfo(0));
    final ObjectAndPersistInfo objectAndItsClassInfo = objectStateMap
        .createObjectAndPersistInfoOfObject(bob1, false, bob1ClassInfo);
    objectAndItsClassInfo.setObjectStateMap(objectStateMap);
    final DataRecordIdentifier identifier = objectIOManager
        .getOrCreateDataRecordIdentifierAssociatedToObject(objectAndItsClassInfo);
    objectIOManager.prepareWrite(objectAndItsClassInfo);
    objectIOManager.write(objectAndItsClassInfo);

    // removedFromCandidateIdentifier = null;// NOPMD

    final ClassInfo classInfo = classInfoFactory
        .getNoProxyClassInfo(Bob1.class);
    final StorageInfo storageInfo = new StorageInfo();
    storageInfo
        .setHeaderDataSize(AbstractObjectIOManagerIOForObject.HEADER_DATA_SIZE);
    objectIOManager
        .clearObjectAndPersistInfoByDataRecordIdentifier(identifier);
    final ObjectAndPersistInfo proxyObjectAndItsClassInfo = proxyManager2
        .newInstanceNoConstruction(classInfo, storageInfo,
            objectIOManager, identifier, true);
    assertEquals("must load right value", 10,
        ((Bob1) proxyObjectAndItsClassInfo.getObject()).getVal());
    // no more remove from garbage at load, was a bug, removed from garbage
    // at creation
    // assertEquals("must remove from garbage", identifier,
    // removedFromCandidateIdentifier);
  }
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;
    try {
      objectAndPersistInfo = new ObjectAndPersistInfo(object,
          proxyInstance, objectClassInfo);
      final ProxyCallBack proxyCallBack = new ProxyCallBack(this);
      ProxyManager2.setProxyCallBack(objectAndPersistInfo, proxyCallBack,
          isExclusiveAccessSession());
    } catch (ClassInfoException exception) {
      throw new ObjectIOException(exception);
    } catch (ProxyException exception) {
      throw new ObjectIOException(exception);
    }
    objectAndPersistInfo.setDataRecordIdentifier(dataRecordIdentifier);
    return objectAndPersistInfo;
  }
View Full Code Here

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

    rootBob1.setBob2(bob2RefByRootBob1);
    rootBob1.setBob3(new Bob3());
    rootBob1 = null;// NOPMD want to unreference
    // save not for close
    storeForTest.save(false, false);
    final ObjectAndPersistInfo opiBob3 = storeForTest
        .getObjectAndPersistInfoOfObjectFromQueue(bob3RefByBob2RefByRootBob1);
    assertTrue("must be weaked", opiBob3.isWeak());
    bob2RefByRootBob1 = null;// NOPMD want to unreference
    rootBob1 = null;// NOPMD want to unreference
    bob3RefByBob2RefByRootBob1 = null;// NOPMD want to unreference
    storeForTest.save(false, false);
    assertTrue("must be weaked", opiBob3.isWeak());
    MemoryEater.useAllMemoryThenRelease();
    assertTrue("must be free", opiBob3.hasNoReferences());

    rootBob1 = (Bob1) storeForTest.readAndGetRoot();
    assertNotNull("must be set", rootBob1.getBob1());// NOPMD
    bob2RefByRootBob1 = rootBob1.getBob2();
    assertNotNull("must be set", bob2RefByRootBob1);
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, ObjectIODataCorruptedException {
    final ObjectAndPersistInfo objectAndPersistInfo;
    try {
      objectAndPersistInfo = new ObjectAndPersistInfo(object,
          proxyInstance, objectClassInfo);
      final ProxyCallBack proxyCallBack = new ProxyCallBack(this);
      ProxyManager2.setProxyCallBack(objectAndPersistInfo, proxyCallBack,
          isExclusiveAccessSession());
    } catch (ClassInfoException 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
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.