@Override public void handleProcessAdded(final ProcessControllerClient client, final String processName) { if (serverInventory == null){ throw MESSAGES.noServerInventory(); } if(ManagedServer.isServerProcess(processName)) { serverInventory.serverProcessAdded(processName); } }
@Override public void handleProcessRemoved(final ProcessControllerClient client, final String processName) { if (serverInventory == null){ throw MESSAGES.noServerInventory(); } if(ManagedServer.isServerProcess(processName)) { serverInventory.serverProcessRemoved(processName); } }
@Override public void handleProcessStarted(final ProcessControllerClient client, final String processName) { if (serverInventory == null){ throw MESSAGES.noServerInventory(); } if(ManagedServer.isServerProcess(processName)) { serverInventory.serverProcessStarted(processName); } }
@Override public void registerHostModel(String hostName, ManagementResourceRegistration root) { hostModelRegistration = HostModelUtil.createHostRegistry(hostName, root, hostControllerConfigurationPersister, environment, runningModeControl, localFileRepository, hostControllerInfo, new DelegatingServerInventory(), remoteFileRepository, contentRepository, this, hostExtensionRegistry, extensionRegistry, vaultReader, ignoredRegistry, processState, pathManager, authorizer, securityIdentitySupplier, getAuditLogger(), getBootErrorCollector()); }
@Override public ProtocolConnectionManager.ConnectTask connectionClosed() { HostControllerLogger.ROOT_LOGGER.lostRemoteDomainConnection(); return new ReconnectTaskWrapper(reconnect()); }
@Override public void handleProcessStopped(final ProcessControllerClient client, final String processName, final long uptimeMillis) { if (serverInventory == null){ throw MESSAGES.noServerInventory(); } if(ManagedServer.isServerProcess(processName)) { serverInventory.serverProcessStopped(processName); } }
/** * Try to reconnect to a started server. */ protected synchronized void reconnectServerProcess() { if(this.requiredState != InternalState.SERVER_STARTED) { ROOT_LOGGER.reconnectingServer(serverName); this.requiredState = InternalState.SERVER_STARTED; internalSetState(new ReconnectTask(), InternalState.STOPPED, InternalState.SEND_STDIN); } }
@Override public void handleOperationFailed(ProcessControllerClient client, OperationType operation, String processName) { if (serverInventory == null){ throw MESSAGES.noServerInventory(); } if(ManagedServer.isServerProcess(processName)) { serverInventory.operationFailed(processName, operation); } } });
@Override public void registerHostModel(String hostName, ManagementResourceRegistration root) { HostModelUtil.createHostRegistry(hostName, root, hostControllerConfigurationPersister, environment, runningModeControl, localFileRepository, hostControllerInfo, new DelegatingServerInventory(), remoteFileRepository, contentRepository, this, extensionRegistry,vaultReader, ignoredRegistry, processState, pathManager); }
/** * Reload a managed server. * * @param permit the controller permit * @return whether the state was changed successfully or not */ synchronized boolean reload(int permit, boolean suspend) { return internalSetState(new ReloadTask(permit, suspend), InternalState.SERVER_STARTED, InternalState.RELOADING); }
/** * Stop a managed server. */ protected synchronized void stop() { final InternalState required = this.requiredState; if(required != InternalState.STOPPED) { this.requiredState = InternalState.STOPPED; ROOT_LOGGER.stoppingServer(serverName); // Transition, but don't wait for async notifications to complete transition(false); } }
@Override public void handleProcessInventory(final ProcessControllerClient client, final Map<String, ProcessInfo> inventory) { if (serverInventory == null){ throw MESSAGES.noServerInventory(); } serverInventory.processInventory(inventory); }
@Override public synchronized Cancellable pollForConnect() { final Future<Connection> future = connection.reconnect(); setupHandler(); return new Cancellable() { @Override public boolean cancel() { return future.cancel(true); } }; }
@Override public List<ModelNode> suspendServers(Set<String> serverNames, int timeout, BlockingTimeout blockingTimeout) { return getServerInventory().suspendServers(serverNames, timeout, blockingTimeout); } }
@Override public boolean isHostRegistered(String id) { final DomainSlaveHostRegistrations.DomainHostConnection registration = slaveHostRegistrations.getRegistration(id); return registration != null && registration.isConnected(); }
/** * Execute the given function, in a privileged block if a security manager is checking. * @param function the function * @param t the argument to the function * @param <T> the type of the argument to the function * @param <R> the type of the function return value * @return the return value of the function */ static <T, R> R privilegedExecution(Function<T, R> function, T t) { return privilegedExecution().execute(function, t); }
@Override public void registerHostModel(String hostName, ManagementResourceRegistration root) { hostModelRegistration = HostModelUtil.createHostRegistry(hostName, root, hostControllerConfigurationPersister, environment, runningModeControl, localFileRepository, hostControllerInfo, new DelegatingServerInventory(), remoteFileRepository, contentRepository, this, hostExtensionRegistry, extensionRegistry, vaultReader, ignoredRegistry, processState, pathManager, authorizer, securityIdentitySupplier, getAuditLogger(), getBootErrorCollector()); }
@Override public ProtocolConnectionManager.ConnectTask connectionClosed() { HostControllerLogger.ROOT_LOGGER.lostRemoteDomainConnection(); return new ReconnectTaskWrapper(reconnect()); }
/** * Reload a managed server. * * @param permit the controller permit * @return whether the state was changed successfully or not */ synchronized boolean reload(int permit, boolean suspend) { return internalSetState(new ReloadTask(permit, suspend), InternalState.SERVER_STARTED, InternalState.RELOADING); }
@Override public List<ModelNode> suspendServers(Set<String> serverNames, int timeout, BlockingTimeout blockingTimeout) { return getServerInventory().suspendServers(serverNames, timeout, blockingTimeout); } }