Пример #1
0
  public void open(
      final String iUserName, final String iUserPassword, final Map<String, Object> iOptions) {
    addUser();

    lock.acquireExclusiveLock();

    connectionUserName = iUserName;
    connectionUserPassword = iUserPassword;
    connectionOptions =
        iOptions != null
            ? new HashMap<String, Object>(iOptions)
            : null; // CREATE A COPY TO AVOID USER MANIPULATION
    // POST OPEN

    try {
      openRemoteDatabase();

      configuration = new OStorageConfiguration(this);
      configuration.load();

    } catch (Exception e) {
      if (!OGlobalConfiguration.STORAGE_KEEP_OPEN.getValueAsBoolean()) close();

      if (e instanceof RuntimeException)
        // PASS THROUGH
        throw (RuntimeException) e;
      else throw new OStorageException("Cannot open the remote storage: " + name, e);

    } finally {
      lock.releaseExclusiveLock();
    }
  }
Пример #2
0
  public void create() throws Exception {
    OGlobalConfiguration.STORAGE_KEEP_OPEN.setValue(false);
    OFileUtils.deleteRecursively(new File("servers"));

    String confDir = System.getProperty("g1.server.conf.dir");
    if (confDir == null) {
      confDir = "target/classes";
      System.setProperty("g1.server.conf.dir", confDir);
    }

    String databaseUrl = getDatabaseURL();

    initializeExceptionRecordTable(databaseUrl);
  }
Пример #3
0
 @AfterClass
 public void after() {
   OGlobalConfiguration.STORAGE_KEEP_OPEN.setValue(oldStorageOpen);
 }
Пример #4
0
 @BeforeClass
 public void before() {
   oldStorageOpen = OGlobalConfiguration.STORAGE_KEEP_OPEN.getValueAsBoolean();
   OGlobalConfiguration.STORAGE_KEEP_OPEN.setValue(false);
 }
 public SimulateOperationsAgainstServer() {
   OGlobalConfiguration.CLIENT_CHANNEL_MAX_POOL.setValue(threads + 5);
   OGlobalConfiguration.STORAGE_KEEP_OPEN.setValue(true);
 }