@Override protected void executeWriteAttribute(OperationContext context, ModelNode operation) throws OperationFailedException { // Shouldn't happen; the global handler should reject throw unknownAttribute(operation); } }
@Override protected void executeWriteAttribute(OperationContext context, ModelNode operation) throws OperationFailedException { // Shouldn't happen; the global handler should reject throw unknownAttribute(operation); } }
@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 bpName = PathAddress.pathAddress(operation.require(ModelDescriptionConstants.OP_ADDR)).getLastElement().getValue(); final ObjectName objectName = PlatformMBeanUtil.getObjectNameWithNameKey(PlatformMBeanConstants.BUFFER_POOL_MXBEAN_DOMAIN_TYPE, bpName); if (!ManagementFactory.getPlatformMBeanServer().isRegistered(objectName)) { throw PlatformMBeanLogger.ROOT_LOGGER.unknownBufferPool(bpName); } final String name = operation.require(ModelDescriptionConstants.NAME).asString(); if (PlatformMBeanConstants.OBJECT_NAME.getName().equals(name)) { context.getResult().set(objectName.toString()); } else if (ModelDescriptionConstants.NAME.equals(name)) { context.getResult().set(PlatformMBeanUtil.getMBeanAttribute(objectName, "Name").toString()); } else if (PlatformMBeanConstants.COUNT.equals(name)) { context.getResult().set(Long.class.cast(PlatformMBeanUtil.getMBeanAttribute(objectName, "Count"))); } else if (PlatformMBeanConstants.MEMORY_USED_NAME.equals(name)) { context.getResult().set(Long.class.cast(PlatformMBeanUtil.getMBeanAttribute(objectName, "MemoryUsed"))); } else if (PlatformMBeanConstants.TOTAL_CAPACITY.equals(name)) { context.getResult().set(Long.class.cast(PlatformMBeanUtil.getMBeanAttribute(objectName, "TotalCapacity"))); } else if (BufferPoolResourceDefinition.BUFFER_POOL_METRICS.contains(name)) { // Bug throw PlatformMBeanLogger.ROOT_LOGGER.badReadAttributeImpl(name); } else { // Shouldn't happen; the global handler should reject throw unknownAttribute(operation); } }
@Override protected void executeReadAttribute(OperationContext context, ModelNode operation) throws OperationFailedException { final String bpName = PathAddress.pathAddress(operation.require(ModelDescriptionConstants.OP_ADDR)).getLastElement().getValue(); final ObjectName objectName = PlatformMBeanUtil.getObjectNameWithNameKey(PlatformMBeanConstants.BUFFER_POOL_MXBEAN_DOMAIN_TYPE, bpName); if (!ManagementFactory.getPlatformMBeanServer().isRegistered(objectName)) { throw PlatformMBeanLogger.ROOT_LOGGER.unknownBufferPool(bpName); } final String name = operation.require(ModelDescriptionConstants.NAME).asString(); if (PlatformMBeanConstants.OBJECT_NAME.getName().equals(name)) { context.getResult().set(objectName.toString()); } else if (ModelDescriptionConstants.NAME.equals(name)) { context.getResult().set(PlatformMBeanUtil.getMBeanAttribute(objectName, "Name").toString()); } else if (PlatformMBeanConstants.COUNT.equals(name)) { context.getResult().set(Long.class.cast(PlatformMBeanUtil.getMBeanAttribute(objectName, "Count"))); } else if (PlatformMBeanConstants.MEMORY_USED_NAME.equals(name)) { context.getResult().set(Long.class.cast(PlatformMBeanUtil.getMBeanAttribute(objectName, "MemoryUsed"))); } else if (PlatformMBeanConstants.TOTAL_CAPACITY.equals(name)) { context.getResult().set(Long.class.cast(PlatformMBeanUtil.getMBeanAttribute(objectName, "TotalCapacity"))); } else if (BufferPoolResourceDefinition.BUFFER_POOL_METRICS.contains(name)) { // Bug throw PlatformMBeanLogger.ROOT_LOGGER.badReadAttributeImpl(name); } else { // Shouldn't happen; the global handler should reject throw unknownAttribute(operation); } }
@Override protected void executeReadAttribute(OperationContext context, ModelNode operation) throws OperationFailedException { final String bpName = PathAddress.pathAddress(operation.require(ModelDescriptionConstants.OP_ADDR)).getLastElement().getValue(); final ObjectName objectName = PlatformMBeanUtil.getObjectNameWithNameKey(PlatformMBeanConstants.BUFFER_POOL_MXBEAN_DOMAIN_TYPE, bpName); if (!ManagementFactory.getPlatformMBeanServer().isRegistered(objectName)) { throw PlatformMBeanMessages.MESSAGES.unknownBufferPool(bpName); } final String name = operation.require(ModelDescriptionConstants.NAME).asString(); if (PlatformMBeanConstants.OBJECT_NAME.equals(name)) { context.getResult().set(objectName.toString()); } else if (ModelDescriptionConstants.NAME.equals(name)) { context.getResult().set(PlatformMBeanUtil.getMBeanAttribute(objectName, "Name").toString()); } else if (PlatformMBeanConstants.COUNT.equals(name)) { context.getResult().set(Long.class.cast(PlatformMBeanUtil.getMBeanAttribute(objectName, "Count"))); } else if (PlatformMBeanConstants.MEMORY_USED.equals(name)) { context.getResult().set(Long.class.cast(PlatformMBeanUtil.getMBeanAttribute(objectName, "MemoryUsed"))); } else if (PlatformMBeanConstants.TOTAL_CAPACITY.equals(name)) { context.getResult().set(Long.class.cast(PlatformMBeanUtil.getMBeanAttribute(objectName, "TotalCapacity"))); } else if (PlatformMBeanConstants.BUFFER_POOL_METRICS.contains(name)) { // Bug throw PlatformMBeanMessages.MESSAGES.badReadAttributeImpl1(name); } else { // Shouldn't happen; the global handler should reject throw unknownAttribute(operation); } }