@Override public void start(StartContext context) throws StartException { final ExecutorService executorService = getExecutorServiceInjector().getValue(); this.hostControllerConfigurationPersister = new HostControllerConfigurationPersister(environment, hostControllerInfo, executorService, extensionRegistry); setConfigurationPersister(hostControllerConfigurationPersister); prepareStepHandler.setExecutorService(executorService); ThreadFactory threadFactory = new JBossThreadFactory(new ThreadGroup("proxy-threads"), Boolean.FALSE, null, "%G - %t", null, null, AccessController.getContext()); proxyExecutor = Executors.newCachedThreadPool(threadFactory); ThreadFactory pingerThreadFactory = new JBossThreadFactory(new ThreadGroup("proxy-pinger-threads"), Boolean.TRUE, null, "%G - %t", null, null, AccessController.getContext()); pingScheduler = Executors.newScheduledThreadPool(PINGER_POOL_SIZE, pingerThreadFactory); super.start(context); }
protected void initializeDomain() { hostControllerInfo.setMasterDomainController(true); overallConfigPersister.initializeDomainConfigurationPersister(false); domainController.initializeMasterDomainRegistry(rootRegistration, overallConfigPersister.getDomainPersister(), contentRepository, fileRepository, extensionRegistry, pathManager); } }
List<ModelNode> hostBootOps = hostControllerConfigurationPersister.load(); ModelNode addHostOp = hostBootOps.remove(0); ok = boot(Collections.singletonList(addHostOp), true); ConfigurationPersister domainPersister = hostControllerConfigurationPersister.getDomainPersister(); ok = boot(domainPersister.load(), false);
delegates[0] = hostPersister.store(hostModel, affectedAddresses); } else if (delegates[1] == null && (addr.size() == 0 || !HOST.equals(addr.getElement(0).getKey()))) { delegates[1] = getDomainPersister().store(model, affectedAddresses);
hostRegistration.registerOperationHandler(SpecifiedInterfaceResolveHandler.DEFINITION, SpecifiedInterfaceResolveHandler.INSTANCE); XmlMarshallingHandler xmh = new HostXmlMarshallingHandler(configurationPersister.getHostPersister(), hostControllerInfo); hostRegistration.registerOperationHandler(XmlMarshallingHandler.DEFINITION, xmh); SnapshotDeleteHandler snapshotDelete = new SnapshotDeleteHandler(configurationPersister.getHostPersister()); hostRegistration.registerOperationHandler(SnapshotDeleteHandler.DEFINITION, snapshotDelete); SnapshotListHandler snapshotList = new SnapshotListHandler(configurationPersister.getHostPersister()); hostRegistration.registerOperationHandler(SnapshotListHandler.DEFINITION, snapshotList); SnapshotTakeHandler snapshotTake = new SnapshotTakeHandler(configurationPersister.getHostPersister()); hostRegistration.registerOperationHandler(SnapshotTakeHandler.DEFINITION, snapshotTake);
private boolean bootEmptyConfig(final BootContext context) throws OperationFailedException, ConfigurationPersistenceException { HostControllerLogger.ROOT_LOGGER.debug("Invoking initial empty config host controller boot"); boolean ok = boot(Collections.singletonList(registerModelControllerServiceInitializationBootStep(context)), true, true); // until a host is added with the host add op, there is no root description provider delegate. We just install a non-resolving one for now, so the // CLI doesn't get a lot of NPEs from :read-resource-description etc. SimpleResourceDefinition def = new SimpleResourceDefinition(new SimpleResourceDefinition.Parameters(null, new NonResolvingResourceDescriptionResolver())); rootResourceDefinition.setFakeDelegate(def); // just initialize the persister and return, we have to wait for /host=foo:add() hostControllerConfigurationPersister.initializeDomainConfigurationPersister(false); return ok; }
domainConfigurationFile = getBackupDomainConfigurationFile(); domainPersister = ConfigurationPersisterFactory.createRemoteBackupDomainXmlConfigurationPersister(configDir, executorService, extensionRegistry); } else { domainConfigurationFile = getStandardDomainConfigurationFile(); final HostRunningModeControl runningModeControl = environment.getRunningModeControl(); if (runningModeControl.isReloaded()) { ConfigurationFile cachedRemote = getBackupDomainConfigurationFile(); File cachedRemoteFile = cachedRemote.getBootFile(); if (cachedRemoteFile.exists()
List<ModelNode> hostBootOps = hostControllerConfigurationPersister.load(); if (hostBootOps.isEmpty()) { // booting with empty config ok = bootEmptyConfig(context); ConfigurationPersister domainPersister = hostControllerConfigurationPersister.getDomainPersister();
delegates[0] = hostPersister.store(hostModel, affectedAddresses); } else if (delegates[1] == null && (addr.size() == 0 || !HOST.equals(addr.getElement(0).getKey()))) { delegates[1] = getDomainPersister().store(model, affectedAddresses);
hostRegistration.registerOperationHandler(WriteConfigHandler.DEFINITION, WriteConfigHandler.INSTANCE); XmlMarshallingHandler xmh = new HostXmlMarshallingHandler(configurationPersister.getHostPersister(), hostControllerInfo); hostRegistration.registerOperationHandler(XmlMarshallingHandler.DEFINITION, xmh); SnapshotDeleteHandler snapshotDelete = new SnapshotDeleteHandler(configurationPersister.getHostPersister()); hostRegistration.registerOperationHandler(SnapshotDeleteHandler.DEFINITION, snapshotDelete); SnapshotListHandler snapshotList = new SnapshotListHandler(configurationPersister.getHostPersister()); hostRegistration.registerOperationHandler(SnapshotListHandler.DEFINITION, snapshotList); SnapshotTakeHandler snapshotTake = new SnapshotTakeHandler(configurationPersister.getHostPersister()); hostRegistration.registerOperationHandler(SnapshotTakeHandler.DEFINITION, snapshotTake);
private boolean bootEmptyConfig(final BootContext context) throws OperationFailedException, ConfigurationPersistenceException { HostControllerLogger.ROOT_LOGGER.debug("Invoking initial empty config host controller boot"); boolean ok = boot(Collections.singletonList(registerModelControllerServiceInitializationBootStep(context)), true, true); // until a host is added with the host add op, there is no root description provider delegate. We just install a non-resolving one for now, so the // CLI doesn't get a lot of NPEs from :read-resource-description etc. SimpleResourceDefinition def = new SimpleResourceDefinition(new SimpleResourceDefinition.Parameters(null, new NonResolvingResourceDescriptionResolver())); rootResourceDefinition.setFakeDelegate(def); // just initialize the persister and return, we have to wait for /host=foo:add() hostControllerConfigurationPersister.initializeDomainConfigurationPersister(false); return ok; }
domainConfigurationFile = getBackupDomainConfigurationFile(); domainPersister = ConfigurationPersisterFactory.createRemoteBackupDomainXmlConfigurationPersister(configDir, executorService, extensionRegistry); } else { domainConfigurationFile = getStandardDomainConfigurationFile(); final HostRunningModeControl runningModeControl = environment.getRunningModeControl(); if (runningModeControl.isReloaded()) { ConfigurationFile cachedRemote = getBackupDomainConfigurationFile(); File cachedRemoteFile = cachedRemote.getBootFile(); if (cachedRemoteFile.exists()
@Override void initializeLocalDomain(final String localHostNameOverride) { hostControllerInfo.setMasterDomainController(true); if (localHostNameOverride != null) { hostControllerInfo.setLocalHostName(localHostNameOverride); } if (localHostNameOverride == null) { // for adding a host later, we don't use the domain persister overallConfigPersister.initializeDomainConfigurationPersister(false); } domainController.initializeMasterDomainRegistry(rootRegistration, localHostNameOverride == null ? overallConfigPersister.getDomainPersister() : null, contentRepository, localFileRepository, extensionRegistry, pathManager); }
List<ModelNode> hostBootOps = hostControllerConfigurationPersister.load(); if (hostBootOps.isEmpty()) { // booting with empty config ok = bootEmptyConfig(context); ConfigurationPersister domainPersister = hostControllerConfigurationPersister.getDomainPersister();
@Override public void start(StartContext context) throws StartException { final ExecutorService executorService = getExecutorServiceInjector().getValue(); this.hostControllerConfigurationPersister = new HostControllerConfigurationPersister(environment, hostControllerInfo, executorService, hostExtensionRegistry, extensionRegistry); setConfigurationPersister(hostControllerConfigurationPersister); prepareStepHandler.setExecutorService(executorService); ThreadFactory pingerThreadFactory = doPrivileged(new PrivilegedAction<JBossThreadFactory>() { public JBossThreadFactory run() { return new JBossThreadFactory(new ThreadGroup("proxy-pinger-threads"), Boolean.TRUE, null, "%G - %t", null, null); } }); pingScheduler = Executors.newScheduledThreadPool(PINGER_POOL_SIZE, pingerThreadFactory); ContentCleanerService.addServiceOnHostController(context.getChildTarget(), DomainModelControllerService.SERVICE_NAME, CLIENT_FACTORY_SERVICE_NAME, HC_EXECUTOR_SERVICE_NAME, HC_SCHEDULED_EXECUTOR_SERVICE_NAME); super.start(context); pingScheduler.scheduleAtFixedRate(new Runnable() { @Override public void run() { try { slaveHostRegistrations.pruneExpired(); } catch (Exception e) { HostControllerLogger.DOMAIN_LOGGER.debugf(e, "failed to execute eviction task"); } } }, 1, 1, TimeUnit.MINUTES); }
delegates[0] = hostPersister.store(hostModel, affectedAddresses); } else if (delegates[1] == null && (addr.size() == 0 || !HOST.equals(addr.getElement(0).getKey()))) { delegates[1] = getDomainPersister().store(model, affectedAddresses);
hostRegistration.registerOperationHandler(WriteConfigHandler.DEFINITION, WriteConfigHandler.INSTANCE); XmlMarshallingHandler xmh = new HostXmlMarshallingHandler(configurationPersister.getHostPersister(), hostControllerInfo); hostRegistration.registerOperationHandler(XmlMarshallingHandler.DEFINITION, xmh); SnapshotDeleteHandler snapshotDelete = new SnapshotDeleteHandler(configurationPersister.getHostPersister()); hostRegistration.registerOperationHandler(SnapshotDeleteHandler.DEFINITION, snapshotDelete); SnapshotListHandler snapshotList = new SnapshotListHandler(configurationPersister.getHostPersister()); hostRegistration.registerOperationHandler(SnapshotListHandler.DEFINITION, snapshotList); SnapshotTakeHandler snapshotTake = new SnapshotTakeHandler(configurationPersister.getHostPersister()); hostRegistration.registerOperationHandler(SnapshotTakeHandler.DEFINITION, snapshotTake);
@Override void initializeLocalDomain(final String localHostNameOverride) { hostControllerInfo.setMasterDomainController(true); if (localHostNameOverride != null) { hostControllerInfo.setLocalHostName(localHostNameOverride); } if (localHostNameOverride == null) { // for adding a host later, we don't use the domain persister overallConfigPersister.initializeDomainConfigurationPersister(false); } domainController.initializeMasterDomainRegistry(rootRegistration, localHostNameOverride == null ? overallConfigPersister.getDomainPersister() : null, contentRepository, localFileRepository, extensionRegistry, pathManager); }
@Override public void start(StartContext context) throws StartException { final ExecutorService executorService = getExecutorServiceInjector().getValue(); this.hostControllerConfigurationPersister = new HostControllerConfigurationPersister(environment, hostControllerInfo, executorService, hostExtensionRegistry, extensionRegistry); setConfigurationPersister(hostControllerConfigurationPersister); prepareStepHandler.setExecutorService(executorService); ThreadFactory pingerThreadFactory = doPrivileged(new PrivilegedAction<JBossThreadFactory>() { public JBossThreadFactory run() { return new JBossThreadFactory(new ThreadGroup("proxy-pinger-threads"), Boolean.TRUE, null, "%G - %t", null, null); } }); pingScheduler = Executors.newScheduledThreadPool(PINGER_POOL_SIZE, pingerThreadFactory); ContentCleanerService.addServiceOnHostController(context.getChildTarget(), DomainModelControllerService.SERVICE_NAME, CLIENT_FACTORY_SERVICE_NAME, HC_EXECUTOR_SERVICE_NAME, HC_SCHEDULED_EXECUTOR_SERVICE_NAME); super.start(context); pingScheduler.scheduleAtFixedRate(new Runnable() { @Override public void run() { try { slaveHostRegistrations.pruneExpired(); } catch (Exception e) { HostControllerLogger.DOMAIN_LOGGER.debugf(e, "failed to execute eviction task"); } } }, 1, 1, TimeUnit.MINUTES); }
protected void initializeDomain(OperationContext context, ModelNode remoteDC) throws OperationFailedException { hostControllerInfo.setMasterDomainController(false); hostControllerInfo.setRemoteDomainControllerHost(HOST.resolveModelAttribute(context, remoteDC).asString()); hostControllerInfo.setRemoteDomainControllerPort(PORT.resolveModelAttribute(context, remoteDC).asInt()); ModelNode usernameNode = USERNAME.resolveModelAttribute(context, remoteDC); if (usernameNode.isDefined()) { hostControllerInfo.setRemoteDomainControllerUsername(usernameNode.asString()); } overallConfigPersister.initializeDomainConfigurationPersister(true); domainController.initializeSlaveDomainRegistry(rootRegistration, overallConfigPersister.getDomainPersister(), contentRepository, fileRepository, hostControllerInfo, extensionRegistry, ignoredDomainResourceRegistry, pathManager); } }