Package org.jboss.as.controller.descriptions

Examples of org.jboss.as.controller.descriptions.DescriptionProvider


                    mainModel.get("profile", "profileA").get(NAME).set("Profile A");

                    AbstractControllerTestBase.createModel(context, mainModel);
                    context.completeStep();
                }
            }, new DescriptionProvider() {
                @Override
                public ModelNode getModelDescription(Locale locale) {
                    return new ModelNode();
                }
            }, false, OperationEntry.EntryType.PRIVATE);

            rootRegistration.registerSubModel(PathElement.pathElement("profile", "*"), new DescriptionProvider() {

                @Override
                public ModelNode getModelDescription(Locale locale) {
                    ModelNode node = new ModelNode();
                    node.get(DESCRIPTION).set("A server child");
View Full Code Here


    public class ProxyModelControllerService extends AbstractControllerService {

        ProxyModelControllerService(final ServiceContainer serviceContainer, final ControlledProcessState processState) {
            super(ProcessType.EMBEDDED_SERVER, new RunningModeControl(RunningMode.NORMAL), new NullConfigurationPersister(), processState,
                    new DescriptionProvider() {
                @Override
                public ModelNode getModelDescription(Locale locale) {
                    ModelNode node = new ModelNode();
                    node.get(DESCRIPTION).set("A server");
                    node.get(CHILDREN, "serverchild", DESCRIPTION).set("A list of children");
View Full Code Here

                        @Override
                        public void execute(OperationContext context, ModelNode operation) {
                            context.completeStep();
                        }
                    },
                    new DescriptionProvider() {

                        @Override
                        public ModelNode getModelDescription(Locale locale) {
                            ModelNode node = new ModelNode();
                            node.get(OPERATION_NAME).set("Test");
                            return node;
                        }
                    },
                    true);


            rootRegistration.registerOperationHandler("setup", new OperationStepHandler() {
                @Override
                public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
                    ModelNode proxyModel = new ModelNode();
                    proxyModel.get("serverchild", "svrA", "name").set("serverA");
                    proxyModel.get("serverchild", "svrA", "child", "childA", "name").set("childName");
                    proxyModel.get("serverchild", "svrA", "child", "childA", "value").set("childValue");

                    AbstractControllerTestBase.createModel(context, proxyModel);
                    context.completeStep();
                }
            }, new DescriptionProvider() {
                @Override
                public ModelNode getModelDescription(Locale locale) {
                    return new ModelNode();
                }
            }, false, OperationEntry.EntryType.PRIVATE);

            ManagementResourceRegistration serverReg = rootRegistration.registerSubModel(PathElement.pathElement("serverchild", "*"), new DescriptionProvider() {

                @Override
                public ModelNode getModelDescription(Locale locale) {
                    ModelNode node = new ModelNode();
                    node.get(DESCRIPTION).set("A server child");
                    node.get(ATTRIBUTES, NAME, TYPE).set(ModelType.STRING);
                    node.get(ATTRIBUTES, NAME, DESCRIPTION).set("The name of the server child");
                    node.get(ATTRIBUTES, NAME, REQUIRED).set(true);
                    node.get(ATTRIBUTES, NAME, MIN_LENGTH).set(1);
                    node.get(CHILDREN, "child", DESCRIPTION).set("The children of the server child");
                    node.get(CHILDREN, "child", MIN_OCCURS).set(1);
                    node.get(CHILDREN, "child", MODEL_DESCRIPTION);
                    return node;
                }
            });

            ManagementResourceRegistration serverChildReg = serverReg.registerSubModel(PathElement.pathElement("child", "*"), new DescriptionProvider() {

                @Override
                public ModelNode getModelDescription(Locale locale) {
                    ModelNode node = new ModelNode();
                    node.get(DESCRIPTION).set("A named set of children");
                    node.get(ATTRIBUTES, NAME, TYPE).set(ModelType.STRING);
                    node.get(ATTRIBUTES, NAME, DESCRIPTION).set("The name of the child");
                    node.get(ATTRIBUTES, NAME, REQUIRED).set(true);
                    node.get(ATTRIBUTES, NAME, MIN_LENGTH).set(1);
                    node.get(ATTRIBUTES, VALUE, TYPE).set(ModelType.STRING);
                    node.get(ATTRIBUTES, VALUE, DESCRIPTION).set("The value of the child");
                    node.get(ATTRIBUTES, VALUE, REQUIRED).set(true);
                    node.get(ATTRIBUTES, VALUE, MIN_LENGTH).set(1);
                    return node;
                }
            });
            serverChildReg.registerReadWriteAttribute("value", null, new WriteAttributeHandlers.ModelTypeValidatingHandler(ModelType.STRING), AttributeAccess.Storage.CONFIGURATION);
            serverChildReg.registerMetric("metric", GlobalOperationsTestCase.TestMetricHandler.INSTANCE);

            serverChildReg.registerOperationHandler("test-op",
                    new OperationStepHandler() {
                        @Override
                        public void execute(OperationContext context, ModelNode operation) {
                            return;
                        }
                    },
                    new DescriptionProvider() {
                        @Override
                        public ModelNode getModelDescription(Locale locale) {
                            ModelNode node = new ModelNode();
                            node.get(OPERATION_NAME).set("test-op");
                            node.get(REQUEST_PROPERTIES).setEmptyObject();
View Full Code Here

        return descriptionResolver;
    }

    protected void registerAddOperation(final ManagementResourceRegistration registration, final OperationStepHandler handler,
                                        OperationEntry.Flag... flags) {
        DescriptionProvider provider = handler instanceof DescriptionProvider
                ? (DescriptionProvider) handler
                : new DefaultResourceAddDescriptionProvider(registration, descriptionResolver);
        registration.registerOperationHandler(ModelDescriptionConstants.ADD, handler, provider, getFlagsSet(flags));
    }
View Full Code Here

        registration.registerOperationHandler(ModelDescriptionConstants.ADD, handler, provider, getFlagsSet(flags));
    }

    protected void registerRemoveOperation(final ManagementResourceRegistration registration, final OperationStepHandler handler,
                                        OperationEntry.Flag... flags) {
        DescriptionProvider provider = handler instanceof DescriptionProvider
                ? (DescriptionProvider) handler
                : new DefaultResourceRemoveDescriptionProvider(descriptionResolver);
        registration.registerOperationHandler(ModelDescriptionConstants.REMOVE, handler, provider, getFlagsSet(flags));
    }
View Full Code Here

                                for (ConnectionManager cm : deploymentMD.getConnectionManagers())  {
                                if(cm.getPool() != null) {
                                    StatisticsPlugin poolStats = cm.getPool().getStatistics();

                                if (poolStats.getNames().size() != 0) {
                                    DescriptionProvider statsResourceDescriptionProvider = new StatisticsDescriptionProvider(ResourceAdaptersSubsystemProviders.RESOURCE_NAME, "statistics", poolStats);
                                    PathElement pe = PathElement.pathElement(ModelDescriptionConstants.SUBSYSTEM, ResourceAdaptersExtension.SUBSYSTEM_NAME);
                                    PathElement peCD = PathElement.pathElement(Constants.CONNECTIONDEFINITIONS_NAME, cm.getJndiName());
                                    ManagementResourceRegistration overrideRegistration = registration;
                                    //when you are in deploy you have a registration pointing to deployment=*
                                    //when you are in re-deploy it points to specific deploymentUnit
View Full Code Here

                                for (ConnectionManager cm : deploymentMD.getConnectionManagers())  {
                                                                if(cm.getPool() != null) {
                                                                    StatisticsPlugin poolStats = cm.getPool().getStatistics();

                                if (poolStats.getNames().size() != 0) {
                                    DescriptionProvider statsResourceDescriptionProvider = new StatisticsDescriptionProvider(ResourceAdaptersSubsystemProviders.RESOURCE_NAME, "statistics", poolStats);
                                    PathElement pe = PathElement.pathElement(ModelDescriptionConstants.SUBSYSTEM, ResourceAdaptersExtension.SUBSYSTEM_NAME);
                                    PathElement peCD = PathElement.pathElement(Constants.CONNECTIONDEFINITIONS_NAME, cm.getJndiName());

                                    ManagementResourceRegistration overrideRegistration = registration;
                                    //when you are in deploy you have a registration pointing to deployment=*
 
View Full Code Here

        // none
    }

    @Override
    public DescriptionProvider getAliasDescriptionProvider(ImmutableManagementResourceRegistration resourceRegistration, PathElement alias) {
        DescriptionProvider delegate = new DefaultResourceDescriptionProvider(resourceRegistration, standardResourceDescriptionResolver);
        return new AliasedResourceDescriptionProvider(alias, delegate);
    }
View Full Code Here

    }

    protected void registerAddOperation(final ManagementResourceRegistration registration, final OperationStepHandler handler,
                                        OperationEntry.Flag... flags) {
        DescriptionProvider provider = new DefaultResourceAddDescriptionProvider(registration, getResourceDescriptionResolver()) {
            @Override
            public ModelNode getModelDescription(Locale locale) {
                // "name" is not an operation parameter
                final ModelNode result = super.getModelDescription(locale);
                if (result.get(ModelDescriptionConstants.REQUEST_PROPERTIES).hasDefined(NAME.getName())) {
View Full Code Here

        */
    }

    protected void registerAddOperation(final ManagementResourceRegistration registration, final OperationStepHandler handler,
                                        OperationEntry.Flag... flags) {
        DescriptionProvider provider = new DefaultResourceAddDescriptionProvider(registration, getResourceDescriptionResolver()) {
            @Override
            public ModelNode getModelDescription(Locale locale) {
                // "name" is not an operation parameter
                final ModelNode result = super.getModelDescription(locale);
                if (result.get(ModelDescriptionConstants.REQUEST_PROPERTIES).hasDefined(NAME.getName())) {
View Full Code Here

TOP

Related Classes of org.jboss.as.controller.descriptions.DescriptionProvider

Copyright © 2018 www.massapicom. 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.