org.jboss.as.controller.registry.Resource.getChild()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(7.3k)|赞(0)|评价(0)|浏览(121)

本文整理了Java中org.jboss.as.controller.registry.Resource.getChild方法的一些代码示例,展示了Resource.getChild的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Resource.getChild方法的具体详情如下:
包路径:org.jboss.as.controller.registry.Resource
类名称:Resource
方法名:getChild

Resource.getChild介绍

[英]Get a single child of this resource with the given address. If no such child exists this will return null.
[中]获取具有给定地址的此资源的单个子级。如果不存在这样的子级,则返回null。

代码示例

代码示例来源:origin: wildfly/wildfly

/**
 * @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);
}

代码示例来源:origin: org.wildfly.core/wildfly-controller

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;
}
/**

代码示例来源:origin: wildfly/wildfly

@Override
public Resource getChild(PathElement element) {
  return delegate.getChild(element);
}

代码示例来源:origin: wildfly/wildfly

@Override
public Resource getChild(PathElement element) {
  return delegate.getChild(element);
}

代码示例来源:origin: wildfly/wildfly

@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);
}

代码示例来源:origin: wildfly/wildfly

@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);
}

代码示例来源:origin: wildfly/wildfly

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);
  }
}

代码示例来源:origin: wildfly/wildfly

@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);
  };
}

代码示例来源:origin: wildfly/wildfly

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);
    }
  }
}

代码示例来源:origin: wildfly/wildfly

ModelNode ssoModel = resource.getChild(UndertowExtension.PATH_SSO).getModel();

代码示例来源:origin: wildfly/wildfly

deploymentResource.registerChild(SUBSYSTEM_PATH_ELEMENT, subsystemResource);
} else {
  subsystemResource = deploymentResource.getChild(SUBSYSTEM_PATH_ELEMENT);

代码示例来源:origin: wildfly/wildfly-core

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;
  }
}

代码示例来源:origin: org.wildfly.core/wildfly-controller

@Override
public Resource getChild(PathElement element) {
  Resource resource = delegate.getChild(element);
  if (resource != null) {
    return new ProtectedModelResource<Resource>(resource);
  }
  return null;
}

代码示例来源:origin: org.jboss.as/jboss-as-controller

@Override
public Resource getChild(PathElement element) {
  Resource resource = delegate.getChild(element);
  if (resource != null) {
    return new ProtectedModelResource(resource);
  }
  return null;
}

代码示例来源:origin: org.jboss.as/jboss-as-osgi-service

@Override
public Resource getChild(PathElement element) {
  if (ModelConstants.BUNDLE.equals(element.getKey()))
    return hasBundle(element) ? OSGiBundleResource.INSTANCE : null;
  else
    return delegate.getChild(element);
}

代码示例来源:origin: org.jboss.as/jboss-as-host-controller

@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());
    }
  }
}

代码示例来源:origin: org.wildfly/wildfly-undertow

@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);
}

代码示例来源:origin: org.jboss.eap/wildfly-undertow

@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);
}

代码示例来源:origin: org.wildfly/wildfly-messaging-activemq

@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);
  }
}

代码示例来源:origin: wildfly/wildfly-core

@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);
}

相关文章