/** * @param element * @return * @see org.jboss.as.controller.registry.Resource#getChild(org.jboss.as.controller.PathElement) */ public Resource getChild(PathElement element) { return delegate.getChild(element); }
private boolean hasSubsystemsRegistered(Resource rootResource, String subsystem, boolean dcExtension) { if (!dcExtension) { return rootResource.getChild(PathElement.pathElement(ModelDescriptionConstants.SUBSYSTEM, subsystem)) != null; } for (Resource profile : rootResource.getChildren(PROFILE)) { if (profile.getChild(PathElement.pathElement(ModelDescriptionConstants.SUBSYSTEM, subsystem)) != null) { return true; } } return false; } /**
@Override public Resource getChild(PathElement element) { return delegate.getChild(element); }
@Override public Resource getChild(PathElement element) { return delegate.getChild(element); }
@Override public Resource getChild(final PathElement element) { if (BatchJobExecutionResourceDefinition.EXECUTION.equals(element.getKey())) { if (hasJobExecution(element.getValue())) { return PlaceholderResource.INSTANCE; } return null; } return delegate.getChild(element); }
@Override public Resource getChild(final PathElement element) { if (BALANCER.equals(element.getKey())) { if (getChildrenNames(BALANCER).contains(element.getValue())) { return new ModClusterBalancerResource(element.getValue(), name); } return null; } return delegate.getChild(element); }
public void execute(Resource parentResource, AS7MetadataRepository mdr, String name) { // Get the iron-jacamar resource final IronJacamarResource ironJacamarResource = new IronJacamarResource(); // Replace the current model with an updated one final Resource storeModel = getIronJacamarResource(mdr, name); ironJacamarResource.update(storeModel); PathElement ijPe = PathElement.pathElement(Constants.IRONJACAMAR_NAME, Constants.IRONJACAMAR_NAME); if (parentResource.getChild(ijPe) == null) { parentResource.registerChild(ijPe, ironJacamarResource); } }
@Override public AttributeValueTranslator getReadTranslator() { return (context, value) -> { String poolName = value.asString(); PathAddress address = context.getCurrentAddress(); PathAddress rootAddress = address.subAddress(0, address.size() - 4); PathAddress subsystemAddress = rootAddress.append(PathElement.pathElement(ModelDescriptionConstants.SUBSYSTEM, "datasources")); Resource subsystem = context.readResourceFromRoot(subsystemAddress); for (String type : Arrays.asList("data-source", "xa-data-source")) { Resource resource = subsystem.getChild(PathElement.pathElement(type, poolName)); if (resource != null) { return resource.getModel().get("jndi-name"); } } throw InfinispanLogger.ROOT_LOGGER.dataSourceNotFound(poolName); }; }
private void uninstallManagementResource(final InstalledComponent component, DeploymentUnit deploymentUnit) { component.getType().getRuntimeHandler().unregisterComponent(component.getAddress()); // Deregister possible /service=timer-service Resource root = deploymentUnit.getAttachment(DEPLOYMENT_RESOURCE); Resource subResource = root.getChild(component.getAddress().getParent().getLastElement()); if (subResource != null) { Resource componentResource = subResource.getChild(component.getAddress().getLastElement()); if (componentResource != null) { componentResource.removeChild(EJB3SubsystemModel.TIMER_SERVICE_PATH); } } }
ModelNode ssoModel = resource.getChild(UndertowExtension.PATH_SSO).getModel();
deploymentResource.registerChild(SUBSYSTEM_PATH_ELEMENT, subsystemResource); } else { subsystemResource = deploymentResource.getChild(SUBSYSTEM_PATH_ELEMENT);
private boolean lookForResource(final Resource root, final PathAddress pathAddress) { Resource current = root; for (PathElement element : pathAddress) { current = current.getChild(element); if (current == null) { return false; } } return true; } }
@Override public Resource getChild(PathElement element) { Resource resource = delegate.getChild(element); if (resource != null) { return new ProtectedModelResource<Resource>(resource); } return null; }
@Override public Resource getChild(PathElement element) { Resource resource = delegate.getChild(element); if (resource != null) { return new ProtectedModelResource(resource); } return null; }
@Override public Resource getChild(PathElement element) { if (ModelConstants.BUNDLE.equals(element.getKey())) return hasBundle(element) ? OSGiBundleResource.INSTANCE : null; else return delegate.getChild(element); }
@Override protected void validateReferencedNewValueExists(OperationContext context, ModelNode resolvedValue) throws OperationFailedException{ final Resource root = context.readResourceFromRoot(PathAddress.EMPTY_ADDRESS, false); //Don't do this on boot since the domain model is not populated yet if (!context.isBooting() && root.getChild(PathElement.pathElement(SOCKET_BINDING_GROUP, resolvedValue.asString())) == null) { throw HostControllerMessages.MESSAGES.noSocketBindingGroupCalled(resolvedValue.asString()); } } }
@Override public Resource getChild(final PathElement element) { if (BALANCER.equals(element.getKey())) { if (getChildrenNames(BALANCER).contains(element.getValue())) { return new ModClusterBalancerResource(element.getValue(), name); } return null; } return delegate.getChild(element); }
@Override public Resource getChild(final PathElement element) { if (BALANCER.equals(element.getKey())) { if (getChildrenNames(BALANCER).contains(element.getValue())) { return new ModClusterBalancerResource(element.getValue(), name); } return null; } return delegate.getChild(element); }
@Override public Resource getChild(PathElement element) { if (CORE_ADDRESS.equals(element.getKey())) { return hasAddressControl(element) ? new CoreAddressResource(element.getValue(), getManagementService()) : null; } else if (RUNTIME_QUEUE.equals(element.getKey())) { return hasQueueControl(element.getValue()) ? PlaceholderResource.INSTANCE : null; } else { return delegate.getChild(element); } }
@Override public void initializeHost(final ServiceTarget serviceTarget, final ManagementModel managementModel, String hostName) { final PathElement host = PathElement.pathElement(HOST, hostName); final ManagementResourceRegistration hostRegistration = managementModel.getRootResourceRegistration().getSubModel(PathAddress.EMPTY_ADDRESS.append(host)); final Resource hostResource = managementModel.getRootResource().getChild(host); if (hostResource == null) { // this is generally only the case when an embedded HC has been started with an empty config, but /host=foo:add() has not yet been invoked, so we have no // real hostname yet. return; } initializeCoreServices(serviceTarget, hostRegistration, hostResource); }