Examples of PathElement


Examples of org.jboss.as.controller.PathElement

    private void getAllChildAddressesForRemove(PathAddress address, List<PathAddress> addresses, Resource resource) {
        List<PathElement> childElements = new ArrayList<PathElement>();
        for (String type : resource.getChildTypes()) {
            for (String childName : resource.getChildrenNames(type)) {
                PathElement element = PathElement.pathElement(type, childName);
                childElements.add(element);
            }
        }

        for (PathElement childElement : childElements) {
View Full Code Here

Examples of org.jboss.as.controller.PathElement

        addOperation.get(ModelDescriptionConstants.OP).asString());
   
    PathAddress address = PathAddress.pathAddress(addOperation.get(ModelDescriptionConstants.OP_ADDR));
    Assert.assertEquals("Wrong path address size", 1, address.size());
   
    PathElement element = address.getElement(0);
    Assert.assertEquals("Wrong address key", ModelDescriptionConstants.SUBSYSTEM, element.getKey());
    Assert.assertEquals("Wrong address value", JdrReportExtension.SUBSYSTEM_NAME, element.getValue());
  }
View Full Code Here

Examples of org.jboss.as.controller.PathElement

            final Resource resource = context.readResourceForUpdate(PathAddress.EMPTY_ADDRESS);
            final ModelNode subModel = resource.getModel();

            // validate the protocol type to be added
            ModelNode type = TYPE.validateOperation(operation);
            PathElement protocolRelativePath = PathElement.pathElement(ModelKeys.PROTOCOL, type.asString());

            // if child resource already exists, throw OFE
            if (resource.hasChild(protocolRelativePath))  {
                throw new OperationFailedException(new ModelNode().set("protocol with relative path " + protocolRelativePath.toString() " is already defined"));
            }

            // now get the created model
            Resource childResource = context.createResource(PathAddress.pathAddress(protocolRelativePath));
            final ModelNode protocol = childResource.getModel();
View Full Code Here

Examples of org.jboss.as.controller.PathElement

            final Resource resource = context.readResourceForUpdate(PathAddress.EMPTY_ADDRESS);
            final ModelNode subModel = resource.getModel();

             // validate the protocol type to be added
            ModelNode type = TYPE.validateOperation(operation);
            PathElement protocolRelativePath = PathElement.pathElement(ModelKeys.PROTOCOL, type.asString());

            // if child resource already exists, throw OFE
            // TODO not sure if this works ex expected - it may only confirm a registered resource
            if (!resource.hasChild(protocolRelativePath))  {
                throw new OperationFailedException(new ModelNode().set("protocol with relative path " + protocolRelativePath.toString() " is not defined"));
            }

            // remove the resource and its children
            context.removeResource(PathAddress.pathAddress(protocolRelativePath));
View Full Code Here

Examples of org.jboss.as.controller.PathElement

        assertTrue(addresses.contains(PathAddress.pathAddress(profileB, proxyB)));
    }

    @Test
    public void testRemoveNonExistantProxyController() {
        PathElement element = PathElement.pathElement("profile", "profileA");
        root.unregisterProxyController(element);
        Set<PathAddress> addresses = getProxyAddresses(PathAddress.EMPTY_ADDRESS);
        assertEquals(4, addresses.size());
        assertTrue(addresses.contains(PathAddress.pathAddress(proxyA)));
        assertTrue(addresses.contains(PathAddress.pathAddress(proxyB)));
View Full Code Here

Examples of org.jboss.as.controller.PathElement

        if (runningModeControl.getRunningMode() == RunningMode.ADMIN_ONLY) {
            throw SlaveRegistrationException.forMasterInAdminOnlyMode(runningModeControl.getRunningMode());
        }
        PathAddress pa = hostControllerClient.getProxyNodeAddress();
        PathElement pe = pa.getElement(0);
        ProxyController existingController = modelNodeRegistration.getProxyController(pa);

        if (existingController != null || hostControllerInfo.getLocalHostName().equals(pe.getValue())){
            throw SlaveRegistrationException.forHostAlreadyExists(pe.getValue());
        }
        modelNodeRegistration.registerProxyController(pe, hostControllerClient);
        hostProxies.put(pe.getValue(), hostControllerClient);
    }
View Full Code Here

Examples of org.jboss.as.controller.PathElement

    }

    @Override
    public void registerRunningServer(ProxyController serverControllerClient) {
        PathAddress pa = serverControllerClient.getProxyNodeAddress();
        PathElement pe = pa.getElement(1);
        if (modelNodeRegistration.getProxyController(pa) != null) {
            throw MESSAGES.serverNameAlreadyRegistered(pe.getValue());
        }
        ROOT_LOGGER.registeringServer(pe.getValue());
        ManagementResourceRegistration hostRegistration = modelNodeRegistration.getSubModel(PathAddress.pathAddress(PathElement.pathElement(HOST)));
        hostRegistration.registerProxyController(pe, serverControllerClient);
        serverProxies.put(pe.getValue(), serverControllerClient);
    }
View Full Code Here

Examples of org.jboss.as.controller.PathElement

    }

    @Override
    public void unregisterRunningServer(String serverName) {
        PathAddress pa = PathAddress.pathAddress(PathElement.pathElement(HOST, hostControllerInfo.getLocalHostName()));
        PathElement pe = PathElement.pathElement(RUNNING_SERVER, serverName);
        ROOT_LOGGER.unregisteringServer(serverName);
        ManagementResourceRegistration hostRegistration = modelNodeRegistration.getSubModel(pa);
        hostRegistration.unregisterProxyController(pe);
        serverProxies.remove(serverName);
    }
View Full Code Here

Examples of org.jboss.as.controller.PathElement

     */
    @Override
    public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {

        final PathAddress address = PathAddress.pathAddress(operation.require(OP_ADDR));
        final PathElement element = address.getLastElement();
        final String serverName = element.getValue();
        final boolean blocking = operation.get("blocking").asBoolean(false);
        context.addStep(new OperationStepHandler() {
            @Override
            public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
                final ServerStatus status = serverInventory.stopServer(serverName, -1, blocking);
View Full Code Here

Examples of org.jboss.as.controller.PathElement

        if (context.getRunningMode() == RunningMode.ADMIN_ONLY) {
            throw new OperationFailedException(new ModelNode(MESSAGES.cannotStartServersInvalidMode(context.getRunningMode())));
        }

        final PathAddress address = PathAddress.pathAddress(operation.require(OP_ADDR));
        final PathElement element = address.getLastElement();
        final String serverName = element.getValue();
        final boolean blocking = operation.get("blocking").asBoolean(false);

        final ModelNode model = Resource.Tools.readModel(context.readResourceFromRoot(PathAddress.EMPTY_ADDRESS, true));
        context.addStep(new OperationStepHandler() {
            @Override
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.