Search in sources :

Example 1 with Environment

use of io.cryostat.core.sys.Environment in project cryostat by cryostatio.

the class Cryostat method main.

public static void main(String[] args) throws Exception {
    CryostatCore.initialize();
    Security.addProvider(BouncyCastleProviderSingleton.getInstance());
    final Logger logger = Logger.INSTANCE;
    final Environment environment = new Environment();
    logger.trace("env: {}", environment.getEnv().toString());
    logger.info("{} started.", System.getProperty("java.rmi.server.hostname", "cryostat"));
    Client client = DaggerCryostat_Client.builder().build();
    CompletableFuture<Void> future = new CompletableFuture<>();
    client.httpServer().addShutdownListener(() -> future.complete(null));
    client.credentialsManager().load();
    client.ruleRegistry().loadRules();
    client.vertx().deployVerticle(client.httpServer(), new DeploymentOptions(), res -> logger.info("HTTP Server Verticle Started"));
    client.vertx().deployVerticle(client.webServer(), new DeploymentOptions().setWorker(true), res -> logger.info("WebServer Verticle Started"));
    client.vertx().deployVerticle(client.messagingServer(), new DeploymentOptions(), res -> logger.info("MessagingServer Verticle Started"));
    client.vertx().deployVerticle(client.ruleProcessor(), new DeploymentOptions().setWorker(true), res -> logger.info("RuleProcessor Verticle Started"));
    client.platformClient().start();
    client.recordingMetadataManager().load();
    future.join();
}
Also used : CompletableFuture(java.util.concurrent.CompletableFuture) DeploymentOptions(io.vertx.core.DeploymentOptions) Environment(io.cryostat.core.sys.Environment) Logger(io.cryostat.core.log.Logger) PlatformClient(io.cryostat.platform.PlatformClient)

Aggregations

Logger (io.cryostat.core.log.Logger)1 Environment (io.cryostat.core.sys.Environment)1 PlatformClient (io.cryostat.platform.PlatformClient)1 DeploymentOptions (io.vertx.core.DeploymentOptions)1 CompletableFuture (java.util.concurrent.CompletableFuture)1