Package net.sf.joafip.store.service.objectio

Examples of net.sf.joafip.store.service.objectio.ObjectIOException


      final IClassNameManager classNameManager,
      final HelperBinaryConversion helperBinaryConversion)
      throws ObjectIOException {
    super();
    if (currentDataModelIdentifier == 0) {
      throw new ObjectIOException(
          "data model identifier 0 is reserved, must start to 1");
    }
    this.currentDataModelIdentifier = currentDataModelIdentifier;
    this.classNameManager = classNameManager;
    this.helperBinaryConversion = helperBinaryConversion;
View Full Code Here


        .getIdentifier(classInfo) | 0x80000000;
    try {
      offset = helperBinaryConversion.integerConverter.toBinary(binary,
          offset, true, Integer.valueOf(classNameIdentifier));
    } catch (BinaryConverterException exception) {
      throw new ObjectIOException(exception);
    }

    /*
     * record format identifier
     */
    try {
      offset = helperBinaryConversion.shortConverter
          .toBinary(
              binary,
              offset,
              true,
              Short.valueOf(RecordFormatIdentifier.RECORD_FORMAT_ID_FOR_CURRENT_RELEASE));
    } catch (BinaryConverterException exception) {
      throw new ObjectIOException(exception);
    }

    /*
     * joafip release id
     */
    try {
      offset = helperBinaryConversion.integerConverter.toBinary(binary,
          offset, true, Integer.valueOf(Version.JOAFIP_RELEASE_ID));
    } catch (BinaryConverterException exception) {
      throw new ObjectIOException(exception);
    }

    /*
     * data model identifier
     */
    try {
      offset = helperBinaryConversion.integerConverter.toBinary(binary,
          offset, true, Integer.valueOf(currentDataModelIdentifier));
    } catch (BinaryConverterException exception) {
      throw new ObjectIOException(exception);
    }

    /*
     * flags
     */
    final byte flags = 0;
    // if (staticPersistence) {
    // flags |= 0x1;
    // }
    try {
      offset = helperBinaryConversion.byteConverter.toBinary(binary,
          offset, true, Byte.valueOf(flags));
    } catch (BinaryConverterException exception) {
      throw new ObjectIOException(exception);
    }

    return offset;
  }
View Full Code Here

    final ClassInfo classInfo = objectAndItsClassInfo.objectClassInfo;
    final FieldInfo[] fields;
    try {
      fields = classInfo.getSerialPersistentFieldsInfo();
    } catch (ClassInfoException exception) {
      throw new ObjectIOException(exception);
    }
    prepareWriteGenericForFields(objectAndItsClassInfo, classInfo, fields);
  }
View Full Code Here

        try {
          fieldValue = getFieldValue(
              objectAndPersistInfo.getObject(), fieldInfo,
              checkAssertNotNull);
        } catch (NullFieldException exception) {
          throw new ObjectIOException(exception);
        }
        ClassInfo fieldType;
        try {
          fieldType = fieldInfo.getFieldTypeInfo();
        } catch (ClassInfoException exception) {
          throw new ObjectIOException(exception);
        }
        final ClassInfo fieldValuetype = getFieldValueType(fieldValue);
        final boolean persisted = true ^ fieldType
            .isBasicOrPrimitiveType();
        final ObjectAndPersistInfo fieldAndPersistInfo = objectIOManager
View Full Code Here

        try {
          fieldValue = getFieldValue(
              objectAndPersistInfo.getObject(), fieldInfo,
              checkAssertNotNull);
        } catch (NullFieldException exception) {
          throw new ObjectIOException(exception);
        }
        ClassInfo fieldType;
        try {
          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());
View Full Code Here

      } catch (ReflectException exception) {
        final Throwable cause = exception.getCause();
        if (InvocationTargetException.class.equals(cause)) {
          throwsInvokationTargetException(exception, cause);
        } else {
          throw new ObjectIOException(exception);
        }
      }
    }
    final byte[] serializedForm = objectIOOutputStream.toByteArray();
    objectAndPersistInfo.serializedForm = serializedForm;
View Full Code Here

      ObjectIODataCorruptedException, ObjectIONotSerializableException {
    objectIOOutputStream.initialize(objectAndPersistInfo);
    final ClassInfo classInfo = objectAndPersistInfo.objectClassInfo;
    final Method method = classInfo.getWriteExternalMethod();
    if (method == null) {
      throw new ObjectIOException(
          "missing writeExternal method for serialization");
    }
    try {
      helperReflect.invokeMethod(objectAndPersistInfo.getObject(),
          method, serializeOutputMethodArgs);
    } catch (ReflectException exception) {
      final Throwable cause = exception.getCause();
      if (InvocationTargetException.class.equals(cause)) {
        throwsInvokationTargetException(exception, cause);
      } else {
        throw new ObjectIOException(exception);
      }
    }
    final byte[] serializedForm = objectIOOutputStream.toByteArray();
    objectAndPersistInfo.serializedForm = serializedForm;
    final ObjectClassInfoAndDeclared[] wroteObject =
View Full Code Here

      throws ObjectIOException, ObjectIODataRecordNotFoundException,
      ObjectIOClassNotFoundException, ObjectIOInvalidClassException,
      ObjectIODataCorruptedException, ObjectIONotSerializableException {
    final byte[] serializedForm = objectAndpersistInfo.serializedForm;
    if (serializedForm == null) {
      throw new ObjectIOException("serialized form must be computed");
    }
    // +INT_BYTE_SIZE for signature
    return serializedForm.length + HelperBinaryConversion.INT_BYTE_SIZE;
  }
View Full Code Here

      final byte[] binary, final int fieldBeginOffset,
      final ObjectAndPersistInfo objectAndPersistInfo)
      throws ObjectIOException {
    final byte[] serializedForm = objectAndPersistInfo.serializedForm;
    if (serializedForm == null) {
      throw new ObjectIOException("serialized form must be setted");
    }
    try {
      System.arraycopy(serializedForm, 0, binary, fieldBeginOffset,
          serializedForm.length);
    } catch (Exception exception) {
      throw new ObjectIOException("object "
          + objectAndPersistInfo.objectClassInfo, exception);
    }
    final ObjectClassInfoAndDeclared[] sonWroteObject = objectAndPersistInfo.sonWroteObjectArray;
    objectAndPersistInfo.originalValue = sonWroteObject;
    return sonWroteObject;
View Full Code Here

      ObjectIODataCorruptedException, ObjectIONotSerializableException {
    final Throwable causeOfCause = cause.getCause();
    if (IOException.class.equals(causeOfCause)) {
      throwIOExceptionCause(causeOfCause);
    } else {
      throw new ObjectIOException(exception);
    }
  }
View Full Code Here

TOP

Related Classes of net.sf.joafip.store.service.objectio.ObjectIOException

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.