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

How to use
setSource
method
in
javax.management.Notification

Best Java code snippets using javax.management.Notification.setSource (Showing top 17 results out of 315)

origin: spring-projects/spring-framework

/**
 * Replaces the notification source if necessary to do so.
 * From the {@link Notification javadoc}:
 * <i>"It is strongly recommended that notification senders use the object name
 * rather than a reference to the MBean object as the source."</i>
 * @param notification the {@link Notification} whose
 * {@link javax.management.Notification#getSource()} might need massaging
 */
private void replaceNotificationSourceIfNecessary(Notification notification) {
  if (notification.getSource() == null || notification.getSource().equals(this.managedResource)) {
    notification.setSource(this.objectName);
  }
}
origin: org.springframework/spring-context

/**
 * Replaces the notification source if necessary to do so.
 * From the {@link Notification javadoc}:
 * <i>"It is strongly recommended that notification senders use the object name
 * rather than a reference to the MBean object as the source."</i>
 * @param notification the {@link Notification} whose
 * {@link javax.management.Notification#getSource()} might need massaging
 */
private void replaceNotificationSourceIfNecessary(Notification notification) {
  if (notification.getSource() == null || notification.getSource().equals(this.managedResource)) {
    notification.setSource(this.objectName);
  }
}
origin: spring-projects/spring-batch

  /**
   * Publish the provided message to an external listener if there is one.
   * 
   * @param message the message to publish
   */
  private void publish(String message) {
    if (notificationPublisher != null) {
      Notification notification = new Notification("JobExecutionApplicationEvent", this, notificationCount++,
          message);
      /*
       * We can't create a notification with a null source, but we can set
       * it to null after creation(!). We want it to be null so that
       * Spring will replace it automatically with the ObjectName (in
       * ModelMBeanNotificationPublisher).
       */
      notification.setSource(null);
      notificationPublisher.sendNotification(notification);
    }
  }
}
origin: spring-projects/spring-batch

/**
 * Publish the provided message to an external listener if there is one.
 * 
 * @param message the message to publish
 */
private void publish(String message) {
  if (notificationPublisher != null) {
    Notification notification = new Notification("JobExecutionApplicationEvent", this, notificationCount++,
        message);
    /*
     * We can't create a notification with a null source, but we can set
     * it to null after creation(!). We want it to be null so that
     * Spring will replace it automatically with the ObjectName (in
     * ModelMBeanNotificationPublisher).
     */
    notification.setSource(null);
    notificationPublisher.sendNotification(notification);
  }
}
origin: org.jboss.jbossas/jboss-as-jmx

public void handleNotification(Notification notification, Object handback)
{
 if (notification == null)
   return;
 // Forward the notification with the object name as source
 // FIXME: This overwrites the original source, there is no way
 //        to put it back with the current spec
 notification.setSource(name);
 listener.handleNotification(notification, handback);
}
origin: org.jboss.mx/jboss-jmx

public void handleNotification(Notification notification, Object handback)
{
 if (notification == null)
   return;
 // Forward the notification with the object name as source
 // FIXME: This overwrites the original source, there is no way
 //        to put it back with the current spec
 notification.setSource(name);
 listener.handleNotification(notification, handback);
}
origin: org.jboss.jbossas/jboss-as-j2se

/**
 * This method is called before a notification is sent to see whether
 * the listener wants the notification.
 *
 * @param notification the notification to be sent.
 * @return true if the listener wants the notification, false otherwise
 */
public boolean isNotificationEnabled(Notification notification)
{
  // replace with the real source of the event
  notification.setSource(source);
  return this.delegate.isNotificationEnabled(notification);
}
origin: apache/servicemix-bundles

/**
 * Replaces the notification source if necessary to do so.
 * From the {@link Notification javadoc}:
 * <i>"It is strongly recommended that notification senders use the object name
 * rather than a reference to the MBean object as the source."</i>
 * @param notification the {@link Notification} whose
 * {@link javax.management.Notification#getSource()} might need massaging
 */
private void replaceNotificationSourceIfNecessary(Notification notification) {
  if (notification.getSource() == null || notification.getSource().equals(this.managedResource)) {
    notification.setSource(this.objectName);
  }
}
origin: org.terracotta/terracotta-ee

 public void handleNotification(Notification notification, Object handback) {
  notification.setSource(mirror.getLocalObjectName());
  listener.handleNotification(notification, handback);
 }
}
origin: org.terracotta/terracotta-l1-ee

 public void handleNotification(Notification notification, Object handback) {
  notification.setSource(mirror.getLocalObjectName());
  listener.handleNotification(notification, handback);
 }
}
origin: org.jboss.jbossas/jboss-as-cluster

/**
* 
* Broadcast a notifcation remotely to the partition participants
* 
* @param notification
*/
protected void sendNotificationRemote(Notification notification) throws Exception
{
 // Overriding the source MBean with its ObjectName
 // to ensure that it can be safely transferred over the wire
 notification.setSource(this.getServiceName());
 
 this.service.handleEvent(notification);
}
origin: org.terracotta/terracotta-l1

 public void handleNotification(Notification notification, Object handback) {
  notification.setSource(mirror.getLocalObjectName());
  listener.handleNotification(notification, handback);
 }
}
origin: io.snappydata/gemfire-hydra-tests

public void sendNotificationToMe(String name) {
 long sequence = sequenceNumber++;
 Notification n = new AttributeChangeNotification(this, sequenceNumber, System.currentTimeMillis(),
   name, "A", "long", sequence, sequenceNumber);
 n.setSource(RemoteTestModule.getMyVmid());
 sendNotification(n);
}
origin: io.snappydata/gemfire-hydra-tests

public void sendNotificationToMe(String name) {
 long sequence = sequenceNumber++;
 Notification n = new AttributeChangeNotification(this, sequenceNumber, System.currentTimeMillis(),
   name, "A", "long", sequence, sequenceNumber);
 n.setSource(RemoteTestModule.getMyVmid());
 sendNotification(n);
}
origin: org.jboss.jbossas/jboss-as-jmx

((Notification)args[x]).setSource(name);
origin: org.jboss.mx/jboss-jmx

((Notification)args[x]).setSource(name);
origin: apache/felix

public void handleNotification(Notification notification, Object handback)
{
  // The JMX spec does not specify how to change the source to be the ObjectName
  // of the broadcaster. If we serialize the calls to the listeners, then it's
  // possible to change the source and restore it back to the old value before
  // calling the next listener; but if we want to support concurrent calls
  // to the listeners, this is not possible. Here I chose to support concurrent
  // calls so I change the value once and I never restore it.
  Object src = notification.getSource();
  if (!(src instanceof ObjectName))
  {
   // Change the source to be the ObjectName of the notification broadcaster
   // if we are not already an ObjectName (compliant with RI behaviour)
   notification.setSource(objectName);
  }
  // Notify the real listener
  NotificationListener listener = getTargetListener();
  listener.handleNotification(notification, handback);
}
javax.managementNotificationsetSource

Popular methods of Notification

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

Popular in Java

  • Reactive rest calls using spring rest template
  • getSupportFragmentManager (FragmentActivity)
  • runOnUiThread (Activity)
  • getResourceAsStream (ClassLoader)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • IsNull (org.hamcrest.core)
    Is the value null?
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Top PhpStorm plugins
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