Package com.orientechnologies.common.exception

Examples of com.orientechnologies.common.exception.OException


        rollback(iTx);
        throw e;
      } catch (IOException e) {
        // WE NEED TO CALL ROLLBACK HERE, IN THE LOCK
        rollback(iTx);
        throw new OException(e);
      }

      try {
        txManager.clearLogEntries(iTx);
      } catch (Exception e) {
View Full Code Here


    List<Class<?>> classes = null;
    try {
      classes = OReflectionHelper.getClassesForPackage(iPackageName);
    } catch (ClassNotFoundException e) {
      throw new OException(e);
    }
    for (Class<?> c : classes) {
      String className = c.getSimpleName();
      entityClasses.put(className, c);
    }
View Full Code Here

    }
  }

  public void declareRecordType(byte iByte, String iName, Class<? extends ORecordInternal<?>> iClass, final ORecordFactory iFactory) {
    if (recordTypes[iByte] != null)
      throw new OException("Record type byte '" + iByte + "' already in used : " + recordTypes[iByte].getName());
    recordTypeNames[iByte] = iName;
    recordTypes[iByte] = iClass;
    recordFactories[iByte] = iFactory;
  }
View Full Code Here

    // FORMAT THE MESSAGE
    String msg = String.format(iMessage, iAdditionalArgs);

    Constructor<OException> c;
    OException exceptionToThrow = null;
    try {
      if (iNestedException != null) {
        c = (Constructor<OException>) iExceptionClass.getConstructor(String.class, Throwable.class);
        exceptionToThrow = c.newInstance(msg, iNestedException);
      }
View Full Code Here

      // OPEN DB
      out.print("Connecting to database [" + iURL + "] with user '" + iUserName + "'...");

      currentDatabase = new ODatabaseDocumentTx(iURL);
      if (currentDatabase == null)
        throw new OException("Database " + iURL + " not found");
      currentDatabase.open(iUserName, iUserPassword);

      currentDatabaseName = currentDatabase.getName();

      if (currentDatabase.getStorage() instanceof OStorageRemote)
View Full Code Here

    if (iRecordNumber == null)
      checkCurrentObject();
    else {
      int recNumber = Integer.parseInt(iRecordNumber);
      if (currentResultSet.size() == 0)
        throw new OException("No result set where to find the requested record. Execute a query first.");

      if (currentResultSet.size() <= recNumber)
        throw new OException("The record requested is not part of current result set (0"
            + (currentResultSet.size() > 0 ? "-" + (currentResultSet.size() - 1) : "") + ")");

      currentRecord = (ORecordInternal<?>) currentResultSet.get(recNumber).getRecord();
    }
View Full Code Here

    ORecordId rid = new ORecordId(iRecordId);
    final ORawBuffer buffer = currentDatabase.getStorage().readRecord(currentDatabase, rid, null);

    if (buffer == null)
      throw new OException("The record has been deleted");

    out.println("Raw record content (size=" + buffer.buffer.length + "):\n\n" + new String(buffer.buffer));
  }
View Full Code Here

    out.println("OK");
  }

  protected void checkCurrentDatabase() {
    if (currentDatabase == null)
      throw new OException("Database not selected. Use 'connect <database-name>' to connect to a database.");
    if (currentDatabase.isClosed())
      throw new OException("Database is closed");
  }
View Full Code Here

      throw new OException("Database is closed");
  }

  protected void checkCurrentObject() {
    if (currentRecord == null)
      throw new OException("The is no current object selected: create a new one or load it");
  }
View Full Code Here

    // FORMAT THE MESSAGE
    String msg = String.format(iMessage, iAdditionalArgs);

    Constructor<OException> c;
    OException exceptionToThrow = null;
    try {
      if (iNestedException != null) {
        c = (Constructor<OException>) iExceptionClass.getConstructor(String.class, Throwable.class);
        exceptionToThrow = c.newInstance(msg, iNestedException);
      }
View Full Code Here

TOP

Related Classes of com.orientechnologies.common.exception.OException

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.