Ejemplo n.º 1
0
  protected Orient() {
    // REGISTER THE EMBEDDED ENGINE
    registerEngine(new OEngineLocal());
    registerEngine(new OEngineLocalPaginated());
    registerEngine(new OEngineMemory());
    registerEngine("com.orientechnologies.orient.client.remote.OEngineRemote");

    profiler = new OJVMProfiler();
    if (OGlobalConfiguration.PROFILER_ENABLED.getValueAsBoolean())
      // ACTIVATE RECORDING OF THE PROFILER
      profiler.startRecording();

    if (OGlobalConfiguration.ENVIRONMENT_DUMP_CFG_AT_STARTUP.getValueAsBoolean())
      OGlobalConfiguration.dumpConfiguration(System.out);

    memoryWatchDog = new OMemoryWatchDog();

    active = true;
  }
Ejemplo n.º 2
0
  public synchronized OServerAdmin setGlobalConfiguration(
      final OGlobalConfiguration config, final Object iValue) throws IOException {

    networkAdminOperation(
        new OStorageRemoteOperation<Void>() {
          @Override
          public Void execute(OChannelBinaryAsynchClient network, OStorageRemoteSession session)
              throws IOException {
            storage.beginRequest(network, OChannelBinaryProtocol.REQUEST_CONFIG_SET, session);
            network.writeString(config.getKey());
            network.writeString(iValue != null ? iValue.toString() : "");
            storage.endRequest(network);
            storage.getResponse(network, session);

            return null;
          }
        },
        "Cannot set the configuration value: " + config.getKey());
    return this;
  }
Ejemplo n.º 3
0
  public synchronized String getGlobalConfiguration(final OGlobalConfiguration config)
      throws IOException {
    return networkAdminOperation(
        new OStorageRemoteOperation<String>() {
          @Override
          public String execute(OChannelBinaryAsynchClient network, OStorageRemoteSession session)
              throws IOException {
            storage.beginRequest(network, OChannelBinaryProtocol.REQUEST_CONFIG_GET, session);
            network.writeString(config.getKey());
            storage.endRequest(network);

            try {
              storage.beginResponse(network, session);
              return network.readString();
            } finally {
              storage.endResponse(network);
            }
          }
        },
        "Cannot retrieve the configuration value: " + config.getKey());
  }