@Override protected void initModel(Resource rootResource, ManagementResourceRegistration rootRegistration) { // TODO maybe make creating of empty nodes part of the MNR description rootResource.registerChild(PathElement.pathElement(ModelDescriptionConstants.CORE_SERVICE, ModelDescriptionConstants.MANAGEMENT), Resource.Factory.create()); rootResource.registerChild(PathElement.pathElement(ModelDescriptionConstants.CORE_SERVICE, ModelDescriptionConstants.SERVICE_CONTAINER), Resource.Factory.create()); rootResource.registerChild(ServerEnvironmentResourceDescription.RESOURCE_PATH, Resource.Factory.create()); ((PathManagerService)injectedPathManagerService.getValue()).addPathManagerResources(rootResource); VersionModelInitializer.registerRootResource(rootResource, configuration.getServerEnvironment() != null ? configuration.getServerEnvironment().getProductConfig() : null); // Platform MBeans rootResource.registerChild(PlatformMBeanConstants.ROOT_PATH, new RootPlatformMBeanResource()); }
/** * {@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(); }
@Override protected void initModel(Resource rootResource, ManagementResourceRegistration rootRegistration) { // TODO maybe make creating of empty nodes part of the MNR description Resource managementResource = Resource.Factory.create(); // TODO - Can we get a Resource direct from CoreManagementResourceDefinition? rootResource.registerChild(PathElement.pathElement(ModelDescriptionConstants.CORE_SERVICE, ModelDescriptionConstants.MANAGEMENT), managementResource); rootResource.registerChild(PathElement.pathElement(ModelDescriptionConstants.CORE_SERVICE, ModelDescriptionConstants.SERVICE_CONTAINER), Resource.Factory.create()); rootResource.registerChild(PathElement.pathElement(ModelDescriptionConstants.CORE_SERVICE, ModelDescriptionConstants.MODULE_LOADING), Resource.Factory.create()); managementResource.registerChild(AccessAuthorizationResourceDefinition.PATH_ELEMENT, AccessAuthorizationResourceDefinition.createResource(authorizer.getWritableAuthorizerConfiguration())); rootResource.registerChild(ServerEnvironmentResourceDescription.RESOURCE_PATH, Resource.Factory.create()); ((PathManagerService)injectedPathManagerService.getValue()).addPathManagerResources(rootResource); VersionModelInitializer.registerRootResource(rootResource, configuration.getServerEnvironment() != null ? configuration.getServerEnvironment().getProductConfig() : null); // Platform MBeans rootResource.registerChild(PlatformMBeanConstants.ROOT_PATH, new RootPlatformMBeanResource()); }
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()); }
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()); }
@Override protected void initModel(ManagementModel managementModel, Resource modelControllerResource) { Resource rootResource = managementModel.getRootResource(); // TODO maybe make creating of empty nodes part of the MNR description Resource managementResource = Resource.Factory.create(); // TODO - Can we get a Resource direct from CoreManagementResourceDefinition? managementResource.registerChild(PathElement.pathElement(ModelDescriptionConstants.SERVICE, ModelDescriptionConstants.MANAGEMENT_OPERATIONS), modelControllerResource); rootResource.registerChild(PathElement.pathElement(ModelDescriptionConstants.CORE_SERVICE, ModelDescriptionConstants.MANAGEMENT), managementResource); rootResource.registerChild(PathElement.pathElement(ModelDescriptionConstants.CORE_SERVICE, ModelDescriptionConstants.SERVICE_CONTAINER), Resource.Factory.create()); rootResource.registerChild(PathElement.pathElement(ModelDescriptionConstants.CORE_SERVICE, ModelDescriptionConstants.MODULE_LOADING), PlaceholderResource.INSTANCE); rootResource.registerChild(PathElement.pathElement(ModelDescriptionConstants.CORE_SERVICE, ModelDescriptionConstants.CAPABILITY_REGISTRY), Resource.Factory.create()); managementResource.registerChild(AccessAuthorizationResourceDefinition.PATH_ELEMENT, AccessAuthorizationResourceDefinition.createResource(authorizer.getWritableAuthorizerConfiguration())); rootResource.registerChild(ServerEnvironmentResourceDescription.RESOURCE_PATH, Resource.Factory.create()); ((PathManagerService)injectedPathManagerService.getValue()).addPathManagerResources(rootResource); VersionModelInitializer.registerRootResource(rootResource, configuration.getServerEnvironment() != null ? configuration.getServerEnvironment().getProductConfig() : null); // Platform MBeans rootResource.registerChild(PlatformMBeanConstants.ROOT_PATH, new RootPlatformMBeanResource()); final RuntimeCapabilityRegistry capabilityRegistry = managementModel.getCapabilityRegistry(); capabilityRegistry.registerCapability( new RuntimeCapabilityRegistration(PATH_MANAGER_CAPABILITY, CapabilityScope.GLOBAL, new RegistrationPoint(PathAddress.EMPTY_ADDRESS, null))); capabilityRegistry.registerCapability( new RuntimeCapabilityRegistration(EXECUTOR_CAPABILITY, CapabilityScope.GLOBAL, new RegistrationPoint(PathAddress.EMPTY_ADDRESS, null))); capabilityRegistry.registerCapability( new RuntimeCapabilityRegistration(SUSPEND_CONTROLLER_CAPABILITY, CapabilityScope.GLOBAL, new RegistrationPoint(PathAddress.EMPTY_ADDRESS, null))); // Record the core capabilities with the root MRR so reads of it will show it as their provider // This also gets them recorded as 'possible capabilities' in the capability registry ManagementResourceRegistration rootRegistration = managementModel.getRootResourceRegistration(); rootRegistration.registerCapability(PATH_MANAGER_CAPABILITY); rootRegistration.registerCapability(EXECUTOR_CAPABILITY); rootRegistration.registerCapability(SUSPEND_CONTROLLER_CAPABILITY); }
@Override protected void initModel(ManagementModel managementModel, Resource modelControllerResource) { Resource rootResource = managementModel.getRootResource(); // TODO maybe make creating of empty nodes part of the MNR description Resource managementResource = Resource.Factory.create(); // TODO - Can we get a Resource direct from CoreManagementResourceDefinition? managementResource.registerChild(PathElement.pathElement(ModelDescriptionConstants.SERVICE, ModelDescriptionConstants.MANAGEMENT_OPERATIONS), modelControllerResource); rootResource.registerChild(PathElement.pathElement(ModelDescriptionConstants.CORE_SERVICE, ModelDescriptionConstants.MANAGEMENT), managementResource); rootResource.registerChild(PathElement.pathElement(ModelDescriptionConstants.CORE_SERVICE, ModelDescriptionConstants.SERVICE_CONTAINER), Resource.Factory.create()); rootResource.registerChild(PathElement.pathElement(ModelDescriptionConstants.CORE_SERVICE, ModelDescriptionConstants.MODULE_LOADING), PlaceholderResource.INSTANCE); rootResource.registerChild(PathElement.pathElement(ModelDescriptionConstants.CORE_SERVICE, ModelDescriptionConstants.CAPABILITY_REGISTRY), Resource.Factory.create()); managementResource.registerChild(AccessAuthorizationResourceDefinition.PATH_ELEMENT, AccessAuthorizationResourceDefinition.createResource(authorizer.getWritableAuthorizerConfiguration())); rootResource.registerChild(ServerEnvironmentResourceDescription.RESOURCE_PATH, Resource.Factory.create()); ((PathManagerService)injectedPathManagerService.getValue()).addPathManagerResources(rootResource); VersionModelInitializer.registerRootResource(rootResource, configuration.getServerEnvironment() != null ? configuration.getServerEnvironment().getProductConfig() : null); // Platform MBeans rootResource.registerChild(PlatformMBeanConstants.ROOT_PATH, new RootPlatformMBeanResource()); final RuntimeCapabilityRegistry capabilityRegistry = managementModel.getCapabilityRegistry(); capabilityRegistry.registerCapability( new RuntimeCapabilityRegistration(PATH_MANAGER_CAPABILITY, CapabilityScope.GLOBAL, new RegistrationPoint(PathAddress.EMPTY_ADDRESS, null))); capabilityRegistry.registerCapability( new RuntimeCapabilityRegistration(EXECUTOR_CAPABILITY, CapabilityScope.GLOBAL, new RegistrationPoint(PathAddress.EMPTY_ADDRESS, null))); capabilityRegistry.registerCapability( new RuntimeCapabilityRegistration(SUSPEND_CONTROLLER_CAPABILITY, CapabilityScope.GLOBAL, new RegistrationPoint(PathAddress.EMPTY_ADDRESS, null))); // Record the core capabilities with the root MRR so reads of it will show it as their provider // This also gets them recorded as 'possible capabilities' in the capability registry ManagementResourceRegistration rootRegistration = managementModel.getRootResourceRegistration(); rootRegistration.registerCapability(PATH_MANAGER_CAPABILITY); rootRegistration.registerCapability(EXECUTOR_CAPABILITY); rootRegistration.registerCapability(SUSPEND_CONTROLLER_CAPABILITY); }