Codota Logo
Notification.setSource
Code IndexAdd Codota 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)

  • Common ways to obtain Notification
private void myMethod () {
Notification n =
  • Codota IconStandardWrapper this;new Notification("j2ee.state.starting", this.getObjectName(), sequenceNumber++)
  • Codota IconStandardContext this;AtomicLong sequenceNumber;new Notification("j2ee.state.running", this.getObjectName(), sequenceNumber.getAndIncrement())
  • Codota IconString str;BaseModelMBean baseModelMBean;String str2;new Notification(str, baseModelMBean, long1, str2)
  • Smart code suggestions by Codota
}
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

  • Running tasks concurrently on multiple threads
  • onCreateOptionsMenu (Activity)
  • orElseThrow (Optional)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registery of org.quartz
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now