Examples of HeapException


Examples of net.sf.joafip.kvstore.service.HeapException

  }

  @Override
  public void startService() throws HeapException {
    if (started) {
      throw new HeapException("already started");
    }
    fileForStorable.open();
    started = true;
  }
View Full Code Here

Examples of net.sf.joafip.kvstore.service.HeapException

      } catch (Exception exception) {
        LOGGER.error("clossing transaction while stopping service");
      }
    }
    if (!started) {
      throw new HeapException("already stopped");
    }
    started = false;
    fileForStorable.close();
  }
View Full Code Here

Examples of net.sf.joafip.kvstore.service.HeapException

  }

  @Override
  public void openTransaction() throws HeapException {
    if (transactionOpen) {
      throw new HeapException("transaction already openned");
    }
    cache.clear();
    final long fileSize = getFileSize();
    heapHeader.clear();
    if (fileSize == 0) {
View Full Code Here

Examples of net.sf.joafip.kvstore.service.HeapException

  }

  @Override
  public void closeTransaction() throws HeapException {
    if (!transactionOpen) {
      throw new HeapException("transaction already closed");
    }
    transactionOpen = false;
    if (heapHeader.isValueChangedToSave()) {
      heapHeader.writeToFile();
    }
View Full Code Here

Examples of net.sf.joafip.kvstore.service.HeapException

  }

  @Override
  public void closeTransactionDiscardChange() throws HeapException {
    if (!transactionOpen) {
      throw new HeapException("transaction already closed");
    }
    transactionOpen = false;
    heapHeader.clear();
    cache.clear();
  }
View Full Code Here

Examples of net.sf.joafip.kvstore.service.HeapException

    return cache.size() + 1;
  }

  private void assertTransactionOpenned() throws HeapException {
    if (!transactionOpen) {
      throw new HeapException("transaction closed");
    }
  }
View Full Code Here

Examples of net.sf.joafip.kvstore.service.HeapException

    }
  }

  private void assertTransactionClosed() throws HeapException {
    if (transactionOpen) {
      throw new HeapException("transaction openned");
    }
  }
View Full Code Here

Examples of net.sf.joafip.kvstore.service.HeapException

  public void write(final byte[] data) throws HeapException {
    assertOpenned();
    if (positionInFile + data.length > size) {
      size = (int) (positionInFile + data.length);
      if (size > image.length) {
        throw new HeapException("out of image buffer");
      }
    }
    for (int index = 0; index < data.length; index++) {
      image[(int) positionInFile++] = data[index];
    }
View Full Code Here

Examples of net.sf.joafip.kvstore.service.HeapException

      throws HeapException {
    assertOpenned();
    if (positionInFile + length > size) {
      size = (int) (positionInFile + length);
      if (size > image.length) {
        throw new HeapException("out of image buffer");
      }
    }
    for (int index = offset; index < length; index++) {
      image[(int) positionInFile++] = data[index];
    }
View Full Code Here

Examples of net.sf.joafip.kvstore.service.HeapException

    }
  }

  @Override
  public void write(final ToBackupRecord toBackupRecord) throws HeapException {
    throw new HeapException("unsupported");
  }
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.