Examples of AttributeChangeNotification


Examples of javax.management.AttributeChangeNotification

       
        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 {
           
            String value = "org.apache.naming";
            String oldValue = System.getProperty(Context.URL_PKG_PREFIXES);
            if (oldValue != null) {
                oldUrlValue = oldValue;
                value = oldValue + ":" + value;
            }
            System.setProperty(Context.URL_PKG_PREFIXES, value);
           
            oldValue = System.getProperty(Context.INITIAL_CONTEXT_FACTORY);
            if (oldValue != null) {
                oldIcValue = oldValue;
            } else {
                System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
                                   Constants.Package
                                   + ".java.javaURLContextFactory");
            }
           
        } 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

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

Examples of javax.management.AttributeChangeNotification

        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

Examples of javax.management.AttributeChangeNotification

    }


    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

Examples of javax.management.AttributeChangeNotification

        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

Examples of javax.management.AttributeChangeNotification

        }
       
        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

Examples of javax.management.AttributeChangeNotification

                            ));
                }

                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

Examples of javax.management.AttributeChangeNotification

        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

Examples of javax.management.AttributeChangeNotification

       
        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

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 {
           
            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
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.