Permalink
Browse files

Don't use deprecated api

  • Loading branch information...
1 parent a64e95c commit 938259e994df9e55585fc2faf21b239238d10bbe @ctomc ctomc committed with bstansberry Jan 4, 2013
View
9 platform-mbean/src/main/java/org/jboss/as/platform/mbean/RuntimeMXBeanAttributeHandler.java
@@ -29,12 +29,15 @@
import java.util.Random;
import java.util.TreeMap;
+import org.jboss.as.controller.AttributeDefinition;
import org.jboss.as.controller.OperationContext;
import org.jboss.as.controller.OperationFailedException;
+import org.jboss.as.controller.SimpleAttributeDefinitionBuilder;
import org.jboss.as.controller.descriptions.ModelDescriptionConstants;
import org.jboss.as.controller.registry.AttributeAccess;
import org.jboss.as.controller.registry.ManagementResourceRegistration;
import org.jboss.dmr.ModelNode;
+import org.jboss.dmr.ModelType;
/**
* Handles read-attribute and write-attribute for the resource representing {@link java.lang.management.RuntimeMXBean}.
@@ -45,6 +48,10 @@
public static RuntimeMXBeanAttributeHandler INSTANCE = new RuntimeMXBeanAttributeHandler();
+ static final AttributeDefinition OBJECT_NAME = SimpleAttributeDefinitionBuilder.create(PlatformMBeanConstants.OBJECT_NAME, ModelType.STRING)
+ .setStorageRuntime()
+ .build();
+
private RuntimeMXBeanAttributeHandler() {
}
@@ -83,7 +90,7 @@ protected void executeWriteAttribute(OperationContext context, ModelNode operati
protected void register(ManagementResourceRegistration registration) {
if (PlatformMBeanUtil.JVM_MAJOR_VERSION > 6) {
- registration.registerReadOnlyAttribute(PlatformMBeanConstants.OBJECT_NAME, this, AttributeAccess.Storage.RUNTIME);
+ registration.registerReadOnlyAttribute(OBJECT_NAME, this);
}
for (String attribute : PlatformMBeanConstants.RUNTIME_READ_ATTRIBUTES) {

0 comments on commit 938259e

Please sign in to comment.