Examples of AttributeChangeNotification


Examples of javax.management.AttributeChangeNotification

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

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

Examples of javax.management.AttributeChangeNotification

  
        // 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

Examples of javax.management.AttributeChangeNotification

    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

Examples of javax.management.AttributeChangeNotification

        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

Examples of javax.management.AttributeChangeNotification

        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

Examples of javax.management.AttributeChangeNotification

        // 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

Examples of javax.management.AttributeChangeNotification

            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

Examples of javax.management.AttributeChangeNotification

      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

Examples of javax.management.AttributeChangeNotification

      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
TOP
Copyright © 2018 www.massapi.com. 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.