@Override public ModelNode getModelDescription(Locale locale) { // Don't try to read from the cache, as the cached description may have used the wrong locale ModelNode result = delegate.getModelDescription(locale); resourceDescriptions.put(cacheAddress, result); return result; } }
/** * * @param locale the locale to use to generate any localized text used in the description. * May be {@code null}, in which case {@link Locale#getDefault()} should be used * * @return definition of operation * @deprecated use {@link #DEFINITION} for registration of operation */ @Override public ModelNode getModelDescription(Locale locale) { // This is a private operation, so we should not be getting requests for descriptions return DEFINITION.getDescriptionProvider().getModelDescription(locale); } }
/** * * @param locale the locale to use to generate any localized text used in the description. * May be {@code null}, in which case {@link Locale#getDefault()} should be used * * @return definition of operation * @deprecated use {@link #DEFINITION} for registration of operation */ @Override public ModelNode getModelDescription(Locale locale) { // This is a private operation, so we should not be getting requests for descriptions return DEFINITION.getDescriptionProvider().getModelDescription(locale); } }
/** * * @param locale the locale to use to generate any localized text used in the description. * May be {@code null}, in which case {@link Locale#getDefault()} should be used * * @return definition of operation * @deprecated use {@link #DEFINITION} for registration of operation */ @Override public ModelNode getModelDescription(Locale locale) { // This is a private operation, so we should not be getting requests for descriptions return DEFINITION.getDescriptionProvider().getModelDescription(locale); } }
/** * * @param locale the locale to use to generate any localized text used in the description. * May be {@code null}, in which case {@link Locale#getDefault()} should be used * * @return definition of operation * @deprecated use {@link #DEFINITION} for registration of operation */ @Override public ModelNode getModelDescription(Locale locale) { // This is a private operation, so we should not be getting requests for descriptions return DEFINITION.getDescriptionProvider().getModelDescription(locale); } }
@Override public ModelNode getModelDescription(Locale locale) { ModelNode result = mainDescriptionProvider.getModelDescription(locale); ModelNode attrs = result.get(ModelDescriptionConstants.ATTRIBUTES); for (Map.Entry<String, ModelNode> entry : overrideDescriptionProvider.getAttributeOverrideDescriptions(locale).entrySet()) { attrs.get(entry.getKey()).set(entry.getValue()); } ModelNode children = result.get(ModelDescriptionConstants.CHILDREN); for (Map.Entry<String, ModelNode> entry : overrideDescriptionProvider.getChildTypeOverrideDescriptions(locale).entrySet()) { children.get(entry.getKey()).set(entry.getValue()); } return result; } }
@Override public ModelNode getModelDescription(Locale locale) { ModelNode result = mainDescriptionProvider.getModelDescription(locale); ModelNode attrs = result.get(ModelDescriptionConstants.ATTRIBUTES); for (Map.Entry<String, ModelNode> entry : overrideDescriptionProvider.getAttributeOverrideDescriptions(locale).entrySet()) { attrs.get(entry.getKey()).set(entry.getValue()); } ModelNode children = result.get(ModelDescriptionConstants.CHILDREN); for (Map.Entry<String, ModelNode> entry : overrideDescriptionProvider.getChildTypeOverrideDescriptions(locale).entrySet()) { children.get(entry.getKey()).set(entry.getValue()); } return result; } }
@Override public ModelNode getModelDescription(Locale locale) { ModelNode result = mainDescriptionProvider.getModelDescription(locale); ModelNode attrs = result.get(ModelDescriptionConstants.ATTRIBUTES); for (Map.Entry<String, ModelNode> entry : overrideDescriptionProvider.getAttributeOverrideDescriptions(locale).entrySet()) { attrs.get(entry.getKey()).set(entry.getValue()); } ModelNode children = result.get(ModelDescriptionConstants.ATTRIBUTES); for (Map.Entry<String, ModelNode> entry : overrideDescriptionProvider.getChildTypeOverrideDescriptions(locale).entrySet()) { children.get(entry.getKey()).set(entry.getValue()); } return result; } }
@Override public ModelNode getModelDescription(Locale locale) { ModelNode result = mainDescriptionProvider.getModelDescription(locale); ModelNode attrs = result.get(ModelDescriptionConstants.ATTRIBUTES); for (Map.Entry<String, ModelNode> entry : overrideDescriptionProvider.getAttributeOverrideDescriptions(locale).entrySet()) { attrs.get(entry.getKey()).set(entry.getValue()); } ModelNode children = result.get(ModelDescriptionConstants.CHILDREN); for (Map.Entry<String, ModelNode> entry : overrideDescriptionProvider.getChildTypeOverrideDescriptions(locale).entrySet()) { children.get(entry.getKey()).set(entry.getValue()); } return result; } }
private MBeanInfoFactory(final ObjectName name, final TypeConverters converters, final ConfiguredDomains configuredDomains, final boolean standalone, final PathAddress address, final ImmutableManagementResourceRegistration resourceRegistration) { this.name = name; this.converters = converters; this.configuredDomains = configuredDomains; this.standalone = standalone; this.legacy = configuredDomains.isLegacyDomain(name); this.resourceRegistration = resourceRegistration; DescriptionProvider provider = resourceRegistration.getModelDescription(PathAddress.EMPTY_ADDRESS); providedDescription = provider != null ? provider.getModelDescription(null) : new ModelNode(); this.pathAddress = address; }
private MBeanInfoFactory(final ObjectName name, final TypeConverters converters, final ConfiguredDomains configuredDomains, final MutabilityChecker mutabilityChecker, final PathAddress address, final ImmutableManagementResourceRegistration resourceRegistration) { this.name = name; this.converters = converters; this.configuredDomains = configuredDomains; this.mutabilityChecker = mutabilityChecker; this.legacy = configuredDomains.isLegacyDomain(name); this.resourceRegistration = resourceRegistration; DescriptionProvider provider = resourceRegistration.getModelDescription(PathAddress.EMPTY_ADDRESS); providedDescription = provider != null ? provider.getModelDescription(null) : new ModelNode(); this.pathAddress = address; }
private MBeanInfoFactory(final ObjectName name, final TypeConverters converters, final ConfiguredDomains configuredDomains, final boolean standalone, final PathAddress address, final ImmutableManagementResourceRegistration resourceRegistration) { this.name = name; this.converters = converters; this.configuredDomains = configuredDomains; this.standalone = standalone; this.legacy = configuredDomains.isLegacyDomain(name); this.resourceRegistration = resourceRegistration; DescriptionProvider provider = resourceRegistration.getModelDescription(PathAddress.EMPTY_ADDRESS); providedDescription = provider != null ? provider.getModelDescription(null) : new ModelNode(); this.pathAddress = address; }
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); }
DescribedOp(OperationEntry operationEntry, Locale locale) { this.description = operationEntry.getDescriptionProvider().getModelDescription(locale); this.flags = operationEntry.getFlags(); }
DescribedOp(OperationEntry operationEntry, Locale locale) { this.description = operationEntry.getDescriptionProvider().getModelDescription(locale); this.flags = operationEntry.getFlags(); }
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); }
public static ModelNode readFullModelDescription(PathAddress address, ImmutableManagementResourceRegistration reg) { ModelNode node = new ModelNode(); node.get(ModelDescriptionConstants.MODEL_DESCRIPTION).set(reg.getModelDescription(PathAddress.EMPTY_ADDRESS).getModelDescription(Locale.getDefault())); node.get(ModelDescriptionConstants.ADDRESS).set(address.toModelNode()); for (PathElement pe : reg.getChildAddresses(PathAddress.EMPTY_ADDRESS)) { ModelNode children = node.get(ModelDescriptionConstants.CHILDREN); ImmutableManagementResourceRegistration sub = reg.getSubModel(PathAddress.pathAddress(pe)); children.add(readFullModelDescription(address.append(pe), sub)); } return node; }
private MBeanNotificationInfo[] getNotifications() { List<MBeanNotificationInfo> notifications = new ArrayList<>(); for (Map.Entry<String, NotificationEntry> entry : resourceRegistration.getNotificationDescriptions(PathAddress.EMPTY_ADDRESS, true).entrySet()) { ModelNode descriptionModel = entry.getValue().getDescriptionProvider().getModelDescription(null); String description = descriptionModel.get(DESCRIPTION).asString(); String notificationType = entry.getKey(); MBeanNotificationInfo info = null; if (notificationType.equals(ModelDescriptionConstants.ATTRIBUTE_VALUE_WRITTEN_NOTIFICATION)) { info = new MBeanNotificationInfo(new String[]{AttributeChangeNotification.ATTRIBUTE_CHANGE}, AttributeChangeNotification.class.getName(), description); } else if (notificationType.equals(ModelDescriptionConstants.RESOURCE_ADDED_NOTIFICATION) || notificationType.equals(ModelDescriptionConstants.RESOURCE_REMOVED_NOTIFICATION)) { // do not expose these notifications as they are emitted by the JMImplementation:type=MBeanServerDelegate MBean. } else { info = new MBeanNotificationInfo(new String[]{notificationType}, Notification.class.getName(), description); } if (info != null) { notifications.add(info); } } return notifications.toArray(new MBeanNotificationInfo[notifications.size()]); }
public static ModelNode readFullModelDescription(PathAddress address, ImmutableManagementResourceRegistration reg) { ModelNode node = new ModelNode(); node.get(ModelDescriptionConstants.MODEL_DESCRIPTION).set(reg.getModelDescription(PathAddress.EMPTY_ADDRESS).getModelDescription(Locale.getDefault())); node.get(ModelDescriptionConstants.ADDRESS).set(address.toModelNode()); for (PathElement pe : reg.getChildAddresses(PathAddress.EMPTY_ADDRESS)) { ModelNode children = node.get(ModelDescriptionConstants.CHILDREN); ImmutableManagementResourceRegistration sub = reg.getSubModel(PathAddress.pathAddress(pe)); children.add(readFullModelDescription(address.append(pe), sub)); } return node; }
private MBeanNotificationInfo[] getNotifications() { List<MBeanNotificationInfo> notifications = new ArrayList<>(); for (Map.Entry<String, NotificationEntry> entry : resourceRegistration.getNotificationDescriptions(PathAddress.EMPTY_ADDRESS, true).entrySet()) { ModelNode descriptionModel = entry.getValue().getDescriptionProvider().getModelDescription(null); String description = descriptionModel.get(DESCRIPTION).asString(); String notificationType = entry.getKey(); MBeanNotificationInfo info = null; if (notificationType.equals(ModelDescriptionConstants.ATTRIBUTE_VALUE_WRITTEN_NOTIFICATION)) { info = new MBeanNotificationInfo(new String[]{AttributeChangeNotification.ATTRIBUTE_CHANGE}, AttributeChangeNotification.class.getName(), description); } else if (notificationType.equals(ModelDescriptionConstants.RESOURCE_ADDED_NOTIFICATION) || notificationType.equals(ModelDescriptionConstants.RESOURCE_REMOVED_NOTIFICATION)) { // do not expose these notifications as they are emitted by the JMImplementation:type=MBeanServerDelegate MBean. } else { info = new MBeanNotificationInfo(new String[]{notificationType}, Notification.class.getName(), description); } if (info != null) { notifications.add(info); } } return notifications.toArray(new MBeanNotificationInfo[notifications.size()]); }