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

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


    } else {
      try {
        defaultValue = new ObjectAndPersistInfo(object, false,
            classInfo);
      } catch (ClassInfoException exception) {
        throw new ObjectIOException(exception);
      }
    }
    return defaultValue;
  }
View Full Code Here


        final Throwable cause = exception.getCause();
        if (InvocationTargetException.class.equals(cause.getClass())) {
          throwsInvokationTargetException(cause);
          method = classInfo.getReadObjectNoDataMethod();
          if (method == null) {
            throw new ObjectIOException(exception);
          } else {
            try {
              helperReflect.invokeMethod(objectAndPersistInfo,
                  method, NO_ARGS);
            } catch (ReflectException exception2) {
              throw new ObjectIOException(exception.toString(),// NOPMD
                  exception2);
            }
          }
        } else {
          throw new ObjectIOException(exception);
        }
      }
      objectAndPersistInfo.setLoading(false);
    }
    if (setOriginalValue) {
View Full Code Here

      ObjectIOClassNotFoundException, ObjectIOInvalidClassException,
      ObjectIODataCorruptedException, ObjectIONotSerializableException {
    final ClassInfo classInfo = objectAndPersistInfo.objectClassInfo;
    final Method method = classInfo.getReadExternalMethod();
    if (method == null) {
      throw new ObjectIOException(
          "missing readExternal method for serialization");
    }
    objectAndPersistInfo.clearSonReadObject();
    final Object object = objectAndPersistInfo.getObject();
    objectAndPersistInfo.setLoading(true);
    try {
      helperReflect.invokeMethod(object, method,
          new Object[] { objectIOInputStream });
    } catch (ReflectException exception) {
      final Throwable cause = exception.getCause();
      if (InvocationTargetException.class.equals(cause)) {
        throwsInvokationTargetException(exception, cause);
      } else {
        throw new ObjectIOException(exception);
      }
    }
    objectAndPersistInfo.setLoading(false);
    if (setOriginalValue) {
      sonReadToOriginal(objectAndPersistInfo);
View Full Code Here

    final int offset;
    ClassInfo fieldType;
    try {
      fieldType = fieldInfo.getFieldTypeInfo();
    } catch (ClassInfoException exception) {
      throw new ObjectIOException(exception);
    }
    try {
      offset = readAndSetField(objectAndPersistInfo, binary, beginOffset,
          originalValue, index, fieldInfo, fieldType);
    } catch (ObjectIOException exception) {
View Full Code Here

          /* a primitive field */
          AbstractConverter binaryConverter;
          binaryConverter = (AbstractConverter) helperBinaryConversion
              .fromBinary(binary, offset, fieldType);
          if (!binaryConverter.valueDefinedFromBinary) {
            throw new ObjectIOException(
                "field value must be defined");
          }
          final Object fieldValue = binaryConverter.objectFromBinary;
          binaryConverter.objectFromBinary = null;// NOPMD
          /* primitive not persisted */
          fieldValueAndPersistInfo = objectIOManager
              .getOrCreateObjectPersistInfoOfObject(fieldValue,
                  false, fieldType, Boolean.FALSE);
          // offset += helperBinaryConversion.byteSize(type);
          offset += fieldType.getBinarySize();
        } else if (helperBinaryConversion.getType(binary, offset) ==
        /*       */HelperBinaryConversion.REFERENCE_TYPE) {
          /* a reference field */
          fieldValueAndPersistInfo = referenceInput.fromBinary(
              binary, offset);
          offset += HelperBinaryConversion.REFERENCE_NULLABLE_BYTE_SIZE;
          if (!fieldValueAndPersistInfo.valueDefined) {
            throw new ObjectIOException(
                "field value must be defined");
          }
        } else {
          /* a basic field */
          AbstractConverter binaryConverter;
          try {
            binaryConverter = (AbstractConverter) helperBinaryConversion
                .fromBinary(binary, offset);
          } catch (BinaryConverterException exception) {
            throw new ObjectIOException(exception);
          }
          // offset = binaryConverter.getOffsetFromBinary();
          offset = binaryConverter.offsetFromBinary;
          final Object fieldValue;
          final ClassInfo fieldValueClassInfo;
          if (binaryConverter.valueDefinedFromBinary) {
            fieldValue = binaryConverter.objectFromBinary;
            binaryConverter.objectFromBinary = null;// NOPMD
            if (fieldValue == null) {
              fieldValueClassInfo = ClassInfo.NULL;
            } else {
              fieldValueClassInfo = classInfoFactory
                  .getNoProxyClassInfo(fieldValue.getClass());
            }
          } else {
            fieldValue = null;
            fieldValueClassInfo = ClassInfo.NULL;
          }
          fieldValueAndPersistInfo = objectIOManager
              .getOrCreateObjectPersistInfoOfObject(fieldValue,
                  false, fieldValueClassInfo, false);
        }
      } else {
        fieldValueAndPersistInfo = ObjectAndPersistInfo.NULL;
      }
    } catch (BinaryConverterException exception) {
      String declaringClassName;
      declaringClassName = fieldInfo.getDeclaringClassName();
      throw new ObjectIOException("for field \""
          + fieldInfo.getFieldName() + "\", field declaring class \""
          + declaringClassName + "\", object class \""
          + objectAndPersistInfo.objectClassInfo + "\"", exception);
    } catch (ObjectIODataRecordNotFoundException exception) {
      String declaringClassName;
      declaringClassName = fieldInfo.getDeclaringClassName();
      throw new ObjectIODataRecordNotFoundException("for field \""
          + fieldInfo.getFieldName() + "\", field declaring class \""
          + declaringClassName + "\", object class \""
          + objectAndPersistInfo.objectClassInfo + "\"", exception);
    } catch (ClassInfoException exception) {
      throw new ObjectIOException(exception);
    }

    setObjectFieldValue(objectAndPersistInfo, originalValue, index,
        fieldInfo, fieldType, fieldValueAndPersistInfo);
    return offset;
View Full Code Here

      final Object fieldValue = fieldValueAndPersistInfo.getObject();
      helperReflect.setFieldValue(object, fieldInfo, fieldValue);
    } catch (ReflectException exception) {
      logFatalForSetObjectFieldValue(objectAndPersistInfo,
          fieldValueAndPersistInfo, exception);
      throw new ObjectIOException(exception);
    } catch (ReflectFailedSetException exception) {
      logFatalForSetObjectFieldValue(objectAndPersistInfo,
          fieldValueAndPersistInfo, exception);
      throw new ObjectIOInvalidClassException(exception);
    } catch (AssertionError error) {
View Full Code Here

    FieldInfo[] fieldsInfo;
    try {
      fieldsInfo = classInfo
          .allDeclaredFieldsWithTransientWithoutStatic();
    } catch (ClassInfoException exception) {
      throw new ObjectIOException(exception);
    }
    for (FieldInfo fieldInfo : fieldsInfo) {
      ClassInfo type;
      try {
        type = fieldInfo.getFieldTypeInfo();
      } catch (ClassInfoException exception) {
        throw new ObjectIOException(exception);
      }
      if (!type.isPrimitiveType()) {
        setObjectFieldValueToNull(objectAndItsClassInfo, fieldInfo);
      }
    }
View Full Code Here

      helperReflect.setFieldValueToNull(
          objectAndItsClassInfo.getObject(), fieldInfo);
    } catch (ReflectException exception) {
      logFatalForSetObjectFieldValue(objectAndItsClassInfo, null,
          exception);
      throw new ObjectIOException(exception);
    } catch (ReflectFailedSetException exception) {
      logFatalForSetObjectFieldValue(objectAndItsClassInfo, null,
          exception);
      throw new ObjectIOInvalidClassException(exception);
    }
View Full Code Here

    final ClassInfo classInfo = objectAndPersistInfo.objectClassInfo;
    final FieldInfo[] fieldsInfo;
    try {
      fieldsInfo = classInfo.getAllDeclaredFieldsForGenericIO();
    } catch (ClassInfoException exception) {
      throw new ObjectIOException(exception);
    }
    final ObjectClassInfoAndDeclared[] values = new ObjectClassInfoAndDeclared[fieldsInfo.length];
    int index = 0;
    for (FieldInfo fieldInfo : fieldsInfo) {
      offset = readField(objectAndPersistInfo, binary, offset, values,
View Full Code Here

    final int offset;
    final ClassInfo fieldType;
    try {
      fieldType = fieldInfo.getFieldTypeInfo();
    } catch (ClassInfoException exception) {
      throw new ObjectIOException(exception);
    }
    try {
      offset = readField(objectAndPersistInfo, binary, beginOffset,
          values, index, fieldInfo, fieldType);
    } catch (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.