javax.management.AttributeChangeNotification.getOldValue()方法的使用及代码示例

x33g5p2x  于11个月前 转载在 其他  
字(7.5k)|赞(0)|评价(0)|浏览(31)

本文整理了Java中javax.management.AttributeChangeNotification.getOldValue()方法的一些代码示例,展示了AttributeChangeNotification.getOldValue()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AttributeChangeNotification.getOldValue()方法的具体详情如下:
包路径:javax.management.AttributeChangeNotification
类名称:AttributeChangeNotification
方法名:getOldValue

AttributeChangeNotification.getOldValue介绍

暂无

代码示例

代码示例来源:origin: groovy/groovy-core

private static Map buildAttributeNotificationPacket(AttributeChangeNotification note) {
    Map<String, Object> result = new HashMap<String, Object>();
    result.put("oldValue", note.getOldValue());
    result.put("newValue", note.getNewValue());
    result.put("attribute", note.getAttributeName());
    result.put("attributeType", note.getAttributeType());
    result.put("sequenceNumber", note.getSequenceNumber());
    result.put("timeStamp", note.getTimeStamp());
    return result;
  }
}

代码示例来源:origin: mercyblitz/segmentfault-lessons

/**
 * 处理通知/事件
 *
 * @param notification
 * @param handback
 */
@Override
public void handleNotification(Notification notification, Object handback) {
  AttributeChangeNotification attributeChangeNotification = (AttributeChangeNotification) notification;
  String oldData = (String) attributeChangeNotification.getOldValue();
  String newData = (String) attributeChangeNotification.getNewValue();
  System.out.printf("The notification of data's attribute  - old data : %s , new data : %s \n", oldData, newData);
}

代码示例来源:origin: org.codehaus.groovy/groovy-jdk14

private static Map buildAttributeNotificationPacket(AttributeChangeNotification note) {
    Map<String, Object> result = new HashMap<String, Object>();
    result.put("oldValue", note.getOldValue());
    result.put("newValue", note.getNewValue());
    result.put("attribute", note.getAttributeName());
    result.put("attributeType", note.getAttributeType());
    result.put("sequenceNumber", note.getSequenceNumber());
    result.put("timeStamp", note.getTimeStamp());
    return result;
  }
}

代码示例来源:origin: org.kohsuke.droovy/groovy

private static Map buildAttributeNotificationPacket(AttributeChangeNotification note) {
    Map<String, Object> result = new HashMap<String, Object>();
    result.put("oldValue", note.getOldValue());
    result.put("newValue", note.getNewValue());
    result.put("attribute", note.getAttributeName());
    result.put("attributeType", note.getAttributeType());
    result.put("sequenceNumber", note.getSequenceNumber());
    result.put("timeStamp", note.getTimeStamp());
    return result;
  }
}

代码示例来源:origin: org.codehaus.groovy/groovy-jmx

private static Map buildAttributeNotificationPacket(AttributeChangeNotification note) {
    Map<String, Object> result = new HashMap<String, Object>();
    result.put("oldValue", note.getOldValue());
    result.put("newValue", note.getNewValue());
    result.put("attribute", note.getAttributeName());
    result.put("attributeType", note.getAttributeType());
    result.put("sequenceNumber", note.getSequenceNumber());
    result.put("timeStamp", note.getTimeStamp());
    return result;
  }
}

代码示例来源:origin: com.thinkaurelius.groovy-shaded-asm/groovy-shaded-asm

private static Map buildAttributeNotificationPacket(AttributeChangeNotification note) {
    Map<String, Object> result = new HashMap<String, Object>();
    result.put("oldValue", note.getOldValue());
    result.put("newValue", note.getNewValue());
    result.put("attribute", note.getAttributeName());
    result.put("attributeType", note.getAttributeType());
    result.put("sequenceNumber", note.getSequenceNumber());
    result.put("timeStamp", note.getTimeStamp());
    return result;
  }
}

代码示例来源:origin: com.github.nyla-solutions/nyla.solutions.core

public void handleNotification(Notification notification,
                  Object handback) {
    System.out.println("\nReceived notification:");
    System.out.println("\tClassName: " + notification.getClass().getName());
    System.out.println("\tSource: " + notification.getSource());
    System.out.println("\tType: " + notification.getType());
    System.out.println("\tMessage: " + notification.getMessage());
    if (notification instanceof AttributeChangeNotification) {
      AttributeChangeNotification acn =
        (AttributeChangeNotification) notification;
      System.out.println("\tAttributeName: " + acn.getAttributeName());
      System.out.println("\tAttributeType: " + acn.getAttributeType());
      System.out.println("\tNewValue: " + acn.getNewValue());
      System.out.println("\tOldValue: " + acn.getOldValue());
    }
  }
}

代码示例来源:origin: io.takari.nexus/nexus-perf

public Agent(final JMXServiceURL jmxServiceURL) {
 this.jmxServiceURL = jmxServiceURL;
 try {
  log.info("Connecting to {}...", jmxServiceURL);
  JMXConnector connector = JMXConnectorFactory.connect(jmxServiceURL, null);
  connection = connector.getMBeanServerConnection();
  ObjectName controlBeanName = new ObjectName(PerformanceTestMBean.class.getPackage().getName(), "name", "control");
  controlBean = JMX.newMBeanProxy(connection, controlBeanName, PerformanceTestMBean.class, false);
  connection.addNotificationListener(controlBeanName, (notification, handback) -> {
   if (notification instanceof AttributeChangeNotification) {
    AttributeChangeNotification acn = (AttributeChangeNotification) notification;
    if ("running".equals(acn.getAttributeName())
      && Boolean.FALSE.equals(acn.getNewValue()) && Boolean.TRUE.equals(acn.getOldValue())) {
     if (finishSignal != null) {
      finishSignal.countDown();
     }
    }
   }
  }, null, null);
 }
 catch (Exception e) {
  log.debug("Could not connect to {}: {}", jmxServiceURL, e.toString());
  throw Throwables.propagate(e);
 }
}

代码示例来源:origin: net.open-esb.core/manage

mLogger.log(Level.FINE, "run time log level change notifictaion for {0} from {1} to {2}", new Object[]{mLogger.getName(), notif.getOldValue(), notif.getNewValue()});

代码示例来源:origin: org.glassfish.common/amx-core

public String stringify(Object o)
{
  final AttributeChangeNotification notif = (AttributeChangeNotification) o;
  final StringBuffer b = super._stringify(notif);
  append(b, "");
  final String attrName = notif.getAttributeName();
  final String oldValue = SmartStringifier.toString(notif.getOldValue());
  final String newValue = SmartStringifier.toString(notif.getNewValue());
  final String msg = attrName + ": " + oldValue + " => " + newValue;
  b.append(msg);
  return (b.toString());
}

代码示例来源:origin: org.glassfish.main.common/amx-core

public String stringify(Object o)
{
  final AttributeChangeNotification notif = (AttributeChangeNotification) o;
  final StringBuffer b = super._stringify(notif);
  append(b, "");
  final String attrName = notif.getAttributeName();
  final String oldValue = SmartStringifier.toString(notif.getOldValue());
  final String newValue = SmartStringifier.toString(notif.getNewValue());
  final String msg = attrName + ": " + oldValue + " => " + newValue;
  b.append(msg);
  return (b.toString());
}

代码示例来源:origin: org.glassfish.common/amx-core

a.getAttributeName(),
a.getAttributeType(),
a.getOldValue(),
a.getNewValue());

代码示例来源:origin: org.glassfish.main.common/amx-core

a.getAttributeName(),
a.getAttributeType(),
a.getOldValue(),
a.getNewValue());

代码示例来源:origin: org.jboss.jbossas/jboss-as-jmx-remoting

fireStateChange(new MBeanLocator(server, obj), ((Integer) ch.getOldValue()).intValue(), ((Integer) ch.getNewValue()).intValue());
return;

代码示例来源:origin: org.apache.camel/camel-jmx

.withAttributeType(ac.getAttributeType())
      .withNewValue(ac.getNewValue() == null ? null : String.valueOf(ac.getNewValue()))
      .withOldValue(ac.getOldValue() == null ? null : String.valueOf(ac.getOldValue()));
} else if (aNotification instanceof JMXConnectionNotification) {
  jaxb = mObjectFactory.createJMXConnectionNotification()

相关文章