Package javax.management

Examples of javax.management.AttributeChangeNotification


    private void removeAndNotify(QueueMBeanHolder queueMBeanHolder) {
        String[] oldQueue = getQueueNames();
        remove(queueMBeanHolder);
        names = null;
        this.sendNotification(new AttributeChangeNotification(this, sequence
                .incrementAndGet(), System.currentTimeMillis(), "Queue "
                + queueMBeanHolder.name + " removed ", "queueNames",
                "String[]", oldQueue, getQueueNames()));
    }
View Full Code Here


  
        // into log.getMessage() replaceAll regex char by an other
        String msg=log.getMessage();
        message.append( reg+ ((msg!=null)?msg.replace('*','X'):"\"null\"") );

        this.sendNotification(new  AttributeChangeNotification(this.remoteLoggerON, 0, (oldLog)?0:System.currentTimeMillis(), message.toString(), null, "Log", null, null));
      }
    }
  }
View Full Code Here

    str.append(id);
    str.append(":");
    str.append(type);
    str.append(":");
    str.append(name);
    super.sendNotification(new AttributeChangeNotification(this.tabName, 0, 0,str.toString(),null, "Bundle", null, null));
  }
View Full Code Here

        else if (oldValue.getValue() != null)
            type = oldValue.getValue().getClass().getName();
        else
            return// Old and new are both null == no change

        AttributeChangeNotification notification =
            new AttributeChangeNotification
            (this, 1, System.currentTimeMillis(),
             "Attribute value has changed",
             oldValue.getName(), type,
             oldValue.getValue(), newValue.getValue());
        sendAttributeChangeNotification(notification);
View Full Code Here

        if (notification == null)
            return (false);
        if (!(notification instanceof AttributeChangeNotification))
            return (false);
        AttributeChangeNotification acn =
            (AttributeChangeNotification) notification;
        if (!AttributeChangeNotification.ATTRIBUTE_CHANGE.equals(acn.getType()))
            return (false);
        synchronized (names) {
            if (names.size() < 1)
                return (true);
            else
                return (names.contains(acn.getAttributeName()));
        }

    }
View Full Code Here

        // set attributes in jndi
       //     if( "jmx.attribute.changed".equals( notification.getType() )) {
        if( notification instanceof AttributeChangeNotification) {

            AttributeChangeNotification anotif=(AttributeChangeNotification)notification;
            String name=anotif.getAttributeName();
            Object value=anotif.getNewValue();
            Object source=anotif.getSource();
            String mname=null;

            Hashtable mbeanAtt=(Hashtable)attributes.get( source );
            if( mbeanAtt==null ) {
                mbeanAtt=new Hashtable();
View Full Code Here

            sb.append( "<mbean class=\"").append(on).append("\">");
            sb.append( "\n");
            Enumeration attEn=mbeanAtt.keys();
            while (attEn.hasMoreElements()) {
                String an = (String) attEn.nextElement();
                AttributeChangeNotification anotif=
                        (AttributeChangeNotification)mbeanAtt.get(an);
                sb.append("  <attribute name=\"").append(an).append("\" ");
                sb.append("value=\"").append(anotif.getNewValue()).append("\">");
                sb.append( "\n");
            }


            sb.append( "</mbean>");
View Full Code Here

      if (isDisableStateChangeNotifications())
         return;

      long now = System.currentTimeMillis();

      AttributeChangeNotification stateChangeNotification = new AttributeChangeNotification(
            this,
            getNextNotificationSequenceNumber(), now, msg,
            "State", "java.lang.Integer",
            oldState, newState);

      stateChangeNotification.setUserData(t);

      sendNotification(stateChangeNotification);
   }
View Full Code Here

      public void handleNotification(Notification msg, Object handback)
      {
         if (msg instanceof AttributeChangeNotification)
         {
            AttributeChangeNotification change = (AttributeChangeNotification) msg;
            String attrName = change.getAttributeName();
            Object newValue = change.getNewValue();
            if ("State".equals(attrName) && newValue != null && newValue instanceof Integer)
            {
               notifications.add((Integer) newValue);
            }
         }
View Full Code Here

        state = STARTING;

        // Notifying the MBEan server that we're starting

        notification = new AttributeChangeNotification
            (this, sequenceNumber++, System.currentTimeMillis(),
             "Starting " + NAME, "State", "java.lang.Integer",
             new Integer(STOPPED), new Integer(STARTING));
        sendNotification(notification);

        try {

            embedded.start();

            state = STARTED;
            notification = new AttributeChangeNotification
                (this, sequenceNumber++, System.currentTimeMillis(),
                 "Started " + NAME, "State", "java.lang.Integer",
                 new Integer(STARTING), new Integer(STARTED));
            sendNotification(notification);

        } catch (Throwable t) {
            state = STOPPED;
            notification = new AttributeChangeNotification
                (this, sequenceNumber++, System.currentTimeMillis(),
                 "Stopped " + NAME, "State", "java.lang.Integer",
                 new Integer(STARTING), new Integer(STOPPED));
            sendNotification(notification);
        }
View Full Code Here

TOP

Related Classes of javax.management.AttributeChangeNotification

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.