Examples of IObjectInput


Examples of net.sf.joafip.store.service.objectio.serialize.input.IObjectInput

    // 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();
View Full Code Here

Examples of net.sf.joafip.store.service.objectio.serialize.input.IObjectInput

        .writeBody(binary, offset/*
                     * bodyBeginOffset for class id
                     */, objectAndItsClassInfo, false/* updateOriginalValue */);
    // dummy data record identifier for object
    final DataRecordIdentifier dataRecordIdentifier = DataRecordIdentifier.LAST;
    final IObjectInput objectInput = new ObjectInputForBasic(this,
        classInfoFactory, proxyManager2, helperBinaryConversion);
    final Integer created = (Integer) objectInput.createObject(
        dataRecordIdentifier, binary, classInfo, storageInfo)
        .getObject();
    assertEquals("read and wrote must have the same value", integer,
        created);
  }
View Full Code Here

Examples of net.sf.joafip.store.service.objectio.serialize.input.IObjectInput

  @Override
  public void unsetProxyObjectState(
      final ObjectAndPersistInfo objectAndPersistInfo)
      throws ObjectIOException, ObjectIOInvalidClassException {
    assertNotSubstituted(objectAndPersistInfo);
    final IObjectInput objectIO = getObjectInput(
        objectAndPersistInfo.objectClassInfo, false/* notLazy */);
    objectIO.unsetObjectState(objectAndPersistInfo);
    objectAndPersistInfo.unsetObjectState();
  }
 
View Full Code Here

Examples of net.sf.joafip.store.service.objectio.serialize.input.IObjectInput

    objectInputImmediateGeneric = new ObjectInputImmediateGeneric(this,
        classInfoFactory, proxyManager2, helperBinaryConversion);
    objectInputs[EnumObjectInput.OBJECT_INPUT_IMMEDIATE_GENERIC.ordinal()] =
    /**/objectInputImmediateGeneric;

    final IObjectInput objectInputImmediateSerializable;
    objectInputImmediateSerializable = new ObjectInputImmediateSerializable(
        this, classInfoFactory, proxyManager2, helperBinaryConversion);
    objectInputs[EnumObjectInput.OBJECT_INPUT_IMMEDIATE_SERIALIZABLE
        .ordinal()] =
    /**/objectInputImmediateSerializable;

    final IObjectInput objectInputImmediateExternalizable;
    objectInputImmediateExternalizable = new ObjectInputImmediateExternalizable(
        this, classInfoFactory, proxyManager2, helperBinaryConversion);
    objectInputs[EnumObjectInput.OBJECT_INPUT_IMMEDIATE_EXTERNALIZABLE
        .ordinal()] =
    /**/objectInputImmediateExternalizable;

    final IObjectInput objectInputLazyGeneric;
    objectInputLazyGeneric = new ObjectInputLazyGeneric(this,
        classInfoFactory, helperBinaryConversion, proxyManager2);
    objectInputs[EnumObjectInput.OBJECT_INPUT_LAZY_GENERIC.ordinal()] =
    /**/objectInputLazyGeneric;

    final IObjectInput objectInputLazySerializable;
    objectInputLazySerializable = new ObjectInputLazySerializable(this,
        classInfoFactory, helperBinaryConversion, proxyManager2);
    objectInputs[EnumObjectInput.OBJECT_INPUT_LAZY_SERIALIZABLE.ordinal()] =
    /**/objectInputLazySerializable;

    final IObjectInput objectInputLazyExternalizable;
    objectInputLazyExternalizable = new ObjectInputLazyExternalizable(this,
        classInfoFactory, helperBinaryConversion, proxyManager2);
    objectInputs[EnumObjectInput.OBJECT_INPUT_LAZY_EXTERNALIZABLE.ordinal()] =
    /**/objectInputLazyExternalizable;

    final IObjectInput objectInputBasic;
    objectInputBasic = new ObjectInputForBasic(this, classInfoFactory,
        proxyManager2, helperBinaryConversion);
    objectInputs[EnumObjectInput.OBJECT_INPUT_BASIC.ordinal()] =
    /**/objectInputBasic;

    final IObjectOutput objectOutputBasic;
    objectOutputBasic = new ObjectOutputForBasic(this, classInfoFactory,
        proxyManager2, helperBinaryConversion);
    objectOutputs[EnumObjectOutput.OBJECT_OUTPUT_BASIC.ordinal()] =
    /**/objectOutputBasic;

    objectInputEnum = new ObjectInputForEnum(this, classInfoFactory,
        proxyManager2, helperBinaryConversion);
    objectInputs[EnumObjectInput.OBJECT_INPUT_ENUM.ordinal()] =
    /**/objectInputEnum;

    final IObjectOutput objectOutputEnum;
    objectOutputEnum = new ObjectOutputForEnum(this, classInfoFactory,
        proxyManager2, helperBinaryConversion);
    objectOutputs[EnumObjectOutput.OBJECT_OUTPUT_ENUM.ordinal()] =
    /**/objectOutputEnum;

    final IObjectInput objectInputSerialize;
    objectInputSerialize = new ObjectInputSerialize(this, classInfoFactory,
        proxyManager2, helperBinaryConversion);
    objectInputs[EnumObjectInput.OBJECT_INPUT_SERIALIZE.ordinal()] =
    /**/objectInputSerialize;

    final IObjectOutput objectOutputSerialize;
    objectOutputSerialize = new ObjectOutputSerialize(this,
        classInfoFactory, proxyManager2, helperBinaryConversion);
    objectOutputs[EnumObjectOutput.OBJECT_OUTPUT_SERIALIZE.ordinal()] =
    /**/objectOutputSerialize;

    final IObjectInput objectInputSerializeZipped;
    objectInputSerializeZipped = new ObjectInputSerializeZipped(this,
        classInfoFactory, proxyManager2, helperBinaryConversion);
    objectInputs[EnumObjectInput.OBJECT_INPUT_SERIALIZE_ZIPPED.ordinal()] =
    /**/objectInputSerializeZipped;

    final IObjectOutput objectOutputSerializeZipped;
    objectOutputSerializeZipped = new ObjectOutputSerializeZipped(this,
        classInfoFactory, proxyManager2, helperBinaryConversion);
    objectOutputs[EnumObjectOutput.OBJECT_OUTPUT_SERIALIZE_ZIPPED.ordinal()] =
    /**/objectOutputSerializeZipped;

    final IObjectInput objectInputSerializeGZipped;
    objectInputSerializeGZipped = new ObjectInputSerializeGZipped(this,
        classInfoFactory, proxyManager2, helperBinaryConversion);
    objectInputs[EnumObjectInput.OBJECT_INPUT_SERIALIZE_GZIPPED.ordinal()] =
    /**/objectInputSerializeGZipped;

 
View Full Code Here

Examples of net.sf.joafip.store.service.objectio.serialize.input.IObjectInput

   * @return the object input manager according to object class
   * @throws ObjectIOException
   */
  protected IObjectInput getObjectInput(final ClassInfo classInfo,
      final boolean notLazy) throws ObjectIOException {
    IObjectInput objectInput;
    if (classInfo.isUseSpecificObjectIO()) {
      objectInput = specificObjectInputMap.get(classInfo);
    } else {
      final boolean immediate = !proxyMode || notLazy
          || classInfo.isStoreNotLazy();
      final EnumObjectInput enumObjectInput;
      try {
        if (immediate) {
          enumObjectInput = classInfo.getObjectInput();
        } else {
          enumObjectInput = classInfo.getLazyObjectInput();
        }
      } catch (final ClassInfoException exception) {
        throw new ObjectIOException(exception);
      }
      // ASSERTX
      assert !EnumObjectInput.OBJECT_INPUT_SPECIFIC
          .equals(enumObjectInput) : "no default object io for specific io";
      objectInput = objectInputs[enumObjectInput.ordinal()];
      // ASSERTX
      assert enumObjectInput.isLazy() == objectInput.isLazy() : "lazy mode mismatch";
    }
    return objectInput;
  }
View Full Code Here

Examples of net.sf.joafip.store.service.objectio.serialize.input.IObjectInput

    assert assertHasDataRecordIdentfier(objectAndPersistInfo,
        dataRecordIdentifier);
    final byte[] binary = getDataOfDataRecord(dataRecordIdentifier);

    /* set the object state */
    final IObjectInput objectInput = getObjectInput(classInfo, true/* notLazy */);
    // ASSERTX
    assert assertTransformed(objectInput, objectAndPersistInfo);
    objectInput.setObjectState(objectAndPersistInfo, binary,
        objectAndPersistInfo.getHeaderDataSize());
    setInstanceFactoryFieldsOfObject(objectAndPersistInfo);
    setRunAutosaveEnable(runAutosaveEnable);
  }
View Full Code Here

Examples of net.sf.joafip.store.service.objectio.serialize.input.IObjectInput

      final ClassInfo classInfo, final StorageInfo storageInfo,
      final boolean notLazy, final byte[] binary)
      throws ObjectIOException, ObjectIODataRecordNotFoundException,
      ObjectIOClassNotFoundException, ObjectIOInvalidClassException,
      ObjectIODataCorruptedException, ObjectIONotSerializableException {
    final IObjectInput objectInput = getObjectInput(classInfo, notLazy);
    final ObjectAndPersistInfo objectAndPersistInfo;
    try {
      objectAndPersistInfo = objectInput.createObject(
          dataRecordIdentifier, binary, classInfo, storageInfo);
    } catch (final RuntimeException exception) {
      logger.fatal("error creating object of class "
          + classInfo.toString() + "\ndata record identifier "
          + dataRecordIdentifier + "\nusing object input "
          + objectInput.getClass().getName());
      throw exception;
    } catch (final ObjectIOException exception) {
      final String message = "error creating object of class "
          + classInfo.toString() + "\ndata record identifier "
          + dataRecordIdentifier;
View Full Code Here

Examples of net.sf.joafip.store.service.objectio.serialize.input.IObjectInput

    }
    final byte[] binary = getDataOfDataRecord(dataRecordIdentifier);
    /* object class is the first data in binary for object storing */
    headerReader.read(binary, dataRecordIdentifier);
    final ClassInfo classInfo = headerReader.objectClassInfo;
    final IObjectInput objectInput;
    try {
      objectInput = getObjectInput(classInfo, false);
      final DataRecordIdentifier[] referencedList = objectInput
          .getReferencedList(binary, headerReader.headerDataSize);
      Class<?> objectClass;
      objectClass = classInfo.getObjectClass();
      return new ObjectLinkTreeNode(dataRecordIdentifier, objectClass,
          referencedList);
View Full Code Here

Examples of net.sf.joafip.store.service.objectio.serialize.input.IObjectInput

      throws StoreException {
    synchronized (mutex) {
      try {
        final ClassInfo classInfo = classInfoFactory
            .getNoProxyClassInfo(objectClass);
        final IObjectInput objectInput = createObjectInput(objectInputClass);
        final IObjectOutput objectOutput = createObjectOutput(objectOutputClass);
        objectIOManager.setSpecificObjectIO(classInfo, objectInput,
            objectOutput);
      } catch (final Exception exception) {
        throw new StoreException(exception);
View Full Code Here

Examples of net.sf.joafip.store.service.objectio.serialize.input.IObjectInput

  public void setObjectIOForClass(final String objectClassName,
      final Class<? extends IObjectInput> objectInputClass,
      final Class<? extends IObjectOutput> objectOutputClass)
      throws StoreException {
    synchronized (mutex) {
      final IObjectInput objectInput;
      final IObjectOutput objectOutput;
      try {
        objectInput = createObjectInput(objectInputClass);
        objectOutput = createObjectOutput(objectOutputClass);
      } catch (final Exception exception) {
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.