Package javax.management

Examples of javax.management.Notification


   public void sendNotification(NotificationBroadcasterSupport source,
          String msg, String attributeName,
          String attributeType, Object oldValue, Object newValue) {
      // Avoid any log.warning or log.severe to prevent looping alert events
      if (isJmxActivated()) {
         Notification n = new AttributeChangeNotification(source,
            sequenceNumber++,
            System.currentTimeMillis(),
            msg,
            attributeName,
            attributeType,
View Full Code Here


     * @param type the type of the notification.
     * @param report the report text.
     */
    public synchronized void sendAuditNotification(final String type, final String report) {
        if (report != null) {
            sendNotification(new Notification(type, this, getNextSeqNumber(), report));
        }
    }
View Full Code Here

     * @param data - a data object sent as part of the event parameter.
     * @return a sequence number associated with the emitted event.
     */
    public long send(Object data) {
        long seq = NumberSequencer.getNextSequence();
        Notification note = new Notification(
                this.getEvent(),
                this,
                seq,
                System.currentTimeMillis(),
                "Event notification " + this.getEvent()
        );
        note.setUserData(data);
        super.sendNotification(note);
        return seq;
    }
View Full Code Here

      }
   }

   private void sendJMXNotification(String notificationType)
   {
      Notification n = new Notification(notificationType, "", 0l);
      nbSupport.sendNotification(n);
      log.debug(this + " sent " + notificationType + " JMX notification");
   }
View Full Code Here

     * @see de.netseeker.ejoe.jmx.EJServerConfigMBean#stopEJServer()
     */
    public void stopEJServer()
    {
        this._ejServer.stop();
        Notification n = new AttributeChangeNotification( this, _sequenceNumber++, System.currentTimeMillis(),
                                                          "Running state changed", "Running", "boolean", Boolean.TRUE,
                                                          Boolean.FALSE );
        sendNotification( n );
    }
View Full Code Here

    public void startEJServer()
    {
        try
        {
            this._ejServer.start();
            Notification n = new AttributeChangeNotification( this, _sequenceNumber++, System.currentTimeMillis(),
                                                              "Running state changed", "Running", "boolean",
                                                              Boolean.FALSE, Boolean.TRUE );
            sendNotification( n );
        }
        catch ( IOException e )
View Full Code Here

    }

    private int sequence = 1;

    public void emitNotification(){
        this.sendNotification(new Notification("time.expired", this, sequence++));
    }
View Full Code Here

            {
               List notifications = server.pollNotificationListener(id);

               for(Iterator i = notifications.iterator(); i.hasNext(); )
               {
                  Notification n = (Notification)i.next();
                  listener.handleNotification(n, null);
               }

               Thread.sleep(POLL_INTERVAL);
            }
View Full Code Here

      if (emitter == null)
         return;
     
      try
      {
         Notification notif = new Notification(event, spec, emitter.nextNotificationSequenceNumber());
         notif.setUserData(userData);
         emitter.sendNotification(notif);
      }
      catch (Throwable t)
      {
         log.warn("Error sending notification: " + event, t);
View Full Code Here

    * will be automatically filled.
    */  
   protected void sendAlarmNotification(
      ObjectName target, String type, int severity, int alarmState, String message, Object userData)
   {
      Notification n = new AlarmNotification(
         type,
         mbeanImpl.getMBeanName(), // source
         target,
         severity,          
         alarmState,        
         this.mbeanImpl.getSequenceNumber(),
         System.currentTimeMillis(),
         message
      );
      n.setUserData(userData);
     
      // send it away
      mbeanImpl.emitNotification(n);
   }
View Full Code Here

TOP

Related Classes of javax.management.Notification

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.