Package net.sf.joafip.store.entity.objectio

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


  private ObjectAndPersistInfo getOrCreateObjectAndPersistInfoOfObject(
      final Object object, final Boolean proxyInstance,
      final ClassInfo objectClassInfo) throws ObjectIOException,
      ObjectIODataCorruptedException {
    ObjectAndPersistInfo objectPersistInfoOfObject =
    /**/getObjectAndPersistInfoOfObject(object);
    if (objectPersistInfoOfObject == null) {
      objectPersistInfoOfObject = createObjectAndPersistInfoOfObject(
          object, proxyInstance, objectClassInfo);
    }
View Full Code Here


    } else {
      objectIsProxyInstance = proxyInstance.booleanValue();
      assert objectIsProxyInstance == ProxyManager2
          .isProxyOrEnhanced(object);
    }
    final ObjectAndPersistInfo objectPersistInfoOfObject = createObjectAndPersistInfoOfObjectImpl(
        object, objectIsProxyInstance, objectClassInfo);
    // FIXMELUC _bad assert ?
    // assert assertProxyInstanceState(object, objectIsProxyInstance,
    // objectPersistInfoOfObject);
    associateNewDataRecordIdentifierToObject(objectPersistInfoOfObject);
View Full Code Here

  @Override
  protected ObjectAndPersistInfo createSubstituteObjectPersistInfoOfObject(
      final Object substituteObject, final ClassInfo substituteClassInfo,
      final ObjectAndPersistInfo substitutedObjectAndPersistInfo)
      throws ObjectIOException {
    final ObjectAndPersistInfo substituteObjectAndPersistInfo;
    try {
      substituteObjectAndPersistInfo = new ObjectAndPersistInfo(
          substituteObject, false/* proxyInstance */,
          substituteClassInfo);
    } catch (ClassInfoException exception) {
      throw new ObjectIOException(exception);
    }
    substitutedObjectAndPersistInfo
        .setSubstituteObjectAndPersistInfo(substituteObjectAndPersistInfo);
    substituteObjectAndPersistInfo
        .setDataRecordIdentifier(substitutedObjectAndPersistInfo.dataRecordIdentifier);
    return substituteObjectAndPersistInfo;
  }
View Full Code Here

      final ClassInfo objectClassInfo,
      final DataRecordIdentifier dataRecordIdentifier)
      throws ObjectIOException, ObjectIODataCorruptedException {
    // ASSERTX
    assert dataRecordIdentifier != null : "data record identifier must be defined";
    ObjectAndPersistInfo objectPersistInfoOfObject;
    if (object == null) {
      objectPersistInfoOfObject = ObjectAndPersistInfo.NULL;
    } else {
      objectPersistInfoOfObject = getObjectByIdentifier(dataRecordIdentifier);
      if (objectPersistInfoOfObject == null) {
        /*
         * not already has persistence information, need to be created :
         * case of reading object in store
         */
        objectPersistInfoOfObject = createObjectAndPersistInfoOfObjectImpl(
            object, proxyInstance, objectClassInfo);
        objectPersistInfoOfObject
            .setDataRecordIdentifier(dataRecordIdentifier);
        dataRecordIdentifierAssociatedToObjectSetted(objectPersistInfoOfObject);
      }
      // ASSERTX
      else {
View Full Code Here

      final ClassInfo objectClassInfo,
      final DataRecordIdentifier dataRecordIdentifier)
      throws ObjectIOException {
    // ASSERTX
    assert dataRecordIdentifier != null : "data record identifier must be defined";
    final ObjectAndPersistInfo objectPersistInfoOfObject;
    if (object == null) {
      objectPersistInfoOfObject = ObjectAndPersistInfo.NULL;
    } else {
      objectPersistInfoOfObject = createObjectAndPersistInfoOfObjectImpl(
          object, proxyInstance, objectClassInfo);
      objectPersistInfoOfObject
          .setDataRecordIdentifier(dataRecordIdentifier);
      dataRecordIdentifierAssociatedToObjectSetted(objectPersistInfoOfObject);
    }
    return objectPersistInfoOfObject;
  }
View Full Code Here

  public void reInitializeEnum(final Enum<?> enumValue)
      throws ObjectIOException, ObjectIODataCorruptedException {
    try {
      final ClassInfo enumClassInfo = classInfoFactory
          .getNoProxyClassInfo(enumValue.getClass());
      final ObjectAndPersistInfo enumAndPersistInfo = getOrCreateObjectAndPersistInfoOfObject(
          enumValue, Boolean.FALSE, enumClassInfo);
      objectInputEnum.reInitialize(enumAndPersistInfo);
    } catch (final ClassInfoException exception) {
      throw new ObjectIOException(exception);
    }
View Full Code Here

      fromBinaryInfo = basicOrReferenceInput.fromBinary(binary, offset);
    } catch (Exception exception) {
      throw new IOException(exception);
    }
    offset = fromBinaryInfo.getEndOffset();
    final ObjectAndPersistInfo readObjectAndItsClassInfo = fromBinaryInfo
        .getObjectAndPersistInfo();
    // FIXMELUC x needed ? why not: cause an error if have this test
    // if (!readObjectAndItsClassInfo.isValueDefined()) {
    // throw new IOException("value must be defined");
    // }
    if (fromBinaryInfo.isReferenceRead()) {
      final ObjectClassInfoAndDeclared readObjectClassInfoAndDeclared =
      /**/new ObjectClassInfoAndDeclared(readObjectAndItsClassInfo,
          readObjectAndItsClassInfo.objectClassInfo);
      // ASSERTX
      assert objectAndPersistInfo != null : OBJECT_NOT_DEFINED;
      final boolean accepted = objectAndPersistInfo
          .addSonReadObjectByInputStream(
              readObjectClassInfoAndDeclared, unshared);
      if (!accepted) {
        throw new InvalidObjectException(
            "cannot read back reference as unshared");
      }
    }
    basicOrReferenceInput.free(fromBinaryInfo);

    if (LOGGER.debugEnabled) {
      LOGGER.debug("read object "
          + readObjectAndItsClassInfo.objectClassInfo);
    }
    return readObjectAndItsClassInfo.getObject();
  }
View Full Code Here

    if (LOGGER.debugEnabled) {
      LOGGER.debug("read utf at" + offset);
    }
    try {
      final Object object = readObject();
      final ObjectAndPersistInfo stringAndPersistInfo = objectIOManager
          .getOrCreateObjectPersistInfoOfObject(object,
              Boolean.FALSE, stringClassInfo, true);
      final ObjectClassInfoAndDeclared readObjectClassInfoAndDeclared = new ObjectClassInfoAndDeclared(
          stringAndPersistInfo, stringClassInfo);
      // ASSERTX
View Full Code Here

      throw new ObjectIOException(FAILED_CREATE_OBJECT, exception);
    } catch (ReflectInvalidClassException exception) {
      throw new ObjectIOInvalidClassException(FAILED_CREATE_OBJECT,
          exception);
    }
    final ObjectAndPersistInfo objectPersistInfoOfObject = objectIOManager
        .createObjectPersistInfoOfObject(instanceCreated, false,
            classInfo, dataRecordIdentifier);
    objectPersistInfoOfObject.setStorageInfo(storageInfo);
    return objectPersistInfoOfObject;
  }
View Full Code Here

          // classInfoFactory.getClassInfo(int.class),
          // false, false);
          currentObject.setValue(
              2,
              fieldInfo,
              new ObjectAndPersistInfo(storeRoot
                  .getDataModelIdentifier(), false,
                  classInfoFactory
                      .getNoProxyClassInfo(int.class)));

          fieldInfo = currentObjectClassInfo.getFieldInfo(
              StoreRoot4.class.getName(),
              "dataRecordIdOfpersistedStaticSet");
          // fieldInfo = new FieldInfo(currentObjectClassInfo,
          // "dataRecordIdOfpersistedStaticSet",
          // classInfoFactory.getClassInfo(Set.class),
          // false, false);

          Set<Long> dataRecordIdOfpersistedStaticSet = storeRoot
              .getDataRecordIdOfpersistedStaticSet();
          if (dataRecordIdOfpersistedStaticSet == null) {
            // use PTreeSet for persistence
            dataRecordIdOfpersistedStaticSet = new PTreeSet<Long>();
            storeRoot
                .setDataRecordIdOfpersistedStaticSet(dataRecordIdOfpersistedStaticSet);
          }
          currentObject
              .setValue(
                  3,
                  fieldInfo,
                  new ObjectAndPersistInfo(
                      dataRecordIdOfpersistedStaticSet,
                      false,
                      classInfoFactory
                          .getNoProxyClassInfo(PTreeSet.class)));
View Full Code Here

TOP

Related Classes of net.sf.joafip.store.entity.objectio.ObjectAndPersistInfo

Copyright © 2018 www.massapicom. 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.