Examples of ObjectAndPersistInfo


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

      final int bodyBeginOffset, final ClassInfo objectClass,
      final DataRecordIdentifier dataRecordIdentifier)
      throws ObjectIOException, ObjectIODataRecordNotFoundException,
      ObjectIODataCorruptedException {
    ObjectInputStream ois = null;
    final ObjectAndPersistInfo objectAndItsClassInfo;
    try {
      final int length = binary.length - bodyBeginOffset;
      final byte[] objectBytes = new byte[length];
      System.arraycopy(binary, bodyBeginOffset, objectBytes, 0, length);
      ois = new ObjectInputStream(new ByteArrayInputStream(objectBytes));
View Full Code Here

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

        .getDataRecordIdentifierSet();
    for (DataRecordIdentifier dataRecordIdentifier : dataRecordIdentifiers) {

      if (dataManager.hasDataRecord(dataRecordIdentifier)) {

        final ObjectAndPersistInfo objectAndPersistInfo = objectIoManager
            .getObjectByIdentifier(dataRecordIdentifier);

        if (objectAndPersistInfo != null) {
          final String name = objectAndPersistInfo.objectClassInfo
              .getName();
View Full Code Here

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

        for (DataRecordIdentifier dataRecordIdentifier : dataRecordIdentifiers) {
          stringBuilder.append('\n');
          if (dataManager.hasDataRecord(dataRecordIdentifier)) {

            stringBuilder.append(dataRecordIdentifier.toString());
            final ObjectAndPersistInfo objectAndPersistInfo = objectIoManager
                .getObjectByIdentifier(dataRecordIdentifier);
            if (objectAndPersistInfo != null) {// NOPMD
              stringBuilder.append(" object ");
              stringBuilder
                  .append(objectAndPersistInfo.objectClassInfo);
View Full Code Here

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

  }

  private Object newNotProxyInstance(final ClassInfo objectClassInfo,
      final Class<?>[] parameterTypes, final Object[] initargs)
      throws ReflectException, ClassInfoException, ObjectIOException {
    final ObjectAndPersistInfo objectAndPersistInfo;
    final Object object = helperReflect.newInstanceConstruct(
        objectClassInfo.getObjectClass(), parameterTypes, initargs);
    objectAndPersistInfo = new ObjectAndPersistInfo(object, false,
        objectClassInfo);
    return objectAndPersistInfo.getObject();
  }
View Full Code Here

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

    synchronized (mutex) {
      try {
        final Object newInstance;
        if (proxyMode) {
          final StorageInfo storageInfo = new StorageInfo();
          final ObjectAndPersistInfo objectAndPersistInfo = proxyManager2
              .newInstanceNoConstruction(objectClassInfo,
                  storageInfo, objectIOManager, null/*
                                   * no data
                                   * record
                                   * identifier
                                   */, true/* persisted */);
          newInstance = objectAndPersistInfo.getObject();
        } else {
          newInstance = helperReflect
              .newInstanceDefaultConstructor(objectClassInfo
                  .getObjectClass());
        }
View Full Code Here

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

      final IObjectIOManagerForProxyObjectIO objectIOManager,
      final DataRecordIdentifier dataRecordIdentifier,
      final boolean persisted) throws ProxyException {
    // ASSERTX
    assert objectClassInfo.classExists() : "can not create instance of unexisting class";
    final ObjectAndPersistInfo objectAndPersistInfo;
    try {
      final Object instanceCreated;
      instanceCreated = helperReflect
          .newInstanceNoConstruction(objectClassInfo.getObjectClass());
      if (dataRecordIdentifier == null) {
        objectAndPersistInfo = objectIOManager
            .createObjectPersistInfoOfObject(instanceCreated,
                Boolean.FALSE, objectClassInfo, persisted);
      } else if (persisted) {
        objectAndPersistInfo = objectIOManager
            .createObjectPersistInfoOfObject(instanceCreated,
                false, objectClassInfo, dataRecordIdentifier);
      } else {
        throw new ProxyException(
            "data record identifier must not be defined if object not persisted");
      }
      objectAndPersistInfo.setStorageInfo(storageInfo);
    } catch (ReflectException exception) {
      throw new ProxyException(exception);
      // } catch (EnhanceException exception) {
      // throw new ProxyException("for " + objectClassInfo, exception);
    } catch (ReflectInvalidClassException exception) {
View Full Code Here

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

      final IObjectIOManagerForProxyObjectIO objectIOManager,
      final DataRecordIdentifier dataRecordIdentifier,
      final boolean persisted) throws ProxyException {
    // ASSERTX
    assert !objectClassInfo.notEnhancableForTypeAndStorageMode() : "not enhancable";
    final ObjectAndPersistInfo objectAndPersistInfo;
    try {
      final Object instanceCreated;
      if (useJavaAgent) {
        final Class<?> objectClass = objectClassInfo.getObjectClass();
        instanceCreated = helperReflect
View Full Code Here

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

      final DataRecordIdentifier dataRecordIdentifier,
      final boolean persisted, final Object instanceCreated,
      final boolean constructed) throws ProxyException,
      ObjectIOException, ObjectIODataCorruptedException {

    ObjectAndPersistInfo objectAndPersistInfo;

    objectAndPersistInfo = objectIOManager
        .getObjectAndPersistInfoOfObject(instanceCreated);

    if (objectAndPersistInfo == null) {
      // not created by save
      // FIXMELUC ___seems dataRecordIdentifier always null, see call
      // FIXMELUC ___check persisted flag
      if (dataRecordIdentifier == null) {
        if (constructed) {
          /*
           * use getOrCreate because constructor can use instance
           * factory that set object persist info
           */
          objectAndPersistInfo = objectIOManager
              .getOrCreateObjectPersistInfoOfObject(
                  instanceCreated, true, objectClassInfo,
                  persisted);
        } else {
          assert objectIOManager
              .getObjectAndPersistInfoOfObject(instanceCreated) == null : "must not have associated persist information";
          objectAndPersistInfo = objectIOManager
              .createObjectPersistInfoOfObject(instanceCreated,
                  true, objectClassInfo, persisted);
        }
      } else if (persisted) {
        if (constructed) {
          /*
           * use getOrCreate because constructor can use instance
           * factory that set object persist info
           */
          objectAndPersistInfo = objectIOManager
              .getOrCreateObjectPersistInfoOfObject(
                  instanceCreated, true, objectClassInfo,
                  dataRecordIdentifier);
        } else {
          assert objectIOManager
              .getObjectAndPersistInfoOfObject(instanceCreated) == null : "must not have associated persist information";
          objectAndPersistInfo = objectIOManager
              .createObjectPersistInfoOfObject(instanceCreated,
                  true, objectClassInfo, dataRecordIdentifier);
        }
      } else {
        throw new ProxyException(
            "data record identifier must not be defined if object not persisted");
      }

      objectAndPersistInfo.setStorageInfo(storageInfo);
      if (constructed) {
        assert objectAndPersistInfo.isNotWeak() : objectAndPersistInfo
            .toString();
        assert objectAndPersistInfo.isLoaded() : objectAndPersistInfo
            .toString();
        // objectIOManager.objectIsAccessed(objectAndPersistInfo);
        // objectAndPersistInfo.setNewObject(true);
        objectIOManager.newObjectLoaded();
      }
    } else {
      // created by save
      assert constructed;
      assert objectAndPersistInfo.isNotWeak() : objectAndPersistInfo
          .toString();
      assert objectAndPersistInfo.isLoaded() : objectAndPersistInfo
          .toString();
      assert persisted;
      assert dataRecordIdentifier == null;
      objectAndPersistInfo.setStorageInfo(storageInfo);
      // objectIOManager.objectIsAccessed(objectAndPersistInfo);
      // objectAndPersistInfo.setNewObject(true);
      objectIOManager.newObjectLoaded();
    }
    return objectAndPersistInfo;
View Full Code Here

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

      final IObjectIOManagerForObjectIO objectIOManager)
      throws ProxyException {
    assert isProxyOrEnhanced(object) : "object must be a proxy";
    final IProxyCallBackToImplement proxyCallBack = new ProxyCallBack(
        objectIOManager);
    final ObjectAndPersistInfo objectAndPersistInfo;
    try {
      objectAndPersistInfo = objectIOManager
          .getOrCreateObjectPersistInfoOfObject(object, true, true);

      changeProxyCallBack(objectAndPersistInfo, proxyCallBack);
View Full Code Here

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

  }

  public static ObjectAndPersistInfo getObjectAndPersistInfo(
      final Object object) {
    final IProxyCallBackToImplement proxyCallBack = getProxyCallBack(object);
    final ObjectAndPersistInfo objectAndPersistInfo;
    if (proxyCallBack == null) {
      objectAndPersistInfo = null;
    } else {
      objectAndPersistInfo = proxyCallBack.getInstance$JOAFIP$();
    }
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.