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

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


          .getClassNameListRootDataRecordIdentifier();
    } catch (StoreException exception) {
      throw new ObjectIOException(exception);
    }
    if (dataRecordIdentifier != null) {
      rootClassNameRecord = new ClassNameRecord(heapRecordableManager,
          helperBinaryConversion);
      rootClassNameRecord.setDataRecordIdentifier(
      /**/dataRecordIdentifier,
      /**/true/* exist in file */);
      if (!heapRecordableManager.readAndSetState(rootClassNameRecord)) {
        throw new ObjectIOException("failed read and set state: "
            + heapRecordableManager.getReadAndSetStateStatus());
      }
      ClassNameRecord classNameRecord = rootClassNameRecord;

      while (dataRecordIdentifier != null) {
        final Integer identifier = classNameRecord
            .getClassNameIdentifier();
        final String className = arrayByteToString(classNameRecord);
        if (LOGGER.debugEnabled) {
          LOGGER.debug("read: class name id=" + identifier
              + " class name=" + className + " data record id="
              + dataRecordIdentifier);
        }

        byClassNameIdentifier.put(className, identifier);
        byIdentifierClassName.put(identifier, className);

        dataRecordIdentifier = classNameRecord
            .getNextClassNameRecordDataRecordIdentifier();
        if (dataRecordIdentifier != null) {
          if (LOGGER.debugEnabled) {// NOPMD
            LOGGER.debug("next data record id="
                + dataRecordIdentifier);
          }
          classNameRecord = newClassNameRecord();
          classNameRecord.setDataRecordIdentifier(
          /**/dataRecordIdentifier,
          /**/true/* exist in file */);
          readAndSetState(classNameRecord);
        }
      }
 
View Full Code Here


          + heapRecordableManager.getReadAndSetStateStatus());
    }
  }

  private ClassNameRecord newClassNameRecord() {
    ClassNameRecord classNameRecord;
    classNameRecord = new ClassNameRecord(heapRecordableManager,
        helperBinaryConversion);
    return classNameRecord;
  }
View Full Code Here

      } else {
        /* compute new identifier for class to append */
        identifier = rootClassNameRecord.getClassNameIdentifier() + 1;
      }
      /* create the record for new entry */
      final ClassNameRecord classNameRecord = new ClassNameRecord(
          heapRecordableManager, helperBinaryConversion);
      heapRecordableManager.attach(classNameRecord);
      final byte[] className = classInfo.getName().getBytes();
      /* set the entry state */
      classNameRecord.setClassName(className);
      classNameRecord.setClassNameIdentifier(identifier);
      /* new entry become the root of the list */
      if (rootClassNameRecord == null) {
        classNameRecord
            .setNextClassNameRecordDataRecordIdentifier(null);
      } else {
        classNameRecord
            .setNextClassNameRecordDataRecordIdentifier(rootIdentifier);
      }
      classNameRecord.setStateHaveChanged();
      rootClassNameRecord = classNameRecord;
      /* data record identifier set at write state */
      storeHeader
          .setClassNameListRootDataRecordIdentifier(rootClassNameRecord
              .getDataRecordIdentifier());
 
View Full Code Here

      throw new ObjectIOException(exception);
    }
    try {
      while (dataRecordIdentifier != null) {
        setToUpdate.add(dataRecordIdentifier);
        final ClassNameRecord classNameRecord = newClassNameRecord();
        classNameRecord.setDataRecordIdentifier(
        /**/dataRecordIdentifier,
        /**/true/* exist in file */);
        readAndSetState(classNameRecord);
        dataRecordIdentifier = classNameRecord
            .getNextClassNameRecordDataRecordIdentifier();
      }
    } catch (HeapRecordableException exception) {
      throw new ObjectIOException(exception);
    }
View Full Code Here

TOP

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

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.