Package net.sf.joafip.store.service.garbage

Examples of net.sf.joafip.store.service.garbage.GarbageException


            .getDataRecordIdentifier();

        setToUpdate.add(dataRecordIdentifier);
      }
    } catch (Exception exception) {
      throw new GarbageException(exception);
    }
  }
View Full Code Here


      } else {
        added = false;
      }
      return added;
    } catch (RBTException exception) {
      throw new GarbageException(exception);
    } catch (HeapRecordableException exception) {
      throw new GarbageException(exception);
    }
  }
View Full Code Here

            .getDataRecordIdentifier();
        toVisitTree.deleteExistingNode(first);
        heapRecordableManager.delete(firstDataRecordIdentifier);
      }
    } catch (RBTException exception) {
      throw new GarbageException(exception);
    } catch (HeapRecordableException exception) {
      throw new GarbageException(exception);
    }
    return dataRecordIdentifier;
  }
View Full Code Here

  public boolean contains(final DataRecordIdentifier dataRecordIdentifier)
      throws GarbageException {
    try {
      return toVisitTree.search(dataRecordIdentifier) != null;
    } catch (RBTException exception) {
      throw new GarbageException(exception);
    }
  }
View Full Code Here

  @Fortest
  public int getNumberOfToVisit() throws GarbageException {
    try {
      return toVisitTree.getNumberOfElement();
    } catch (RBTException exception) {
      throw new GarbageException(exception);
    }
  }
View Full Code Here

  public void appendNewReferenceLink(final ReferenceLink referenceLink)
      throws GarbageException, ReferenceLinkGarbageException {
    GarbageReferenceLinkRBTNode node = referenceLink.getNode();
    if (node != null) {
      throw new GarbageException("already in file");
    }
    node = new GarbageReferenceLinkRBTNode(heapRecordableManager,
        helperBinaryConversion);
    try {
      referenceLink.setNode(node);
      node.setElement(referenceLink);
      heapRecordableManager.attach(node);
      garbageReferenceLinkTree.append(node);
      node.setStateHaveChanged();
    } catch (RBTException exception) {
      rbtExceptionCause(exception);
      throw new InternalError();// NOPMD unreachable code,
      // rbtExceptionCause always throw
      // exception
    } catch (HeapRecordableException exception) {
      throw new GarbageException(exception);
    }
    if (LOGGER.debugEnabled) {
      LOGGER.debug("add reference link record #"
          + node.getDataRecordIdentifier() + ", reference link "
          + referenceLink);
View Full Code Here

  public void deleteReferenceLink(final ReferenceLink referenceLink)
      throws GarbageException, ReferenceLinkGarbageException {
    final GarbageReferenceLinkRBTNode node = referenceLink.getNode();
    if (node == null) {
      throw new GarbageException("does not exist in file");
    }
    try {
      garbageReferenceLinkTree.deleteExistingNode(node);
      final DataRecordIdentifier dataRecordIdentifier = node
          .getDataRecordIdentifier();
      heapRecordableManager.delete(dataRecordIdentifier);
      if (LOGGER.debugEnabled) {
        LOGGER.debug("removed reference link record "
            + dataRecordIdentifier + " for data record object "
            + referenceLink.getReferencedDataRecordIdentifier());
      }
    } catch (RBTException exception) {
      rbtExceptionCause(exception);
      throw new InternalError();// NOPMD unreachable code,
      // rbtExceptionCause always throw
      // exception
    } catch (HeapRecordableException exception) {
      throw new GarbageException(exception);
    }
  }
View Full Code Here

  public void updateReferenceLink(final ReferenceLink referenceLink)
      throws GarbageException {
    final GarbageReferenceLinkRBTNode node = referenceLink.getNode();
    if (node == null) {
      throw new GarbageException("does not exist in file");
    }
    try {
      node.setStateHaveChanged();
    } catch (HeapRecordableException exception) {
      throw new GarbageException(exception);
    }
    if (LOGGER.debugEnabled) {
      LOGGER.debug("update referece link record "
          + node.getDataRecordIdentifier());
    }
View Full Code Here

  private void rbtExceptionCause(final RBTException exception)
      throws ReferenceLinkGarbageException, GarbageException {
    final Throwable cause = exception.getCause();
    if (cause == null) {
      throw new GarbageException(exception);
    } else if (ReferenceLinkGarbageException.class.equals(cause.getClass())) {
      throw (ReferenceLinkGarbageException) cause;
    } else if (GarbageException.class.equals(cause.getClass())) {
      throw (ReferenceLinkGarbageException) cause;
    } else {
      throw new GarbageException(exception);
    }
  }
View Full Code Here

TOP

Related Classes of net.sf.joafip.store.service.garbage.GarbageException

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.