- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {}
/** * Execute the application defined by the specified {@link SimpleApplicationSchema}. * * @param schema the {@link SimpleApplicationSchema} defining the application to execute */ protected void execute(SimpleApplicationSchema schema) { LocalPlatform platform = LocalPlatform.getInstance(); try (Application application = platform.realize("Vagrant", schema, new SystemApplicationConsole())) { application.waitFor(); } catch (Exception e) { throw new RuntimeException("Error executing Vagrant command", e); } }
/** * Start the HTTP server that will be used to serve the artifacts * to be deployed. * * @param executor the {@link Executor} to pass to the {@link HttpServer} * @param artifacts a {@link Map} of {@link DeploymentArtifact}s to deploy * keyed by the URL path for each artifact * */ protected HttpServer createServer(ExecutorService executor, Map<String, DeploymentArtifact> artifacts) { try { LocalPlatform platform = LocalPlatform.getInstance(); InetAddress address = NetworkHelper.getFeasibleLocalHost(); int port = platform.getAvailablePorts().next(); HttpServer server = HttpServer.create(new InetSocketAddress(address, port), 0); server.createContext("/", new ArtifactsHandler(artifacts, options.asArray())); server.setExecutor(executor); server.start(); return server; } catch (IOException e) { throw new RuntimeException("Unable to create HTTP server", e); } }
remoteDebugPort = LocalPlatform.getInstance().getAvailablePorts().next();
LocalPlatform platform = LocalPlatform.getInstance(); Application application = platform.realize("Vagrant", schema, console))