if (registration.getPathAddress().getLastElement().isWildcard()) { for (ThreadPoolResourceDefinition pool : EnumSet.allOf(ThreadPoolResourceDefinition.class)) { pool.register(registration); if (registration.getPathAddress().getLastElement().isWildcard()) { parent.registerAlias(LEGACY_PATH, new AliasEntry(registration) { @Override
@SuppressWarnings("deprecation") @Override public ManagementResourceRegistration register(ManagementResourceRegistration parent) { ManagementResourceRegistration registration = parent.registerSubModel(this); ResourceDescriptor descriptor = this.configurator.apply(new ResourceDescriptor(this.getResourceDescriptionResolver())) .addAttributes(Attribute.class) .addExtraParameters(DeprecatedAttribute.class) ; new RestartParentResourceRegistration(this.parentServiceConfiguratorFactory, descriptor, this.handler).register(registration); if (registration.getPathAddress().getLastElement().isWildcard()) { new PropertyResourceDefinition().register(registration); } return registration; } }
if (registration.getPathAddress().getLastElement().isWildcard()) { OverrideDescriptionProvider provider = new OverrideDescriptionProvider() { @Override
@Override public PathAddress getPathAddress() { return deployments.getPathAddress(); }
@Override public PathAddress getPathAddress() { return getDelegate().getPathAddress(); }
@Override public PathAddress getPathAddress() { return getDelegate().getPathAddress(); }
@Override public void handleRollback(OperationContext context, ModelNode operation) { if (install) { extensionRegistry.removeExtension(context.readResourceFromRoot(rootRegistration.getPathAddress()), moduleName, rootRegistration); } } });
@Override public void handleRollback(OperationContext context, ModelNode operation) { if (install) { extensionRegistry.removeExtension(context.readResourceFromRoot(rootRegistration.getPathAddress()), moduleName, rootRegistration); } } });
@Override public void registerProxyController(final PathElement address, final ProxyController controller) throws IllegalArgumentException { final ManagementResourceRegistration existing = getSubRegistration(PathAddress.pathAddress(address)); if (existing != null && existing.getPathAddress().getLastElement().getValue().equals(address.getValue())) { throw ControllerLogger.ROOT_LOGGER.nodeAlreadyRegistered(existing.getPathAddress().toCLIStyleString()); } getOrCreateSubregistry(address.getKey()).registerProxyController(address.getValue(), controller); }
@Override public void registerChildren(ManagementResourceRegistration resourceRegistration) { super.registerChildren(resourceRegistration); resourceRegistration.registerSubModel(OutboundBindAddressResourceDefinition.getInstance()); // Don't register on a domain profile, as there are no services to back the resource // We could check if (resourceRegistration.getProcessType().isServer()) instead but // if we ever support this extension as an HC subsystem (which seems reasonably possible) // by doing it this way it will still behave correctly. if (!PROFILE.equals(resourceRegistration.getPathAddress().getElement(0).getKey())) { resourceRegistration.registerSubModel(new WorkerServerDefinition()); } }
@Override public void registerProxyController(final PathElement address, final ProxyController controller) throws IllegalArgumentException { final ManagementResourceRegistration existing = getSubRegistration(PathAddress.pathAddress(address)); if (existing != null && existing.getPathAddress().getLastElement().getValue().equals(address.getValue())) { throw ControllerLogger.ROOT_LOGGER.nodeAlreadyRegistered(existing.getPathAddress().toCLIStyleString()); } getOrCreateSubregistry(address.getKey()).registerProxyController(address.getValue(), controller); }
@Override public void registerChildren(ManagementResourceRegistration resourceRegistration) { super.registerChildren(resourceRegistration); resourceRegistration.registerSubModel(OutboundBindAddressResourceDefinition.getInstance()); // Don't register on a domain profile, as there are no services to back the resource // We could check if (resourceRegistration.getProcessType().isServer()) instead but // if we ever support this extension as an HC subsystem (which seems reasonably possible) // by doing it this way it will still behave correctly. if (!PROFILE.equals(resourceRegistration.getPathAddress().getElement(0).getKey())) { resourceRegistration.registerSubModel(new WorkerServerDefinition()); } }
@Override public void registerAttributes(ManagementResourceRegistration resourceRegistration) { super.registerAttributes(resourceRegistration); ReloadRequiredWriteAttributeHandler handler = new ReloadRequiredWriteAttributeHandler(getAttributes()); for (AttributeDefinition attr : getAttributes()) { if(!attr.getImmutableFlags().contains(AttributeAccess.Flag.RESTART_ALL_SERVICES)) { throw ControllerLogger.ROOT_LOGGER.attributeWasNotMarkedAsReloadRequired(attr.getName(), resourceRegistration.getPathAddress()); } resourceRegistration.registerReadWriteAttribute(attr, null, handler); } }
@Override public void registerAttributes(ManagementResourceRegistration resourceRegistration) { super.registerAttributes(resourceRegistration); ReloadRequiredWriteAttributeHandler handler = new ReloadRequiredWriteAttributeHandler(getAttributes()); for (AttributeDefinition attr : getAttributes()) { if(!attr.getImmutableFlags().contains(AttributeAccess.Flag.RESTART_ALL_SERVICES)) { throw ControllerLogger.ROOT_LOGGER.attributeWasNotMarkedAsReloadRequired(attr.getName(), resourceRegistration.getPathAddress()); } resourceRegistration.registerReadWriteAttribute(attr, null, handler); } }
@Override public ManagementResourceRegistration registerSubModel(final ResourceDefinition resourceDefinition) { Assert.checkNotNullParam("resourceDefinition", resourceDefinition); final PathElement address = resourceDefinition.getPathElement(); if (address == null) { throw ControllerLogger.ROOT_LOGGER.cannotRegisterSubmodelWithNullPath(); } final ManagementResourceRegistration existing = getSubRegistration(PathAddress.pathAddress(address)); if (existing != null && existing.getPathAddress().getLastElement().getValue().equals(address.getValue())) { throw ControllerLogger.ROOT_LOGGER.nodeAlreadyRegistered(existing.getPathAddress().toCLIStyleString()); } final NodeSubregistry child = getOrCreateSubregistry(address.getKey()); return child.registerChild(address.getValue(), resourceDefinition); }
@Override public ManagementResourceRegistration registerSubModel(final ResourceDefinition resourceDefinition) { Assert.checkNotNullParam("resourceDefinition", resourceDefinition); final PathElement address = resourceDefinition.getPathElement(); if (address == null) { throw ControllerLogger.ROOT_LOGGER.cannotRegisterSubmodelWithNullPath(); } final ManagementResourceRegistration existing = getSubRegistration(PathAddress.pathAddress(address)); if (existing != null && existing.getPathAddress().getLastElement().getValue().equals(address.getValue())) { throw ControllerLogger.ROOT_LOGGER.nodeAlreadyRegistered(existing.getPathAddress().toCLIStyleString()); } final NodeSubregistry child = getOrCreateSubregistry(address.getKey()); return child.registerChild(address.getValue(), resourceDefinition); }
@SuppressWarnings("deprecation") @Override public ManagementResourceRegistration register(ManagementResourceRegistration parent) { ManagementResourceRegistration registration = parent.registerSubModel(this); ResourceDescriptor descriptor = this.configurator.apply(new ResourceDescriptor(this.getResourceDescriptionResolver())) .addAttributes(Attribute.class) .addExtraParameters(DeprecatedAttribute.class) ; new RestartParentResourceRegistration(this.parentServiceConfiguratorFactory, descriptor, this.handler).register(registration); if (registration.getPathAddress().getLastElement().isWildcard()) { new PropertyResourceDefinition().register(registration); } return registration; } }
protected static void registerResolveOperationHandler(ExtensionContext context, ManagementResourceRegistration registry) { if (context.getProcessType().isServer()) { final ResolvePathHandler resolvePathHandler = ResolvePathHandler.Builder.of(context.getPathManager()) .setPathAttribute(PATHS.get(registry.getPathAddress().getLastElement().getValue())) .setRelativeToAttribute(PathDefinition.RELATIVE_TO) .setCheckAbsolutePath(true) .build(); registry.registerOperationHandler(resolvePathHandler.getOperationDefinition(), resolvePathHandler); } }
protected static void registerResolveOperationHandler(ExtensionContext context, ManagementResourceRegistration registry) { if (context.getProcessType().isServer()) { final ResolvePathHandler resolvePathHandler = ResolvePathHandler.Builder.of(context.getPathManager()) .setPathAttribute(PATHS.get(registry.getPathAddress().getLastElement().getValue())) .setRelativeToAttribute(PathDefinition.RELATIVE_TO) .setCheckAbsolutePath(true) .build(); registry.registerOperationHandler(resolvePathHandler.getOperationDefinition(), resolvePathHandler); } }
@Override public void registerAlias(PathElement address, AliasEntry alias) { RootInvocation rootInvocation = parent == null ? null : getRootInvocation(); AbstractResourceRegistration root = rootInvocation == null ? this : rootInvocation.root; PathAddress myaddr = rootInvocation == null ? PathAddress.EMPTY_ADDRESS : rootInvocation.pathAddress; PathAddress targetAddress = alias.getTarget().getPathAddress(); alias.setAddresses(targetAddress, myaddr.append(address)); AbstractResourceRegistration target = (AbstractResourceRegistration)root.getSubModel(alias.getTargetAddress()); if (target == null) { throw ControllerLogger.ROOT_LOGGER.aliasTargetResourceRegistrationNotFound(alias.getTargetAddress()); } registerAlias(address, alias, target); }