Package javax.management

Examples of javax.management.MBeanServerNotification


    }

    public void handleNotification(Notification n, Object handback) {
        String type = n.getType();
        if (MBeanServerNotification.UNREGISTRATION_NOTIFICATION.equals(type)) {
            MBeanServerNotification notification = (MBeanServerNotification) n;
            ObjectName source = notification.getMBeanName();
            synchronized (this) {
                removeAllDependencies(source);
                removeAllStartHolds(source);
            }
        }


    }

    public void handleNotification(Notification n, Object o) {
        String type = n.getType();
        if (MBeanServerNotification.UNREGISTRATION_NOTIFICATION.equals(type)) {
            MBeanServerNotification notification = (MBeanServerNotification) n;
            ObjectName source = notification.getMBeanName();
            if (source.equals(blocker)) {
                try {
                    attemptFullStart();
                } catch (Exception e) {
                    log.warn("A problem occured while attempting to start", e);

        // ------------------------------

        // ---------------------
        // Create notification
        // ---------------------
        MBeanServerNotification notif = new MBeanServerNotification(
            NotifType,MBeanServerDelegate.DELEGATE_NAME,0,name);

        if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
            MBEANSERVER_LOGGER.logp(Level.FINER,
                    DefaultMBeanServerInterceptor.class.getName(),

                        final String unreg =
                            MBeanServerNotification.UNREGISTRATION_NOTIFICATION;
                        if (notif instanceof MBeanServerNotification &&
                            notif.getType().equals(unreg)) {

                            MBeanServerNotification mbsn =
                                (MBeanServerNotification) notif;
                            ObjectName name = mbsn.getMBeanName();

                            removeNotificationListener(name);
                        }
                    }
                    myListenerID = mbeanRemovedNotifID;

    }

    public void handleNotification(Notification n, Object o) {
        String type = n.getType();
        if (MBeanServerNotification.UNREGISTRATION_NOTIFICATION.equals(type)) {
            MBeanServerNotification notification = (MBeanServerNotification) n;
            ObjectName source = notification.getMBeanName();
            if (source.equals(blocker)) {
                try {
                    attemptFullStart();
                } catch (Exception e) {
                    log.warn("A problem occured while attempting to start", e);

    }

    public void handleNotification(Notification n, Object handback) {
        String type = n.getType();
        if (MBeanServerNotification.UNREGISTRATION_NOTIFICATION.equals(type)) {
            MBeanServerNotification notification = (MBeanServerNotification) n;
            ObjectName source = notification.getMBeanName();
            synchronized(this) {
                removeAllDependencies(source);
                removeAllStartHolds(source);
            }
        }

                text.append(notif.getMessage() + "\n");
            }
            return;
        }
        if (notif instanceof MBeanServerNotification) {
            MBeanServerNotification mbsn = (MBeanServerNotification) notif;
            ObjectName mbeanName = mbsn.getMBeanName();
            if (MBeanServerNotification.REGISTRATION_NOTIFICATION.equals(notif.getType())) {
                onMBeanRegistered(mbeanName);
            } else if (MBeanServerNotification.UNREGISTRATION_NOTIFICATION.equals(notif.getType())) {
                onMBeanUnregistered(mbeanName);
            }

    }

    public void handleNotification(Notification n, Object o) {
        String type = n.getType();
        if (MBeanServerNotification.UNREGISTRATION_NOTIFICATION.equals(type)) {
            MBeanServerNotification notification = (MBeanServerNotification) n;
            ObjectName source = notification.getMBeanName();
            if (source.equals(blocker)) {
                try {
                    attemptFullStart();
                } catch (Exception e) {
                    log.warn("A problem occured while attempting to start", e);

    }

    public void handleNotification(Notification n, Object handback) {
        String type = n.getType();
        if (MBeanServerNotification.UNREGISTRATION_NOTIFICATION.equals(type)) {
            MBeanServerNotification notification = (MBeanServerNotification) n;
            ObjectName source = notification.getMBeanName();
            synchronized (this) {
                removeAllDependencies(source);
                removeAllStartHolds(source);
            }
        }

    }

    @Override
    public String stringify(Object o)
    {
        final MBeanServerNotification notif = (MBeanServerNotification) o;

        final StringBuffer b = super._stringify(notif);
        append(b, "");

        append(b, "registered MBean: " + notif.getMBeanName());

        return (b.toString());
    }

TOP

Related Classes of javax.management.MBeanServerNotification

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.