Package net.sf.joafip.store.service

Examples of net.sf.joafip.store.service.StoreException


            }
            working = false;
            storeMutex.doWait();
            final Throwable throwable = storeMutex.getThrowable();
            if (throwable != null) {
              final StoreException exception = new StoreException(// NOPMD
                  throwable);
              store.setBackgroundException(exception);
              storeMutex.doNotifyAll(exception);
            }
          }
        }
        storeSaver.saveModification();
        storeMutex.doNotifyAll();
      } catch (InterruptedException exception) {
        LOGGER.fatal("end background garbage sweep", exception);
        storeMutex.doNotifyAll(exception);
      } catch (GarbageException exception) {
        LOGGER.fatal(exception);
        final StoreException storeException = new StoreException(
            exception);
        store.setBackgroundException(storeException);
        storeMutex.doNotifyAll(storeException);
      } catch (StoreException exception) {
        LOGGER.fatal(exception);
        store.setBackgroundException(exception);
        storeMutex.doNotifyAll(exception);
      } catch (Throwable throwable) {// NOPMD
        final StoreException exception = new StoreException(throwable);
        store.setBackgroundException(exception);
        storeMutex.doNotifyAll(exception);
      } finally {
        stopped = true;
        if (LOGGER.debugEnabled) {
View Full Code Here


      }
      if (sleepTime > 0) {
        storeMutex.doWait(sleepTime);
        final Throwable throwable = storeMutex.getThrowable();
        if (throwable != null) {
          final StoreException exception = new StoreException(
              throwable);
          throw exception;
        }
      }
    } else {
      if (LOGGER.debugEnabled) {
        LOGGER.debug("wait for job to do");
      }
      // will be notified of garbage state change
      storeMutex.doWait();
      final Throwable throwable = storeMutex.getThrowable();
      if (throwable != null) {
        final StoreException exception = new StoreException(throwable);
        throw exception;
      }
    }
  }
View Full Code Here

      garbageManager
          .getToGarbageRecordAllDataRecordIdentifiers(setToUpdate);
      garbageManager
          .getCandidateRecordAllDataRecordIdentifiers(setToUpdate);
    } catch (GarbageException exception) {
      throw new StoreException(exception);
    } catch (ReferenceLinkGarbageException exception) {
      throw new StoreException(exception);
    }
  }
View Full Code Here

      if (garbageManagement) {
        try {
          linkManager.linkUpdate();
        } catch (final GarbageException exception) {
          throw new StoreException(exception);
        } catch (final ReferenceLinkGarbageException exception) {
          throw new StoreException(exception);
        }
      }
      /* clear session */
      session.initialize();
      /* now can save the records */
 
View Full Code Here

    }
    if (garbageManagement) {
      try {
        linkManager.linkUpdate();
      } catch (final GarbageException exception) {
        throw new StoreException(exception);
      } catch (final ReferenceLinkGarbageException exception) {
        throw new StoreException(exception);
      }
    }
    session.initialize();
    /* now can save the records */
    flush();
 
View Full Code Here

      try {
        rootObjectAndPersistInfo =
        /**/objectIOManager
            .getObjectAndPersistInfoOfObject(rootOfObjectsToSave);
      } catch (final ObjectIOException exception) {
        throw new StoreException(exception);
      }
      rootOfObjectsToSave = null;// NOPMD unreference
      session.addToVisit(rootObjectAndPersistInfo);
    }

    session.setKeepToVisitForSaveRemoveEnabled(true);

    markedNotStorableEncountered = false;
    markedNotStorableList.clear();

    session.initializeKeepToVisitForSave(objectIOManager
        .getObjectHavingStateSet());
    /*
     * for objects known attached to root
     */
    while ((objectToVisit = session.nextToVisit()) != null) {// NOPMD
      visitOneObjectForSave(objectToVisit, true);
    }

    /*
     * for objects not known attached to root
     */
    final Iterator<ObjectAndPersistInfo> iterator = session
        .keepToVisitForSaveIterator();
    session.setKeepToVisitForSaveRemoveEnabled(false);
    saveLoop(iterator, false);

    if (!closing) {
      final Set<ObjectAndPersistInfo> set = session.getVisitedForSave();
      for (ObjectAndPersistInfo objectAndPersistInfo : set) {
        try {
          if (!mostAccessedObject.contains(objectToVisit)) {
            objectAndPersistInfo.unloadAfterSave();
          }
        } catch (final ObjectIOException exception) {
          throw new StoreException(FOR
              + objectAndPersistInfo.toString(),// NOPMD
              exception);
        } catch (final ObjectIOInvalidClassException exception) {
          throw new StoreInvalidClassException(FOR
              + objectAndPersistInfo.toString(), exception);
        }
      }
    }

    if (markedNotStorableEncountered) {
      /*
       * error management when encountered "marked not storable" or
       * "not enhanced"
       */
      final StringBuilder stringBuilder = new StringBuilder();
      if (markedNotStorableEncountered) {
        stringBuilder
            .append("not marked storable and/or not storable:\n");
        for (final ObjectAndPersistInfo notStorable : markedNotStorableList) {
          stringBuilder.append(notStorable.toString());
          stringBuilder.append('\n');
        }
        markedNotStorableList.clear();
      }
      throw new StoreException(stringBuilder.toString());
    }
  }
View Full Code Here

        ObjectAndPersistInfo substituteObjectAndItsClassInfo;
        try {
          substituteObjectAndItsClassInfo = objectIOManager
              .substituteForWrite(objectAndItsClassInfo);
        } catch (final ObjectIOException exception) {
          throw new StoreException(exception);
        } catch (final ObjectIODataCorruptedException exception) {
          throw new StoreException(exception);
        }
        visitOneObjectForSave2(substituteObjectAndItsClassInfo,
            attachedToRoot);
      } else {
        visitOneObjectForSave2(objectToVisit, attachedToRoot);
View Full Code Here

          }
        }
        addToVisitForSave(sons);
      }
    } catch (final ObjectIOException exception) {
      throw new StoreException(FOR + objectToVisit.toString(),// NOPMD
          exception);
    } catch (final ObjectIOInvalidClassException exception) {
      throw new StoreInvalidClassException(
          FOR + objectToVisit.toString(), exception);
    } catch (final ObjectIONotSerializableException exception) {
      throw new StoreNotSerializableException(FOR
          + objectToVisit.toString(), exception);
    } catch (final ObjectIODataRecordNotFoundException exception) {
      throw new StoreException(FOR + objectToVisit.toString(), exception);
    } catch (final ObjectIOClassNotFoundException exception) {
      throw new StoreClassNotFoundException(FOR
          + objectToVisit.toString(), exception);
    } catch (final ObjectIODataCorruptedException exception) {
      throw new StoreDataCorruptedException(FOR
View Full Code Here

        session.addToAttachedToRoot(identifier);
      } else if (garbageManagement) {
        try {
          garbageManager.addCandidate(identifier);
        } catch (final GarbageException exception) {
          throw new StoreException(exception);
        }
      }
    }
    try {
      // test notVisited first since iLoaded take time
      toSave = notVisited && objectToVisit.isLoaded();
    } catch (final ObjectIOException exception) {
      throw new StoreException(exception);
    }
    return toSave;
  }
View Full Code Here

  }

  private void assertStorable(final ClassInfo objectToVisitClassInfo)
      throws StoreException {
    if (objectToVisitClassInfo.isDeprecatedInStore()) {
      throw new StoreException(objectToVisitClassInfo
          + " is deprecated in store");
    }
  }
View Full Code Here

TOP

Related Classes of net.sf.joafip.store.service.StoreException

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.