boolean isResourceExcluded(final PathAddress address) { return ignoredDomainResourceRegistry.isResourceExcluded(address); }
private boolean isMaster() { return ignoredRegistry.isMaster(); }
void publish() { ignoredRegistry.publish(this); }
private IgnoredDomainResourceRegistry createIgnoredDomainResourceRegistry(List<IgnoreDomainResourceTypeResource> ignoredResources) { IgnoredDomainResourceRegistry reg = new IgnoredDomainResourceRegistry(new LocalHostControllerInfo() { reg.getRootResource().registerChild(PathElement.pathElement(ModelDescriptionConstants.IGNORED_RESOURCE_TYPE, resource.getName()), resource);
public static ServiceController<ModelController> addService(final ServiceTarget serviceTarget, final HostControllerEnvironment environment, final HostRunningModeControl runningModeControl, final ControlledProcessState processState, final BootstrapListener bootstrapListener, final PathManagerService pathManager){ final ConcurrentMap<String, ProxyController> hostProxies = new ConcurrentHashMap<String, ProxyController>(); final Map<String, ProxyController> serverProxies = new ConcurrentHashMap<String, ProxyController>(); final LocalHostControllerInfoImpl hostControllerInfo = new LocalHostControllerInfoImpl(processState, environment); final AbstractVaultReader vaultReader = service(AbstractVaultReader.class); ROOT_LOGGER.debugf("Using VaultReader %s", vaultReader); final ContentRepository contentRepository = ContentRepository.Factory.create(environment.getDomainContentDir()); IgnoredDomainResourceRegistry ignoredRegistry = new IgnoredDomainResourceRegistry(hostControllerInfo); final PrepareStepHandler prepareStepHandler = new PrepareStepHandler(hostControllerInfo, contentRepository, hostProxies, serverProxies, ignoredRegistry); final ExpressionResolver expressionResolver = new RuntimeExpressionResolver(vaultReader); DomainModelControllerService service = new DomainModelControllerService(environment, runningModeControl, processState, hostControllerInfo, contentRepository, hostProxies, serverProxies, prepareStepHandler, vaultReader, ignoredRegistry, bootstrapListener, pathManager, expressionResolver, new DelegatingResourceDefinition()); return serviceTarget.addService(SERVICE_NAME, service) .addDependency(HostControllerService.HC_EXECUTOR_SERVICE_NAME, ExecutorService.class, service.getExecutorServiceInjector()) .addDependency(ProcessControllerConnectionService.SERVICE_NAME, ProcessControllerConnectionService.class, service.injectedProcessControllerConnection) .addDependency(PathManagerService.SERVICE_NAME) // ensure this is up .setInitialMode(ServiceController.Mode.ACTIVE) .install(); }
private static boolean isResourceExcluded(OperationContext context, IgnoredDomainResourceRegistry ignoredDomainResourceRegistry, boolean isRemoteDomainControllerIgnoreUnaffectedConfiguration, DomainModelProvider domainModelProvider, String hostName, PathAddress address, ExtensionRegistry extensionRegistry, ModelNode operation) { if (ignoredDomainResourceRegistry.getIgnoredClonedProfileRegistry().checkIgnoredProfileClone(operation)) { return true; } if (ignoredDomainResourceRegistry.isResourceExcluded(address)) { return true; } if (isRemoteDomainControllerIgnoreUnaffectedConfiguration) { IgnoredNonAffectedServerGroupsUtil util = IgnoredNonAffectedServerGroupsUtil.create(extensionRegistry); Set<ServerConfigInfo> serverConfigs = util.getServerConfigsOnSlave(domainModelProvider.getDomainModel().getChild(PathElement.pathElement(HOST, hostName))); return util.ignoreOperation(domainModelProvider.getDomainModel(), serverConfigs, address); } return false; }
/** * {@inheritDoc} */ public void execute(OperationContext context, ModelNode operation) { if (!context.isBooting()) { throw MESSAGES.invocationNotAllowedAfterBoot(OPERATION_NAME); } final String hostName = operation.require(NAME).asString(); // Set up the host model registrations ManagementResourceRegistration rootRegistration = context.getResourceRegistrationForUpdate(); hostModelRegistrar.registerHostModel(hostName, rootRegistration); final PathAddress hostAddress = PathAddress.pathAddress(PathElement.pathElement(HOST, hostName)); final Resource rootResource = context.createResource(hostAddress); final ModelNode model = rootResource.getModel(); initCoreModel(model, hostControllerEnvironment); // Create the empty management security resources context.createResource(hostAddress.append(PathElement.pathElement(CORE_SERVICE, MANAGEMENT))); //Create the empty host-environment resource context.createResource(hostAddress.append(PathElement.pathElement(CORE_SERVICE, HOST_ENVIRONMENT))); // Wire in the platform mbean resources. We're bypassing the context.createResource API here because // we want to use our own resource type. But it's ok as the createResource calls above have taken the lock rootResource.registerChild(PlatformMBeanConstants.ROOT_PATH, new RootPlatformMBeanResource()); // Wire in the ignored-resources resource Resource.ResourceEntry ignoredRoot = ignoredDomainResourceRegistry.getRootResource(); rootResource.registerChild(ignoredRoot.getPathElement(), ignoredRoot); context.stepCompleted(); }
info.get(PRODUCT_VERSION).set(productVersion); ModelNode ignoredModel = ignoredResourceRegistry.getIgnoredResourcesAsModel(); if (ignoredModel.hasDefined(IGNORED_RESOURCE_TYPE)) { info.get(IGNORED_RESOURCES).set(ignoredModel.require(IGNORED_RESOURCE_TYPE));
hostRegistration.registerOperationHandler(SnapshotTakeHandler.DEFINITION, snapshotTake); ignoredRegistry.registerResources(hostRegistration);
private AbstractOpExecutionSupport(final IgnoredDomainResourceRegistry ignoredDomainResourceRegistry) { this.ignoredClonedProfileRegistry = ignoredDomainResourceRegistry.getIgnoredClonedProfileRegistry(); }
private IgnoredDomainResourceRegistry createIgnoredDomainResourceRegistry(List<IgnoreDomainResourceTypeResource> ignoredResources) { IgnoredDomainResourceRegistry reg = new IgnoredDomainResourceRegistry(new LocalHostControllerInfo() { reg.getRootResource().registerChild(PathElement.pathElement(ModelDescriptionConstants.IGNORED_RESOURCE_TYPE, resource.getName()), resource);
final HostControllerEnvironment env = createHostControllerEnvironment(); final LocalHostControllerInfoImpl info = createLocalHostControllerInfo(env); final IgnoredDomainResourceRegistry ignoredRegistry = new IgnoredDomainResourceRegistry(info); final DomainHostExcludeRegistry domainHostExcludeRegistry = new DomainHostExcludeRegistry(); final ExtensibleConfigurationPersister persister = new NullConfigurationPersister();
private static boolean isResourceExcluded(OperationContext context, IgnoredDomainResourceRegistry ignoredDomainResourceRegistry, boolean isRemoteDomainControllerIgnoreUnaffectedConfiguration, DomainModelProvider domainModelProvider, String hostName, PathAddress address, ExtensionRegistry extensionRegistry, ModelNode operation) { if (ignoredDomainResourceRegistry.getIgnoredClonedProfileRegistry().checkIgnoredProfileClone(operation)) { return true; } if (ignoredDomainResourceRegistry.isResourceExcluded(address)) { return true; } if (isRemoteDomainControllerIgnoreUnaffectedConfiguration) { IgnoredNonAffectedServerGroupsUtil util = IgnoredNonAffectedServerGroupsUtil.create(extensionRegistry); Set<ServerConfigInfo> serverConfigs = util.getServerConfigsOnSlave(domainModelProvider.getDomainModel().getChild(PathElement.pathElement(HOST, hostName))); return util.ignoreOperation(domainModelProvider.getDomainModel(), serverConfigs, address); } return false; }
public void initModelServices(final OperationContext context, final PathAddress hostAddress, final Resource rootResource) { // Create the management resources Resource management = context.createResource(hostAddress.append(PathElement.pathElement(CORE_SERVICE, MANAGEMENT))); if (modelControllerResource != null) { management.registerChild(PathElement.pathElement(SERVICE, MANAGEMENT_OPERATIONS), modelControllerResource); } //Create the empty host-environment resource context.addResource(hostAddress.append(PathElement.pathElement(CORE_SERVICE, HOST_ENVIRONMENT)), PlaceholderResource.INSTANCE); //Create the empty module-loading resource rootResource.registerChild(PathElement.pathElement(ModelDescriptionConstants.CORE_SERVICE, ModelDescriptionConstants.MODULE_LOADING), PlaceholderResource.INSTANCE); //Create the empty capability registry resource rootResource.registerChild(PathElement.pathElement(ModelDescriptionConstants.CORE_SERVICE, ModelDescriptionConstants.CAPABILITY_REGISTRY), PlaceholderResource.INSTANCE); // Wire in the platform mbean resources. We're bypassing the context.createResource API here because // we want to use our own resource type. But it's ok as the createResource calls above have taken the lock rootResource.registerChild(PlatformMBeanConstants.ROOT_PATH, new RootPlatformMBeanResource()); // Wire in the ignored-resources resource Resource.ResourceEntry ignoredRoot = ignoredDomainResourceRegistry.getRootResource(); rootResource.registerChild(ignoredRoot.getPathElement(), ignoredRoot); // Create the empty discovery options resource context.addResource(hostAddress.append(PathElement.pathElement(CORE_SERVICE, DISCOVERY_OPTIONS)), new DiscoveryOptionsResource()); }
info.get(PRODUCT_VERSION).set(productVersion); ModelNode ignoredModel = ignoredResourceRegistry.getIgnoredResourcesAsModel(); if (ignoredModel.hasDefined(IGNORED_RESOURCE_TYPE)) { info.get(IGNORED_RESOURCES).set(ignoredModel.require(IGNORED_RESOURCE_TYPE));
hostRegistration.registerOperationHandler(SnapshotTakeHandler.DEFINITION, snapshotTake); ignoredRegistry.registerResources(hostRegistration);
private AbstractOpExecutionSupport(final IgnoredDomainResourceRegistry ignoredDomainResourceRegistry) { this.ignoredClonedProfileRegistry = ignoredDomainResourceRegistry.getIgnoredClonedProfileRegistry(); }
@Override public boolean isResourceTransformationIgnored(PathAddress address) { return parameters.getIgnoredResourceRegistry().isResourceExcluded(address); } };
final HostControllerEnvironment env = createHostControllerEnvironment(); final LocalHostControllerInfoImpl info = createLocalHostControllerInfo(env); final IgnoredDomainResourceRegistry ignoredRegistry = new IgnoredDomainResourceRegistry(info); final DomainHostExcludeRegistry domainHostExcludeRegistry = new DomainHostExcludeRegistry(); final ExtensibleConfigurationPersister persister = new NullConfigurationPersister();
public void initModelServices(final OperationContext context, final PathAddress hostAddress, final Resource rootResource) { // Create the management resources Resource management = context.createResource(hostAddress.append(PathElement.pathElement(CORE_SERVICE, MANAGEMENT))); if (modelControllerResource != null) { management.registerChild(PathElement.pathElement(SERVICE, MANAGEMENT_OPERATIONS), modelControllerResource); } //Create the empty host-environment resource context.addResource(hostAddress.append(PathElement.pathElement(CORE_SERVICE, HOST_ENVIRONMENT)), PlaceholderResource.INSTANCE); //Create the empty module-loading resource rootResource.registerChild(PathElement.pathElement(ModelDescriptionConstants.CORE_SERVICE, ModelDescriptionConstants.MODULE_LOADING), PlaceholderResource.INSTANCE); //Create the empty capability registry resource rootResource.registerChild(PathElement.pathElement(ModelDescriptionConstants.CORE_SERVICE, ModelDescriptionConstants.CAPABILITY_REGISTRY), PlaceholderResource.INSTANCE); // Wire in the platform mbean resources. We're bypassing the context.createResource API here because // we want to use our own resource type. But it's ok as the createResource calls above have taken the lock rootResource.registerChild(PlatformMBeanConstants.ROOT_PATH, new RootPlatformMBeanResource()); // Wire in the ignored-resources resource Resource.ResourceEntry ignoredRoot = ignoredDomainResourceRegistry.getRootResource(); rootResource.registerChild(ignoredRoot.getPathElement(), ignoredRoot); // Create the empty discovery options resource context.addResource(hostAddress.append(PathElement.pathElement(CORE_SERVICE, DISCOVERY_OPTIONS)), new DiscoveryOptionsResource()); }