Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Don't use deprecated api

  • Loading branch information...
commit 938259e994df9e55585fc2faf21b239238d10bbe 1 parent a64e95c
Tomaz Cerar ctomc authored bstansberry committed
9 platform-mbean/src/main/java/org/jboss/as/platform/mbean/RuntimeMXBeanAttributeHandler.java
@@ -29,12 +29,15 @@
29 29 import java.util.Random;
30 30 import java.util.TreeMap;
31 31
  32 +import org.jboss.as.controller.AttributeDefinition;
32 33 import org.jboss.as.controller.OperationContext;
33 34 import org.jboss.as.controller.OperationFailedException;
  35 +import org.jboss.as.controller.SimpleAttributeDefinitionBuilder;
34 36 import org.jboss.as.controller.descriptions.ModelDescriptionConstants;
35 37 import org.jboss.as.controller.registry.AttributeAccess;
36 38 import org.jboss.as.controller.registry.ManagementResourceRegistration;
37 39 import org.jboss.dmr.ModelNode;
  40 +import org.jboss.dmr.ModelType;
38 41
39 42 /**
40 43 * Handles read-attribute and write-attribute for the resource representing {@link java.lang.management.RuntimeMXBean}.
@@ -45,6 +48,10 @@
45 48
46 49 public static RuntimeMXBeanAttributeHandler INSTANCE = new RuntimeMXBeanAttributeHandler();
47 50
  51 + static final AttributeDefinition OBJECT_NAME = SimpleAttributeDefinitionBuilder.create(PlatformMBeanConstants.OBJECT_NAME, ModelType.STRING)
  52 + .setStorageRuntime()
  53 + .build();
  54 +
48 55 private RuntimeMXBeanAttributeHandler() {
49 56
50 57 }
@@ -83,7 +90,7 @@ protected void executeWriteAttribute(OperationContext context, ModelNode operati
83 90 protected void register(ManagementResourceRegistration registration) {
84 91
85 92 if (PlatformMBeanUtil.JVM_MAJOR_VERSION > 6) {
86   - registration.registerReadOnlyAttribute(PlatformMBeanConstants.OBJECT_NAME, this, AttributeAccess.Storage.RUNTIME);
  93 + registration.registerReadOnlyAttribute(OBJECT_NAME, this);
87 94 }
88 95
89 96 for (String attribute : PlatformMBeanConstants.RUNTIME_READ_ATTRIBUTES) {

0 comments on commit 938259e

Please sign in to comment.
Something went wrong with that request. Please try again.