public void shutdown() throws IOException { shutdown(0); }
@Override public boolean execute(ManagedServer server) throws Exception { assert Thread.holdsLock(ManagedServer.this); // Call under lock // Reconnect processControllerClient.reconnectProcess(serverProcessName, managementURI, bootConfiguration.isManagementSubsystemEndpoint(), authKey); return true; } }
@Override public boolean execute(ManagedServer server) throws Exception { assert Thread.holdsLock(ManagedServer.this); // Call under lock // Remove process processControllerClient.removeProcess(serverProcessName); return true; } }
@Override public boolean execute(ManagedServer server) throws Exception { assert Thread.holdsLock(ManagedServer.this); // Call under lock // Start the process processControllerClient.startProcess(serverProcessName); return true; }
@Override public void execute(ManagedServer server) throws Exception { assert Thread.holdsLock(ManagedServer.this); // Call under lock final List<String> command = bootConfiguration.getServerLaunchCommand(); final Map<String, String> env = bootConfiguration.getServerLaunchEnvironment(); final HostControllerEnvironment environment = bootConfiguration.getHostControllerEnvironment(); // Add the process to the process controller processControllerClient.addProcess(serverProcessName, authKey, command.toArray(new String[command.size()]), environment.getHomeDir().getAbsolutePath(), env); }
@Override public void execute(ManagedServer server) throws Exception { assert Thread.holdsLock(ManagedServer.this); // Call under lock // Stop process processControllerClient.stopProcess(serverProcessName); } }
@Override public synchronized Map<String, ProcessInfo> determineRunningProcesses() { processInventoryLatch = new CountDownLatch(1); try { processControllerClient.requestProcessInventory(); } catch (IOException e) { throw new RuntimeException(e); } try { if (!processInventoryLatch.await(30, TimeUnit.SECONDS)){ throw MESSAGES.couldNotGetServerInventory(30L, TimeUnit.SECONDS.toString().toLowerCase(Locale.US)); } } catch (InterruptedException e) { throw MESSAGES.couldNotGetServerInventory(30L, TimeUnit.SECONDS.toString().toLowerCase(Locale.US)); } return processInfos; }
@Override public void execute(ManagedServer server) throws Exception { assert Thread.holdsLock(ManagedServer.this); // Call under lock // Get the standalone boot updates final List<ModelNode> bootUpdates = Collections.emptyList(); // bootConfiguration.getBootUpdates(); final Map<String, String> launchProperties = parseLaunchProperties(bootConfiguration.getServerLaunchCommand()); final boolean useSubsystemEndpoint = bootConfiguration.isManagementSubsystemEndpoint(); final ModelNode endpointConfig = bootConfiguration.getSubsystemEndpointConfiguration(); // Send std.in final ServiceActivator hostControllerCommActivator = DomainServerCommunicationServices.create(endpointConfig, managementSocket, serverName, serverProcessName, authKey, useSubsystemEndpoint); final ServerStartTask startTask = new ServerStartTask(hostControllerName, serverName, 0, Collections.<ServiceActivator>singletonList(hostControllerCommActivator), bootUpdates, launchProperties); final Marshaller marshaller = MARSHALLER_FACTORY.createMarshaller(CONFIG); final OutputStream os = processControllerClient.sendStdin(serverProcessName); marshaller.start(Marshalling.createByteOutput(os)); marshaller.writeObject(startTask); marshaller.finish(); marshaller.close(); os.close(); } }
configuration.setThreadFactory(threadFactory); configuration.setSocketFactory(SocketFactory.getDefault()); client = ProcessControllerClient.connect(configuration, authCode, new ProcessMessageHandler() { @Override public void handleProcessAdded(final ProcessControllerClient client, final String processName) {
os.write(1); os.write(authCode.getBytes(Charset.forName("US-ASCII"))); final ProcessControllerClient processControllerClient = new ProcessControllerClient(connection); connection.attach(processControllerClient); ProcessLogger.CLIENT_LOGGER.trace("Sent initial greeting message");
@Override public boolean execute(ManagedServer server) throws Exception { assert Thread.holdsLock(ManagedServer.this); // Call under lock // Start the process processControllerClient.startProcess(serverProcessName); return true; }
@Override public boolean execute(ManagedServer server) throws Exception { assert Thread.holdsLock(ManagedServer.this); // Call under lock final List<String> command = bootConfiguration.getServerLaunchCommand(); final Map<String, String> env = bootConfiguration.getServerLaunchEnvironment(); final HostControllerEnvironment environment = bootConfiguration.getHostControllerEnvironment(); final int processId = bootConfiguration.getServerProcessId(); // Add the process to the process controller processControllerClient.addProcess(serverProcessName, processId, authKey, command.toArray(new String[command.size()]), environment.getHomeDir().getAbsolutePath(), env); return true; }
processControllerClient.stopProcess(serverProcessName); } catch (IOException ignore) {
@Override public synchronized Map<String, ProcessInfo> determineRunningProcesses() { processInventoryLatch = new CountDownLatch(1); try { processControllerClient.requestProcessInventory(); } catch (IOException e) { throw new RuntimeException(e); } try { if (!processInventoryLatch.await(30, TimeUnit.SECONDS)){ throw HostControllerLogger.ROOT_LOGGER.couldNotGetServerInventory(30L, TimeUnit.SECONDS.toString().toLowerCase(Locale.US)); } } catch (InterruptedException e) { throw HostControllerLogger.ROOT_LOGGER.couldNotGetServerInventory(30L, TimeUnit.SECONDS.toString().toLowerCase(Locale.US)); } return processInfos; }
@Override public boolean execute(ManagedServer server) throws Exception { assert Thread.holdsLock(ManagedServer.this); // Call under lock // Get the standalone boot updates final List<ModelNode> bootUpdates = Collections.emptyList(); // bootConfiguration.getBootUpdates(); final Map<String, String> launchProperties = bootConfiguration.getServerLaunchProperties(); final boolean useSubsystemEndpoint = bootConfiguration.isManagementSubsystemEndpoint(); final ModelNode endpointConfig = bootConfiguration.getSubsystemEndpointConfiguration(); // Send std.in final ServiceActivator hostControllerCommActivator = DomainServerCommunicationServices.create(endpointConfig, managementURI, serverName, serverProcessName, authKey, useSubsystemEndpoint, bootConfiguration.getSSLContextSupplier()); final ServerStartTask startTask = new ServerStartTask(hostControllerName, serverName, 0, operationID, Collections.<ServiceActivator>singletonList(hostControllerCommActivator), bootUpdates, launchProperties, bootConfiguration.isSuspended()); final Marshaller marshaller = MARSHALLER_FACTORY.createMarshaller(CONFIG); final OutputStream os = processControllerClient.sendStdin(serverProcessName); marshaller.start(Marshalling.createByteOutput(os)); marshaller.writeObject(startTask); marshaller.finish(); marshaller.close(); os.close(); return true; } }
configuration.setThreadFactory(threadFactory); configuration.setSocketFactory(SocketFactory.getDefault()); client = ProcessControllerClient.connect(configuration, authCode, new ProcessMessageHandler() { @Override public void handleProcessAdded(final ProcessControllerClient client, final String processName) {
os.write(1); os.write(authCode.getBytes(Charset.forName("US-ASCII"))); final ProcessControllerClient processControllerClient = new ProcessControllerClient(connection); connection.attach(processControllerClient); ProcessLogger.CLIENT_LOGGER.trace("Sent initial greeting message");
public void shutdown() throws IOException { shutdown(0); }
@Override public boolean execute(ManagedServer server) throws Exception { assert Thread.holdsLock(ManagedServer.this); // Call under lock // Reconnect processControllerClient.reconnectProcess(serverProcessName, managementURI, bootConfiguration.isManagementSubsystemEndpoint(), authKey); return true; } }
@Override public void execute(ManagedServer server) throws Exception { assert Thread.holdsLock(ManagedServer.this); // Call under lock // Start the process processControllerClient.startProcess(serverProcessName); }