Package javax.management

Examples of javax.management.AttributeChangeNotification


    public void setStringValue(String aStringValue) {
        String oldValue = getStringValue();
        mStringValue = aStringValue;

        AttributeChangeNotification acn = new AttributeChangeNotification(
                this, mSequence++, mTimestamp, "attribute changed", "stringValue", "string", oldValue, mStringValue);
        sendNotification(acn);
    }
View Full Code Here


        NotificationEventType jaxb = null;

        boolean wrap = false;

        if (aNotification instanceof AttributeChangeNotification) {
            AttributeChangeNotification ac = (AttributeChangeNotification) aNotification;

            jaxb = mObjectFactory.createAttributeChangeNotification()
                    .withAttributeName(ac.getAttributeName())
                    .withAttributeType(ac.getAttributeType())
                    .withNewValue(ac.getNewValue() == null ? null : String.valueOf(ac.getNewValue()))
                    .withOldValue(ac.getOldValue() == null ? null : String.valueOf(ac.getOldValue()));
        } else if (aNotification instanceof JMXConnectionNotification) {
            jaxb = mObjectFactory.createJMXConnectionNotification()
                    .withConnectionId(((JMXConnectionNotification) aNotification).getConnectionId());
        } else if (aNotification instanceof MBeanServerNotification) {
            jaxb = mObjectFactory.createMBeanServerNotification()
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

        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 {

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

       
        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

       
        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

       
        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

        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

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.