Tabnine Logo
Notification.getUserData
Code IndexAdd Tabnine to your IDE (free)

How to use
getUserData
method
in
javax.management.Notification

Best Java code snippets using javax.management.Notification.getUserData (Showing top 20 results out of 855)

origin: log4j/log4j

public
void handleNotification(Notification notification, Object handback) {
 cat.debug("Received notification: "+notification.getType());
 registerAppenderMBean((Appender) notification.getUserData() );
}
origin: aragozin/jvm-tools

  @Override
  public void handleNotification(Notification notification, Object handback) {
    try {
      GcTracker tracker = (GcTracker) handback;
      CompositeData cdata = (CompositeData) notification.getUserData();
      CompositeData gcInfo = (CompositeData) cdata.get("gcInfo");
      tracker.processGcEvent(gcInfo);
    } catch (JMException e) {
      // ignore
    } catch (IOException e) {
      // ignore
    }
  }
}
origin: groovy/groovy-core

  private static Map buildOperationNotificationPacket(Notification note) {
    Map<String, Object> result = new HashMap<String, Object>();
    result.put("event", note.getType());
    result.put("source", note.getSource());
    result.put("sequenceNumber", note.getSequenceNumber());
    result.put("timeStamp", note.getTimeStamp());
    result.put("data", note.getUserData());
    return result;
  }
}
origin: btraceio/btrace

String notifType = notif.getType();
if (notifType.equals(MemoryNotificationInfo.MEMORY_THRESHOLD_EXCEEDED)) {
  CompositeData cd = (CompositeData) notif.getUserData();
  final MemoryNotificationInfo info = MemoryNotificationInfo.from(cd);
  String name = info.getPoolName();
origin: apache/geode

public static void handleNotification(SystemMemberJmx member, Notification notification,
  Object hb) {
 if (RefreshNotificationType.SYSTEM_MEMBER_CONFIG.getType().equals(notification.getType())
   && ((ManagedResource) member).getMBeanName().equals(notification.getUserData())) {
origin: apache/geode

 && getMBeanName().equals(notification.getUserData())
 && !adminDSJmx.isRmiClientCountZero()) {
try {
origin: Graylog2/graylog2-server

  @Override
  public void handleNotification(javax.management.Notification notification, Object handback) {
    if (GarbageCollectionNotificationInfo.GARBAGE_COLLECTION_NOTIFICATION.equals(notification.getType())) {
      final GcInfo gcInfo = GarbageCollectionNotificationInfo.from((CompositeData) notification.getUserData()).getGcInfo();
      final Duration duration = Duration.milliseconds(gcInfo.getDuration());
      if (duration.compareTo(gcWarningThreshold) > 0) {
        LOG.warn("Last GC run with {} took longer than {} (last duration={})",
            gc.getName(), gcWarningThreshold, duration);
        final Notification systemNotification = notificationService.buildNow()
            .addNode(nodeId.toString())
            .addTimestamp(Tools.nowUTC())
            .addSeverity(Notification.Severity.URGENT)
            .addType(Notification.Type.GC_TOO_LONG)
            .addDetail("gc_name", gc.getName())
            .addDetail("gc_duration_ms", duration.toMilliseconds())
            .addDetail("gc_threshold_ms", gcWarningThreshold.toMilliseconds())
            .addDetail("gc_collection_count", gc.getCollectionCount())
            .addDetail("gc_collection_time", gc.getCollectionTime());
        if (!notificationService.publishIfFirst(systemNotification)) {
          LOG.debug("Couldn't publish notification: {}", notification);
        }
      }
    }
  }
};
origin: apache/log4j

public
void handleNotification(Notification notification, Object handback) {
 cat.debug("Received notification: "+notification.getType());
 registerAppenderMBean((Appender) notification.getUserData() );
}
origin: prometheus/client_java

@Override
public synchronized void handleNotification(Notification notification, Object handback) {
 GarbageCollectionNotificationInfo info = GarbageCollectionNotificationInfo.from((CompositeData) notification.getUserData());
 GcInfo gcInfo = info.getGcInfo();
 Map<String, MemoryUsage> memoryUsageBeforeGc = gcInfo.getMemoryUsageBeforeGc();
 Map<String, MemoryUsage> memoryUsageAfterGc = gcInfo.getMemoryUsageAfterGc();
 for (Map.Entry<String, MemoryUsage> entry : memoryUsageBeforeGc.entrySet()) {
  String memoryPool = entry.getKey();
  long before = entry.getValue().getUsed();
  long after = memoryUsageAfterGc.get(memoryPool).getUsed();
  handleMemoryPool(memoryPool, before, after);
 }
}
origin: hcoles/pitest

private static void addMemoryWatchDog(final Reporter r) {
 final NotificationListener listener = (notification, handback) -> {
 final String type = notification.getType();
 if (type.equals(MemoryNotificationInfo.MEMORY_THRESHOLD_EXCEEDED)) {
 final CompositeData cd = (CompositeData) notification.getUserData();
 final MemoryNotificationInfo memInfo = MemoryNotificationInfo
   .from(cd);
 CommandLineMessage.report(memInfo.getPoolName()
   + " has exceeded the shutdown threshold : " + memInfo.getCount()
   + " times.\n" + memInfo.getUsage());
 r.done(ExitCode.OUT_OF_MEMORY);
 } else {
 LOG.warning("Unknown notification: " + notification);
 }
 };
 MemoryWatchdog.addWatchDogToAllPools(90, listener);
}
origin: spring-projects/spring-integration

@Test //INT-2275
public void publishStringMessageWithinChain() throws Exception {
  assertNotNull(
      this.beanFactory.getBean(
          "chainWithJmxNotificationPublishing$child."
              + "jmx-notification-publishing-channel-adapter-within-chain.handler",
          MessageHandler.class));
  assertNull(listener.lastNotification);
  Message<?> message = MessageBuilder.withPayload("XYZ")
      .setHeader(JmxHeaders.NOTIFICATION_TYPE, "test.type").build();
  publishingWithinChainChannel.send(message);
  assertNotNull(listener.lastNotification);
  Notification notification = listener.lastNotification;
  assertEquals("XYZ", notification.getMessage());
  assertEquals("test.type", notification.getType());
  assertNull(notification.getUserData());
  Set<ObjectName> names = server
      .queryNames(new ObjectName("*:type=MessageHandler," + "name=\"chainWithJmxNotificationPublishing$child."
          + "jmx-notification-publishing-channel-adapter-within-chain\",*"), null);
  assertEquals(1, names.size());
  names = server
      .queryNames(new ObjectName("*:type=MessageChannel,"
          + "name=org.springframework.integration.test.anon,source=anonymous,*"), null);
  assertEquals(1, names.size());
}
origin: spring-projects/spring-integration

@Test
public void publishUserData() throws Exception {
  assertNull(listener.lastNotification);
  TestData data = new TestData();
  Message<?> message = MessageBuilder.withPayload(data)
      .setHeader(JmxHeaders.NOTIFICATION_TYPE, "test.type").build();
  channel.send(message);
  assertNotNull(listener.lastNotification);
  Notification notification = listener.lastNotification;
  assertNull(notification.getMessage());
  assertEquals(data, notification.getUserData());
  assertEquals("test.type", notification.getType());
}
origin: spring-projects/spring-integration

@Test
public void publishStringMessage() throws Exception {
  adviceCalled = 0;
  assertNull(listener.lastNotification);
  Message<?> message = MessageBuilder.withPayload("XYZ")
      .setHeader(JmxHeaders.NOTIFICATION_TYPE, "test.type").build();
  channel.send(message);
  assertNotNull(listener.lastNotification);
  Notification notification = listener.lastNotification;
  assertEquals("XYZ", notification.getMessage());
  assertEquals("test.type", notification.getType());
  assertNull(notification.getUserData());
  assertEquals(1, adviceCalled);
}
origin: Netflix/spectator

 @Override public void handleNotification(Notification notification, Object ref) {
  final String type = notification.getType();
  if (type.equals(GarbageCollectionNotificationInfo.GARBAGE_COLLECTION_NOTIFICATION)) {
   CompositeData cd = (CompositeData) notification.getUserData();
   GarbageCollectionNotificationInfo info = GarbageCollectionNotificationInfo.from(cd);
   processGcEvent(info);
  }
 }
}
origin: org.apache.activemq/activemq-all

public
void handleNotification(Notification notification, Object handback) {
 cat.debug("Received notification: "+notification.getType());
 registerAppenderMBean((Appender) notification.getUserData() );
}
origin: com.netflix.spectator/spectator-ext-gc

 @Override public void handleNotification(Notification notification, Object ref) {
  final String type = notification.getType();
  if (type.equals(GarbageCollectionNotificationInfo.GARBAGE_COLLECTION_NOTIFICATION)) {
   CompositeData cd = (CompositeData) notification.getUserData();
   GarbageCollectionNotificationInfo info = GarbageCollectionNotificationInfo.from(cd);
   processGcEvent(info);
  }
 }
}
origin: org.codehaus.groovy/groovy-jmx

  private static Map buildOperationNotificationPacket(Notification note) {
    Map<String, Object> result = new HashMap<String, Object>();
    result.put("event", note.getType());
    result.put("source", note.getSource());
    result.put("sequenceNumber", note.getSequenceNumber());
    result.put("timeStamp", note.getTimeStamp());
    result.put("data", note.getUserData());
    return result;
  }
}
origin: org.apache.log4j/com.springsource.org.apache.log4j

public
void handleNotification(Notification notification, Object handback) {
 cat.debug("Received notification: "+notification.getType());
 registerAppenderMBean((Appender) notification.getUserData() );
}
origin: apache-log4j/log4j

public
void handleNotification(Notification notification, Object handback) {
 cat.debug("Received notification: "+notification.getType());
 registerAppenderMBean((Appender) notification.getUserData() );
}
origin: mx4j/mx4j-tools

protected void onSerialize(SerializationContext context, Notification notification) throws IOException
{
 context.serialize(CLASS_NAME_QNAME, null, notification.getType());
 context.serialize(SOURCE_QNAME, null, notification.getSource());
 context.serialize(SEQUENCE_NUMBER_QNAME, null, new Long(notification.getSequenceNumber()));
 context.serialize(TIMESTAMP_QNAME, null, new Long(notification.getTimeStamp()));
 context.serialize(MESSAGE_QNAME, null, notification.getMessage());
 context.serialize(USER_DATA_QNAME, null, notification.getUserData());
}
javax.managementNotificationgetUserData

Popular methods of Notification

  • getType
  • <init>
  • setUserData
  • getMessage
  • getSource
  • getTimeStamp
  • getSequenceNumber
  • setSource
  • toString
  • setSequenceNumber
  • getAttachments
  • getClass
  • getAttachments,
  • getClass,
  • getFlag,
  • getIntent,
  • getTitle,
  • setCreatedd_time,
  • setId,
  • setLatestEventInfo,
  • setLink

Popular in Java

  • Finding current android device location
  • getResourceAsStream (ClassLoader)
  • onRequestPermissionsResult (Fragment)
  • onCreateOptionsMenu (Activity)
  • Menu (java.awt)
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Option (scala)
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now