Examples of ImmutableManagementResourceRegistration


Examples of org.jboss.as.controller.registry.ImmutableManagementResourceRegistration

        }
        return list;
    }

    private Object getAttribute(final ResourceAndRegistration reg, final PathAddress address, final ObjectName name, final String attributethrows ReflectionException, AttributeNotFoundException, InstanceNotFoundException {
        final ImmutableManagementResourceRegistration registration = getMBeanRegistration(address, reg);
        final DescriptionProvider provider = registration.getModelDescription(PathAddress.EMPTY_ADDRESS);
        if (provider == null) {
            throw MESSAGES.descriptionProviderNotFound(address);
        }
        final ModelNode description = provider.getModelDescription(null);
        final String attributeName = findAttributeName(description.get(ATTRIBUTES), attribute);
View Full Code Here

Examples of org.jboss.as.controller.registry.ImmutableManagementResourceRegistration

        return attributes;
    }

    private void setAttribute(final ResourceAndRegistration reg, final PathAddress address, final ObjectName name, final Attribute attributethrows InvalidAttributeValueException, AttributeNotFoundException, InstanceNotFoundException {
        final ImmutableManagementResourceRegistration registration = getMBeanRegistration(address, reg);
        final DescriptionProvider provider = registration.getModelDescription(PathAddress.EMPTY_ADDRESS);
        if (provider == null) {
            throw MESSAGES.descriptionProviderNotFound(address);
        }
        final ModelNode description = provider.getModelDescription(null);
        final String attributeName = findAttributeName(description.get(ATTRIBUTES), attribute.getName());
View Full Code Here

Examples of org.jboss.as.controller.registry.ImmutableManagementResourceRegistration

        final ResourceAndRegistration reg = getRootResourceAndRegistration();
        PathAddress address = ObjectNameAddressUtil.resolvePathAddress(reg.getResource(), name);
        if (address == null) {
            throw createInstanceNotFoundException(name);
        }
        final ImmutableManagementResourceRegistration registration = getMBeanRegistration(address, reg);

        String realOperationName = null;
        OperationEntry opEntry = registration.getOperationEntry(PathAddress.EMPTY_ADDRESS, operationName);

        if (opEntry != null) {
            realOperationName = operationName;
        } else {
            Map<String, OperationEntry> ops = registration.getOperationDescriptions(PathAddress.EMPTY_ADDRESS, false);
            for (Map.Entry<String, OperationEntry> entry : ops.entrySet()) {
                if (operationName.equals(NameConverter.convertToCamelCase(entry.getKey()))) {
                    opEntry = entry.getValue();
                    realOperationName = entry.getKey();
                    break;
View Full Code Here

Examples of org.jboss.as.controller.registry.ImmutableManagementResourceRegistration

        return controller.execute(op, null, OperationTransactionControl.COMMIT, null);
    }

    private ImmutableManagementResourceRegistration getMBeanRegistration(PathAddress address, ResourceAndRegistration reg) throws InstanceNotFoundException {
        //TODO Populate MBeanInfo
        ImmutableManagementResourceRegistration resourceRegistration = reg.getRegistration().getSubModel(address);
        if (resourceRegistration == null) {
            throw MESSAGES.registrationNotFound(address);
        }
        return resourceRegistration;
    }
View Full Code Here

Examples of org.jboss.as.controller.registry.ImmutableManagementResourceRegistration

class ChildAddOperationFinder {

    static Map<PathElement, ChildAddOperationEntry> findAddChildOperations(ImmutableManagementResourceRegistration resourceRegistration){
        Map<PathElement, ChildAddOperationEntry> operations = new HashMap<PathElement, ChildAddOperationEntry>();
        for(PathElement childElement : resourceRegistration.getChildAddresses(PathAddress.EMPTY_ADDRESS)) {
            final ImmutableManagementResourceRegistration childReg = resourceRegistration.getSubModel(PathAddress.pathAddress(childElement));
            final Map<String, OperationEntry> registeredOps = childReg.getOperationDescriptions(PathAddress.EMPTY_ADDRESS, false);
            final OperationEntry childAdd = registeredOps.get(ADD);
            if (childAdd != null) {
                operations.put(childElement, new ChildAddOperationEntry(childAdd, childElement));
            }
        }
View Full Code Here

Examples of org.jboss.as.controller.registry.ImmutableManagementResourceRegistration

        return operations;
    }

    static ChildAddOperationEntry findAddChildOperation(ImmutableManagementResourceRegistration resourceRegistration, String addName){
        for(PathElement childElement : resourceRegistration.getChildAddresses(PathAddress.EMPTY_ADDRESS)) {
            final ImmutableManagementResourceRegistration childReg = resourceRegistration.getSubModel(PathAddress.pathAddress(childElement));
            final Map<String, OperationEntry> registeredOps = childReg.getOperationDescriptions(PathAddress.EMPTY_ADDRESS, false);
            final OperationEntry childAdd = registeredOps.get(ADD);
            if (childAdd != null) {
                if (NameConverter.createValidAddOperationName(childElement).equals(addName)) {
                    return new ChildAddOperationEntry(childAdd, childElement);
                }
View Full Code Here

Examples of org.jboss.as.controller.registry.ImmutableManagementResourceRegistration

        return primaryContext.isResourceServiceRestartAllowed();
    }

    @Override
    public ImmutableManagementResourceRegistration getResourceRegistration() {
        ImmutableManagementResourceRegistration parent = primaryContext.getResourceRegistration();
        return  parent.getSubModel(activeStep.address);
    }
View Full Code Here

Examples of org.jboss.as.controller.registry.ImmutableManagementResourceRegistration

        assert isControllingThread();
        Stage currentStage = this.currentStage;
        if (currentStage == null || currentStage == Stage.DONE) {
            throw MESSAGES.operationAlreadyComplete();
        }
        ImmutableManagementResourceRegistration delegate = modelController.getRootRegistration().getSubModel(address);
        return delegate == null ? null : new DelegatingImmutableManagementResourceRegistration(delegate);
    }
View Full Code Here

Examples of org.jboss.as.controller.registry.ImmutableManagementResourceRegistration

        return delegate == null ? null : new DelegatingImmutableManagementResourceRegistration(delegate);
    }

    @Override
    public ImmutableManagementResourceRegistration getRootResourceRegistration() {
        ImmutableManagementResourceRegistration delegate = modelController.getRootRegistration();
        return delegate == null ? null : new DelegatingImmutableManagementResourceRegistration(delegate);
    }
View Full Code Here

Examples of org.jboss.as.controller.registry.ImmutableManagementResourceRegistration

    private static class DescribeHandler implements OperationStepHandler {

        /** {@inheritDoc} */
        public void execute(OperationContext context, ModelNode operation) {

            final ImmutableManagementResourceRegistration registry = context.getResourceRegistration();
            final PathAddress address = PathAddress.pathAddress(operation.require(OP_ADDR));
            final DescriptionProvider descriptionProvider = registry.getModelDescription(address);
            if(descriptionProvider == null) {
                context.getFailureDescription().set(new ModelNode());
            } else {
                context.getResult().set(descriptionProvider.getModelDescription(null));
            }
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.