Package javax.management

Examples of javax.management.AttributeChangeNotification


        if (state != STARTED)
            return;
       
        state = STOPPING;
       
        notification = new AttributeChangeNotification
            (this, sequenceNumber++, System.currentTimeMillis(),
             "Stopping " + NAME, "State", "java.lang.Integer",
             new Integer(STARTED), new Integer(STOPPING));
        sendNotification(notification);
       
        try {
           
            System.setProperty(Context.URL_PKG_PREFIXES, oldUrlValue);
            System.setProperty(Context.INITIAL_CONTEXT_FACTORY, oldIcValue);
           
        } catch (Throwable t) {
           
            // FIXME
            t.printStackTrace();
           
        }
       
        state = STOPPED;
       
        notification = new AttributeChangeNotification
            (this, sequenceNumber++, System.currentTimeMillis(),
             "Stopped " + NAME, "State", "java.lang.Integer",
             new Integer(STOPPING), new Integer(STOPPED));
        sendNotification(notification);
       
View Full Code Here


        return true;
    }

    public void notifyAttrChange(String attrName, Object newVal, Object oldVal)  {
  sendNotification(
      new AttributeChangeNotification(this, sequenceNumber++, new Date().getTime(),
          "Attribute change", attrName, newVal.getClass().getName(),
          oldVal, newVal));
    }
View Full Code Here

    }


    private void notifyAttrChange(String attrName, Object newVal, Object oldVal)  {
  sendNotification(
      new AttributeChangeNotification(this, sequenceNumber++, new Date().getTime(),
          "Attribute change", attrName, newVal.getClass().getName(),
          oldVal, newVal));
    }
View Full Code Here

        return true;
    }

    public void notifyAttrChange(String attrName, Object newVal, Object oldVal)  {
  sendNotification(
      new AttributeChangeNotification(this, sequenceNumber++, new Date().getTime(),
          "Attribute change", attrName, (newVal == null ? "" : newVal.getClass().getName()),
          oldVal, newVal));
    }
View Full Code Here

        }
       
        public void handleNotification(Notification notification, Object handback) {
            if (notification instanceof AttributeChangeNotification) {
                try {
                    AttributeChangeNotification acn = (AttributeChangeNotification) notification;
                    if (acn.getAttributeName().equals(WLS_ACTIVE_VERSION_STATE)) {
                        if (acn.getNewValue().equals(new Integer(0))) {
                            resetHelperContext(mapKey);
                        }
                    }
                } catch (Exception x) {}
            }
View Full Code Here

                            ));
                }

                public void sendJMXAttributeChanged(String name, Object oldValue, Object newValue)
                {
                    broadCaster_.sendNotification(new AttributeChangeNotification(manageable,
                            ++notificationSequence_,
                            System.currentTimeMillis(),
                            "Attribute value changed",
                            name,
                            oldValue == null ? null : oldValue.getClass().getName(),
View Full Code Here

        broadCaster_.removeNotificationListener(listener, filter, handback);
    }

    public void sendAttributeChanged(String name, Object oldValue, Object newValue)
    {
        broadCaster_.sendNotification(new AttributeChangeNotification(delegate_,
                ++notificationSequence_,
                System.currentTimeMillis(),
                "Attribute value changed",
                name,
                oldValue == null ? null : oldValue.getClass().getName(),
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 {
           
            if (configFile == null) {
               
                Domain.selfInit();
               
            } else {
               
                SAXParserFactory factory = SAXParserFactory.newInstance();
                factory.setNamespaceAware(false);
                factory.setValidating(false);
                SAXParser parser = factory.newSAXParser();
               
                FileInputStream is = new FileInputStream(configFile);
                //init(reader);
                Populate pop = new Populate();
                Configuration slideConfiguration =
                    new ConfigurationElement(pop.load(new InputSource(is),
                                                      parser.getXMLReader()));
               
                Domain.init(slideConfiguration);
               
                Domain.start();
               
            }
           
        } 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);
        }
       
        state = STARTED;
        notification = new AttributeChangeNotification
            (this, sequenceNumber++, System.currentTimeMillis(),
             "Started " + NAME, "State", "java.lang.Integer",
             new Integer(STARTING), new Integer(STARTED));
        sendNotification(notification);
       
View Full Code Here

        if (state != STARTED)
            return;
       
        state = STOPPING;
       
        notification = new AttributeChangeNotification
            (this, sequenceNumber++, System.currentTimeMillis(),
             "Stopping " + NAME, "State", "java.lang.Integer",
             new Integer(STARTED), new Integer(STOPPING));
        sendNotification(notification);
       
        try {
           
            Domain.stop();
           
        } catch (Throwable t) {
           
            // FIXME
            t.printStackTrace();
           
        }
       
        state = STOPPED;
       
        notification = new AttributeChangeNotification
            (this, sequenceNumber++, System.currentTimeMillis(),
             "Stopped " + NAME, "State", "java.lang.Integer",
             new Integer(STOPPING), new Integer(STOPPED));
        sendNotification(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

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.