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

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


  public void setObjectState(final Object object, final ClassInfo classInfo,
      final ValuedFieldList valuedFieldList) throws ImportException {
    for (final ValuedField valuedField : valuedFieldList.getValuedFields()) {
      final FieldInfo fieldInfo = valuedField.getFieldInfo();
      final ObjectAndPersistInfo fieldValue = valuedField.getValue();
      try {
        helperReflect.setFieldValue(object, fieldInfo,
            fieldValue.getObject());
      } catch (final ReflectException exception) {
        throw recordObjectImportException(classInfo, fieldInfo,
            fieldValue, valuedFieldList, exception);
      } catch (final ReflectFailedSetException exception) {
        throw recordObjectImportException(classInfo, fieldInfo,
View Full Code Here


          throw new ObjectIOException(exception);
        }
        final ClassInfo fieldValuetype = getFieldValueType(fieldValue);
        final boolean persisted = true ^ fieldType
            .isBasicOrPrimitiveType();
        final ObjectAndPersistInfo fieldAndPersistInfo = objectIOManager
            .getOrCreateObjectPersistInfoOfObject(fieldValue, null,
                fieldValuetype, persisted);

        currentValue[index++] = new ObjectClassInfoAndDeclared(// NOPMD
            fieldAndPersistInfo, fieldType);
View Full Code Here

          fieldType = fieldInfo.getFieldTypeInfo();
        } catch (ClassInfoException exception) {
          throw new ObjectIOException(exception);
        }
        final ClassInfo fieldValuetype = getFieldValueType(fieldValue);
        final ObjectAndPersistInfo fieldAndPersistInfo = objectIOManager
            .getOrCreateObjectPersistInfoOfObject(fieldValue, null,
                fieldValuetype, true ^ fieldType.isBasicType());
        currentValue[index++] = new ObjectClassInfoAndDeclared(// NOPMD
            fieldAndPersistInfo, fieldType);
        size += byteSizeForFieldOrElement(fieldType);
View Full Code Here

  @Override
  public ObjectClassInfoAndDeclared[] willNotBeWrote(
      final ObjectAndPersistInfo objectAndPersistInfo)
      throws ObjectIOException {
    // will write original object else will write the substitute
    ObjectAndPersistInfo toWriteObjectAndItsClassInfo =
    /**/objectAndPersistInfo.getSubstituteObjectAndPersistInfo();
    if (toWriteObjectAndItsClassInfo == null) {
      toWriteObjectAndItsClassInfo = objectAndPersistInfo;
    }
    final ClassInfo classInfo = toWriteObjectAndItsClassInfo.objectClassInfo;
    final IObjectOutput objectOutput;
    objectOutput = getObjectOutput(classInfo);
    assert !toWriteObjectAndItsClassInfo.isSubstituted();
    return objectOutput.willNotBeWrote(toWriteObjectAndItsClassInfo);
  }
View Full Code Here

      final ObjectAndPersistInfo objectAndPersistInfo)
      throws ObjectIOException, ObjectIOInvalidClassException,
      ObjectIONotSerializableException, ObjectIODataCorruptedException,
      ObjectIODataRecordNotFoundException, ObjectIOClassNotFoundException {
    // will write original object else will write the substitute
    ObjectAndPersistInfo toWriteObjectAndItsClassInfo =
    /**/objectAndPersistInfo.getSubstituteObjectAndPersistInfo();
    if (toWriteObjectAndItsClassInfo == null) {
      toWriteObjectAndItsClassInfo = objectAndPersistInfo;
    }
    final boolean valueChanged;
    final ClassInfo classInfo = toWriteObjectAndItsClassInfo.objectClassInfo;
    final IObjectOutput objectOutput;
    objectOutput = getObjectOutput(classInfo);
    assert !toWriteObjectAndItsClassInfo.isSubstituted();
    if (toWriteObjectAndItsClassInfo.newObject) {
      if (garbageManagement) {
        objectOutput
            .setReferenceChangeListForNewObject(toWriteObjectAndItsClassInfo);
      }
View Full Code Here

      ObjectIONotSerializableException, ObjectIOClassNotFoundException,
      ObjectIODataRecordNotFoundException,
      ObjectIODataCorruptedException,
      ObjectIOTooBigForSerializationException {
    final ClassInfo classInfo = objectAndPersistInfo.objectClassInfo;
    ObjectAndPersistInfo toWrite;
    toWrite = keptInMemorysubstituteObject(objectAndPersistInfo);
    if (toWrite == null) {
      toWrite = substituteObject(objectAndPersistInfo);
      if (toWrite == null) {
        toWrite = objectAndPersistInfo;
      }
    }
    if (!objectAndPersistInfo.isLoadedOrNotAProxy()) {
      throw new ObjectIOException("can not store not loaded object");
    }
    final DataRecordIdentifier dataRecordIdentifier = toWrite.dataRecordIdentifier;
    // /**/getKnownDataRecordIdentifierAssociatedToObject(toWrite);
    if (logger.debugEnabled) {
      logger.debug("begin store: data record " + dataRecordIdentifier);
    }

    /* the object class can be different than object.getClass() */
    final IObjectOutput objectOutput;
    objectOutput = getObjectOutput(classInfo);
    assert !toWrite.isSubstituted();
    objectOutput.prepareWrite(toWrite);

    final int byteSizeForObject = objectOutput.byteSize(toWrite,
        HEADER_DATA_SIZE);
    /*
 
View Full Code Here

    }
    try {
      // data is field value object
      final ObjectModelForImport fieldObjectModel = (ObjectModelForImport) data;

      final ObjectAndPersistInfo fieldObjectAndPersistInfo =
      /**/createObjectAndPersistInfo(fieldObjectModel);

      final FieldInfo fieldInfo = createFieldInfo(
          fieldDeclaringClassDef.getClassInfo(),
          fieldTypeDef.getClassInfo(), currentFieldName,
View Full Code Here

      try {
        declaredClassInfo = fieldInfo.getFieldTypeInfo();
      } catch (ClassInfoException exception) {
        throw new RuntimeException(exception);// NOPMD
      }
      final ObjectAndPersistInfo valueAndPersistInfo;
      if (fieldInfo.isPersisted()) {
        final boolean valueDefined = valueMap.containsKey(fieldName);
        if (valueDefined) {
          final Object fieldValue = valueMap.get(fieldName);
          final ClassInfo valueClassInfo = valueClassMap
View Full Code Here

  protected void writeObjectOverride(final Object object) throws IOException {
    ClassInfo classInfo;
    try {
      classInfo = proxyManager2.classInfoOfObject(object);

      final ObjectAndPersistInfo toWriteObjectAndItsClassInfo =
      /**/objectIOManager.getOrCreateObjectPersistInfoOfObject(object,
          Boolean.FALSE, classInfo, true);
      if (LOGGER.debugEnabled) {
        LOGGER.debug("write object "
            + toWriteObjectAndItsClassInfo.objectClassInfo + AT
View Full Code Here

    return objectStateMap.getObjectAndPersistInfoByIdentifier(identifier);
  }

  public ObjectAndPersistInfo getObjectAndPersistInfoOfObject(
      final Object object) throws ObjectIOException {
    final ObjectAndPersistInfo objectAndPersistInfoOfObject = objectStateMap
        .getObjectAndPersistInfoOfObject(object);
    return objectAndPersistInfoOfObject;
  }
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.