@Override protected void executeWriteAttribute(OperationContext context, ModelNode operation) throws OperationFailedException { // Shouldn't happen; the global handler should reject throw unknownAttribute(operation); }
@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.OPERATING_SYSTEM_READ_ATTRIBUTES.contains(name) || PlatformMBeanConstants.OPERATING_SYSTEM_METRICS.contains(name)) { storeResult(name, context.getResult()); } else { // Shouldn't happen; the global handler should reject throw unknownAttribute(operation); } } catch (SecurityException e) { throw new OperationFailedException(new ModelNode().set(e.toString())); } }
final ModelNode store = result.get(attribute); try { OperatingSystemMXBeanAttributeHandler.storeResult(attribute, store); } catch (SecurityException ignored) { final ModelNode store = result.get(attribute); try { OperatingSystemMXBeanAttributeHandler.storeResult(attribute, store); } catch (SecurityException ignored) { OperatingSystemMXBeanAttributeHandler.storeResult(PlatformMBeanConstants.OBJECT_NAME, store);
OperatingSystemMXBeanAttributeHandler.INSTANCE.register(opSys);
@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)) || OperatingSystemResourceDefinition.OPERATING_SYSTEM_READ_ATTRIBUTES.contains(name) || OperatingSystemResourceDefinition.OPERATING_SYSTEM_METRICS.contains(name)) { storeResult(name, context.getResult()); } else { // Shouldn't happen; the global handler should reject throw unknownAttribute(operation); } } catch (SecurityException e) { throw new OperationFailedException(e.toString()); } }
final ModelNode store = result.get(attribute); try { OperatingSystemMXBeanAttributeHandler.storeResult(attribute, store); } catch (SecurityException ignored) { final ModelNode store = result.get(attribute); try { OperatingSystemMXBeanAttributeHandler.storeResult(attribute, store); } catch (SecurityException ignored) { OperatingSystemMXBeanAttributeHandler.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 ((PlatformMBeanConstants.OBJECT_NAME.getName().equals(name)) || OperatingSystemResourceDefinition.OPERATING_SYSTEM_READ_ATTRIBUTES.contains(name) || OperatingSystemResourceDefinition.OPERATING_SYSTEM_METRICS.contains(name)) { storeResult(name, context.getResult()); } else { // Shouldn't happen; the global handler should reject throw unknownAttribute(operation); } } catch (SecurityException e) { throw new OperationFailedException(e.toString()); } }
@Override protected void executeWriteAttribute(OperationContext context, ModelNode operation) throws OperationFailedException { // Shouldn't happen; the global handler should reject throw unknownAttribute(operation); }
final ModelNode store = result.get(attribute); try { OperatingSystemMXBeanAttributeHandler.storeResult(attribute, store); } catch (SecurityException ignored) { final ModelNode store = result.get(attribute); try { OperatingSystemMXBeanAttributeHandler.storeResult(attribute, store); } catch (SecurityException ignored) { OperatingSystemMXBeanAttributeHandler.storeResult(PlatformMBeanConstants.OBJECT_NAME.getName(), store);
@Override protected void executeWriteAttribute(OperationContext context, ModelNode operation) throws OperationFailedException { // Shouldn't happen; the global handler should reject throw unknownAttribute(operation); }