final ModelNode store = result.get(attribute); try { CompilationMXBeanAttributeHandler.storeResult(attribute, store); } catch (UnsupportedOperationException ignored) { final ModelNode store = result.get(attribute); try { CompilationMXBeanAttributeHandler.storeResult(attribute, store); } catch (UnsupportedOperationException ignored) { CompilationMXBeanAttributeHandler.storeResult(PlatformMBeanConstants.OBJECT_NAME, store);
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { final ModelNode result = context.getResult(); for (String attribute : CompilationResourceDefinition.COMPILATION_READ_ATTRIBUTES) { final ModelNode store = result.get(attribute); try { CompilationMXBeanAttributeHandler.storeResult(attribute, store); } catch (UnsupportedOperationException ignored) { // just leave it undefined } } for (String attribute : CompilationResourceDefinition.COMPILATION_METRICS) { final ModelNode store = result.get(attribute); try { CompilationMXBeanAttributeHandler.storeResult(attribute, store); } catch (UnsupportedOperationException ignored) { // just leave it undefined } } final ModelNode store = result.get(PlatformMBeanConstants.OBJECT_NAME.getName()); CompilationMXBeanAttributeHandler.storeResult(PlatformMBeanConstants.OBJECT_NAME.getName(), store); } }
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { final ModelNode result = context.getResult(); for (String attribute : CompilationResourceDefinition.COMPILATION_READ_ATTRIBUTES) { final ModelNode store = result.get(attribute); try { CompilationMXBeanAttributeHandler.storeResult(attribute, store); } catch (UnsupportedOperationException ignored) { // just leave it undefined } } for (String attribute : CompilationResourceDefinition.COMPILATION_METRICS) { final ModelNode store = result.get(attribute); try { CompilationMXBeanAttributeHandler.storeResult(attribute, store); } catch (UnsupportedOperationException ignored) { // just leave it undefined } } final ModelNode store = result.get(PlatformMBeanConstants.OBJECT_NAME.getName()); CompilationMXBeanAttributeHandler.storeResult(PlatformMBeanConstants.OBJECT_NAME.getName(), store); } }
@Override protected void executeReadAttribute(OperationContext context, ModelNode operation) throws OperationFailedException { final String name = operation.require(ModelDescriptionConstants.NAME).asString(); try { if ((PlatformMBeanUtil.JVM_MAJOR_VERSION > 6 && PlatformMBeanConstants.OBJECT_NAME.equals(name)) || PlatformMBeanConstants.COMPILATION_READ_ATTRIBUTES.contains(name) || PlatformMBeanConstants.COMPILATION_METRICS.contains(name)) { storeResult(name, context.getResult()); } else { // Shouldn't happen; the global handler should reject throw unknownAttribute(operation); } } catch (UnsupportedOperationException e) { throw new OperationFailedException(new ModelNode().set(e.toString())); } }
@Override protected void executeReadAttribute(OperationContext context, ModelNode operation) throws OperationFailedException { final String name = operation.require(ModelDescriptionConstants.NAME).asString(); try { if ((PlatformMBeanConstants.OBJECT_NAME.getName().equals(name)) || COMPILATION_READ_ATTRIBUTES.contains(name) || COMPILATION_METRICS.contains(name)) { storeResult(name, context.getResult()); } else { // Shouldn't happen; the global handler should reject throw unknownAttribute(operation); } } catch (UnsupportedOperationException e) { throw new OperationFailedException(e.toString()); } }
@Override protected void executeReadAttribute(OperationContext context, ModelNode operation) throws OperationFailedException { final String name = operation.require(ModelDescriptionConstants.NAME).asString(); try { if ((PlatformMBeanConstants.OBJECT_NAME.getName().equals(name)) || COMPILATION_READ_ATTRIBUTES.contains(name) || COMPILATION_METRICS.contains(name)) { storeResult(name, context.getResult()); } else { // Shouldn't happen; the global handler should reject throw unknownAttribute(operation); } } catch (UnsupportedOperationException e) { throw new OperationFailedException(e.toString()); } }