Package org.jboss.dmr

Examples of org.jboss.dmr.ModelNode.require()


        public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
            final ModelNode model = context.readModel(PathAddress.EMPTY_ADDRESS);
            context.getResult().add(createAddOperation(model.hasDefined(CommonAttributes.SHOW_MODEL) ? model.get(CommonAttributes.SHOW_MODEL).asBoolean() : null));
            if (model.hasDefined(CommonAttributes.SERVER_BINDING)) {
                context.getResult().add(createAddConnectorOperation(model.require(CommonAttributes.SERVER_BINDING).asString(), model.require(CommonAttributes.REGISTRY_BINDING).asString()));
            }
            context.completeStep();
        }

        @Override
View Full Code Here


    protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model, ServiceVerificationHandler verificationHandler, List<ServiceController<?>> newControllers) {
        final PathAddress address = PathAddress.pathAddress(operation.get(OP_ADDR));
        final String name = address.getLastElement().getValue();
        ModelNode transport = operation.get(ModelKeys.TRANSPORT);
        Transport transportConfig = new Transport(transport.require(ModelKeys.TYPE).asString());
        ProtocolStack stackConfig = new ProtocolStack(name, transportConfig);

        ServiceBuilder<ChannelFactory> builder = context.getServiceTarget()
                .addService(ChannelFactoryService.getServiceName(name), new ChannelFactoryService(stackConfig))
                .addDependency(ProtocolDefaultsService.SERVICE_NAME, ProtocolDefaults.class, stackConfig.getDefaultsInjector())
View Full Code Here

            for (ModelNode stack : stacks) {
                writer.writeStartElement(Element.LOGIN_MODULE_STACK.getLocalName());
                List<ModelNode> nodes = stack.asList();
                Iterator<ModelNode> iter = nodes.iterator();
                ModelNode nameNode = iter.next();
                writeAttribute(writer, Attribute.NAME, nameNode.require(NAME));
                while (iter.hasNext()) {
                    ModelNode loginModuleNode = iter.next();
                    List<ModelNode> lms = loginModuleNode.asList();
                    for (ModelNode loginModule : lms) {
                        writer.writeStartElement(Element.LOGIN_MODULE.getLocalName());
View Full Code Here

        //Read the whole model and make sure it looks as expected
        ModelNode model = services.readWholeModel();
        Assert.assertTrue(model.get(SUBSYSTEM).hasDefined(OtherServicesSubsystemExtension.SUBSYSTEM_NAME));

        Assert.assertEquals("testing123", model.require(SYSTEM_PROPERTY).require("test123").require(VALUE).asString());
    }

    /**
     * Test that socket binding got added properly
     */
 
View Full Code Here

        //Read the whole model and make sure it looks as expected
        ModelNode model = services.readWholeModel();
        Assert.assertTrue(model.get(SUBSYSTEM).hasDefined(OtherServicesSubsystemExtension.SUBSYSTEM_NAME));

        ModelNode iface = model.require(INTERFACE).require(ControllerInitializer.INTERFACE_NAME);
        Assert.assertEquals("127.0.0.1", iface.require(INET_ADDRESS).asString());

        ModelNode group = model.require(SOCKET_BINDING_GROUP).require(ControllerInitializer.SOCKET_BINDING_GROUP_NAME);
        Assert.assertEquals(ControllerInitializer.INTERFACE_NAME, group.require(DEFAULT_INTERFACE).asString());
        Assert.assertEquals(ControllerInitializer.SOCKET_BINDING_GROUP_NAME, group.require(NAME).asString());
        Assert.assertEquals(0, group.require(PORT_OFFSET).asInt());
View Full Code Here

        ModelNode iface = model.require(INTERFACE).require(ControllerInitializer.INTERFACE_NAME);
        Assert.assertEquals("127.0.0.1", iface.require(INET_ADDRESS).asString());

        ModelNode group = model.require(SOCKET_BINDING_GROUP).require(ControllerInitializer.SOCKET_BINDING_GROUP_NAME);
        Assert.assertEquals(ControllerInitializer.INTERFACE_NAME, group.require(DEFAULT_INTERFACE).asString());
        Assert.assertEquals(ControllerInitializer.SOCKET_BINDING_GROUP_NAME, group.require(NAME).asString());
        Assert.assertEquals(0, group.require(PORT_OFFSET).asInt());

        ModelNode bindings = group.require(SOCKET_BINDING);
        Assert.assertEquals(3, bindings.asList().size());
View Full Code Here

        ModelNode iface = model.require(INTERFACE).require(ControllerInitializer.INTERFACE_NAME);
        Assert.assertEquals("127.0.0.1", iface.require(INET_ADDRESS).asString());

        ModelNode group = model.require(SOCKET_BINDING_GROUP).require(ControllerInitializer.SOCKET_BINDING_GROUP_NAME);
        Assert.assertEquals(ControllerInitializer.INTERFACE_NAME, group.require(DEFAULT_INTERFACE).asString());
        Assert.assertEquals(ControllerInitializer.SOCKET_BINDING_GROUP_NAME, group.require(NAME).asString());
        Assert.assertEquals(0, group.require(PORT_OFFSET).asInt());

        ModelNode bindings = group.require(SOCKET_BINDING);
        Assert.assertEquals(3, bindings.asList().size());
        Assert.assertEquals(123, group.require(SOCKET_BINDING).require("test1").require(PORT).asInt());
View Full Code Here

        Assert.assertEquals("127.0.0.1", iface.require(INET_ADDRESS).asString());

        ModelNode group = model.require(SOCKET_BINDING_GROUP).require(ControllerInitializer.SOCKET_BINDING_GROUP_NAME);
        Assert.assertEquals(ControllerInitializer.INTERFACE_NAME, group.require(DEFAULT_INTERFACE).asString());
        Assert.assertEquals(ControllerInitializer.SOCKET_BINDING_GROUP_NAME, group.require(NAME).asString());
        Assert.assertEquals(0, group.require(PORT_OFFSET).asInt());

        ModelNode bindings = group.require(SOCKET_BINDING);
        Assert.assertEquals(3, bindings.asList().size());
        Assert.assertEquals(123, group.require(SOCKET_BINDING).require("test1").require(PORT).asInt());
        Assert.assertEquals(234, group.require(SOCKET_BINDING).require("test2").require(PORT).asInt());
View Full Code Here

        ModelNode model = services.readWholeModel();
        Assert.assertTrue(model.get(SUBSYSTEM).hasDefined(OtherServicesSubsystemExtension.SUBSYSTEM_NAME));

        ModelNode path = model.require(PATH);
        Assert.assertEquals(2, path.asList().size());
        Assert.assertEquals("p1", path.require("p1").require("name").asString());
        Assert.assertEquals(new File(".").getAbsolutePath(), path.require("p1").require("path").asString());
        Assert.assertFalse(path.get("p1", "relative-to").isDefined());
        Assert.assertEquals("p2", path.require("p2").require("name").asString());
        Assert.assertEquals("target", path.require("p2").require("path").asString());
        Assert.assertEquals("p1", path.require("p2").require("relative-to").asString());
View Full Code Here

        Assert.assertTrue(model.get(SUBSYSTEM).hasDefined(OtherServicesSubsystemExtension.SUBSYSTEM_NAME));

        ModelNode path = model.require(PATH);
        Assert.assertEquals(2, path.asList().size());
        Assert.assertEquals("p1", path.require("p1").require("name").asString());
        Assert.assertEquals(new File(".").getAbsolutePath(), path.require("p1").require("path").asString());
        Assert.assertFalse(path.get("p1", "relative-to").isDefined());
        Assert.assertEquals("p2", path.require("p2").require("name").asString());
        Assert.assertEquals("target", path.require("p2").require("path").asString());
        Assert.assertEquals("p1", path.require("p2").require("relative-to").asString());
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.