Package org.jboss.as.controller.descriptions

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


    void validateOperation(final ModelNode operation) {
        if (operation == null) {
            return;
        }
        final DescriptionProvider provider = getDescriptionProvider(operation);
        final ModelNode description = provider.getModelDescription(null);

        final Map<String, ModelNode> describedProperties = getDescribedRequestProperties(description);
        final Map<String, ModelNode> actualParams = getActualRequestProperties(operation);

        checkActualOperationParamsAreDescribed(description, operation, describedProperties, actualParams);
View Full Code Here


        Assert.assertNotNull("Null operation name", name);
        Assert.assertTrue("Empty operation name " + name, name.trim().length() > 0);

        final PathAddress addr = PathAddress.pathAddress(operation.get(OP_ADDR));

        final DescriptionProvider provider = root.getOperationDescription(addr, name);
        Assert.assertNotNull("No operation called '" + name + "' for " + addr, provider);
        return provider;
    }
View Full Code Here

     * @param resourceRegistration the resource. Cannot be {@code null}
     * @return the description provider. Will not be {@code null}
     */
    @Override
    public DescriptionProvider getDescriptionProvider(ImmutableManagementResourceRegistration resourceRegistration) {
        return new DescriptionProvider() {
            @Override
            public ModelNode getModelDescription(Locale locale) {
                return description;
            }
        };
View Full Code Here

     * @param resourceRegistration the resource. Cannot be {@code null}
     * @return the description provider. Will not be {@code null}
     */
    @Override
    public DescriptionProvider getDescriptionProvider(ImmutableManagementResourceRegistration resourceRegistration) {
        return new DescriptionProvider() {
            @Override
            public ModelNode getModelDescription(Locale locale) {
                return description;
            }
        };
View Full Code Here

            return;
        }
        if (entry.getOperationHandler() == null) {
            throwOrWarnAboutDescriptorProblem(MESSAGES.noOperationHandler(name, address));
        }
        final DescriptionProvider provider = getDescriptionProvider(operation);
        final ModelNode description = provider.getModelDescription(null);

        final Map<String, ModelNode> describedProperties = getDescribedRequestProperties(operation, description);
        final Map<String, ModelNode> actualParams = getActualRequestProperties(operation);

        checkActualOperationParamsAreDescribed(description, operation, describedProperties, actualParams);
View Full Code Here

            throw MESSAGES.validationFailedOperationHasANullOrEmptyName(formatOperationForMessage(operation));
        }

        final PathAddress addr = getPathAddress(operation);

        final DescriptionProvider provider = root.getOperationDescription(addr, name);
        if (provider == null) {
            throw MESSAGES.validationFailedNoOperationFound(name, addr, formatOperationForMessage(operation));
        }
        return provider;
    }
View Full Code Here

            }
        }

        if (defaults) {
            //get the model description
            final DescriptionProvider descriptionProvider = registry.getModelDescription(PathAddress.EMPTY_ADDRESS);
            final Locale locale = GlobalOperationHandlers.getLocale(context, operation);
            final ModelNode nodeDescription = descriptionProvider.getModelDescription(locale);

            if (nodeDescription.isDefined() && nodeDescription.hasDefined(ATTRIBUTES)) {
                for (String key : nodeDescription.get(ATTRIBUTES).keys()) {
                    if ((!childrenByType.containsKey(key)) &&
                            (!directAttributes.containsKey(key) || !directAttributes.get(key).isDefined()) &&
View Full Code Here

        public TransformersSubRegistration registerModelTransformers(ModelVersionRange version, CombinedTransformer combinedTransformer) {
            return transformerRegistry.registerSubsystemTransformers(name, version, combinedTransformer, combinedTransformer);
        }

        private ManagementResourceRegistration getDummyRegistration() {
            return ManagementResourceRegistration.Factory.create(new DescriptionProvider() {
                @Override
                public ModelNode getModelDescription(Locale locale) {
                    return new ModelNode();
                }
            });
View Full Code Here

            // no context.completeStep() here as that's the read handler's job
        }
    }

    private ModelNode getNodeDescription(ImmutableManagementResourceRegistration registry, OperationContext context, ModelNode operation) throws OperationFailedException {
        final DescriptionProvider descriptionProvider = registry.getModelDescription(PathAddress.EMPTY_ADDRESS);
        final Locale locale = GlobalOperationHandlers.getLocale(context, operation);
        return descriptionProvider.getModelDescription(locale);
    }
View Full Code Here

        final ImmutableManagementResourceRegistration registry = context.getResourceRegistration();

        AliasEntry aliasEntry = registry.getAliasEntry();
        final ImmutableManagementResourceRegistration realRegistry = aliasEntry == null ? registry : context.getRootResourceRegistration().getSubModel(aliasEntry.convertToTargetAddress(PathAddress.pathAddress(opAddr)));

        final DescriptionProvider descriptionProvider = realRegistry.getModelDescription(PathAddress.EMPTY_ADDRESS);
        final Locale locale = GlobalOperationHandlers.getLocale(context, operation);

        final ModelNode nodeDescription = descriptionProvider.getModelDescription(locale);
        final Map<String, ModelNode> operations = new HashMap<String, ModelNode>();
        final Map<PathElement, ModelNode> childResources = recursive ? new HashMap<PathElement, ModelNode>() : Collections.<PathElement, ModelNode>emptyMap();

        // We're going to add a bunch of steps that should immediately follow this one. We are going to add them
        // in reverse order of how they should execute, as that is the way adding a Stage.IMMEDIATE step works

        // Last to execute is the handler that assembles the overall response from the pieces created by all the other steps
        final ReadResourceDescriptionAssemblyHandler assemblyHandler = new ReadResourceDescriptionAssemblyHandler(nodeDescription, operations, childResources);
        context.addStep(assemblyHandler, OperationContext.Stage.IMMEDIATE);

        if (ops) {
            for (final Map.Entry<String, OperationEntry> entry : realRegistry.getOperationDescriptions(PathAddress.EMPTY_ADDRESS, inheritedOps).entrySet()) {
                if (entry.getValue().getType() == OperationEntry.EntryType.PUBLIC) {
                    if (context.getProcessType() != ProcessType.DOMAIN_SERVER || entry.getValue().getFlags().contains(OperationEntry.Flag.RUNTIME_ONLY)) {
                        final DescriptionProvider provider = entry.getValue().getDescriptionProvider();
                        operations.put(entry.getKey(), provider.getModelDescription(locale));
                    }
                }
            }
        }
        if (nodeDescription.hasDefined(ATTRIBUTES)) {
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.