Package javax.management.remote

Examples of javax.management.remote.JMXConnectionNotification


    final Integer listenerID = tn.getListenerID();
    final Notification badNotif = tn.getNotification();
    final String notifType = JMXConnectionNotification.NOTIFS_LOST;
    final String notifMessage = "Not serializable: " + badNotif;
    Notification goodNotif =
        new JMXConnectionNotification(notifType,
              badNotif.getSource(),
              clientId,
              badNotif.getSequenceNumber(),
              notifMessage,
              ONE_LONG);
View Full Code Here


                               "JMXConnectionNotification: " +
                               notif.getClass());
            return false;
        }

        JMXConnectionNotification cnotif = (JMXConnectionNotification) notif;
        if (!cnotif.getType().equals(requiredType)) {
            System.out.println("Wrong type notif: is \"" + cnotif.getType() +
                               "\", should be \"" + requiredType + "\"");
            return false;
        }

        if (!cnotif.getConnectionId().equals(requiredConnId)) {
            System.out.println("Wrong connection id: is \"" +
                               cnotif.getConnectionId() + "\", should be \"" +
                               requiredConnId);
            return false;
        }

        return true;
View Full Code Here

            // reconnecting, to identify the "old" connection.
            //
            connectionId = getConnectionId();

            Notification connectedNotif =
                new JMXConnectionNotification(JMXConnectionNotification.OPENED,
                                              this,
                                              connectionId,
                                              clientNotifSeqNo++,
                                              "Successful connection",
                                              null);
View Full Code Here

         * never called connect() on the connector, because there's no
         * connection id in that case.  */

        if (savedConnectionId != null) {
            Notification closedNotif =
                new JMXConnectionNotification(JMXConnectionNotification.CLOSED,
                                              this,
                                              savedConnectionId,
                                              clientNotifSeqNo++,
                                              "Client has been closed",
                                              null);
View Full Code Here

        }

        protected void lostNotifs(String message, long number) {
            final String notifType = JMXConnectionNotification.NOTIFS_LOST;

            final JMXConnectionNotification n =
                new JMXConnectionNotification(notifType,
                                              RMIConnector.this,
                                              connectionId,
                                              clientNotifCounter++,
                                              message,
                                              new Long(number));
View Full Code Here

                if (toClose) {
                    // we should close the connection,
                    // but send a failed notif at first
                    final Notification failedNotif =
                        new JMXConnectionNotification(
                            JMXConnectionNotification.FAILED,
                            this,
                            connectionId,
                            clientNotifSeqNo++,
                            "Failed to communicate with the server: "+ioe.toString(),
View Full Code Here

            reconnectNotificationListeners(old);

            connectionId = getConnectionId();

            Notification reconnectedNotif =
                new JMXConnectionNotification(JMXConnectionNotification.OPENED,
                                              this,
                                              connectionId,
                                              clientNotifSeqNo++,
                                              "Reconnected to server",
                                              null);
View Full Code Here

        }
    }

    public void handleNotification(Notification notification, Object o) {
        if (notification instanceof JMXConnectionNotification) {
            JMXConnectionNotification cxNotification = (JMXConnectionNotification) notification;
            String type = cxNotification.getType();
            String connectionId = cxNotification.getConnectionId();
            if (JMXConnectionNotification.OPENED.equals(type)) {
                LoginContext context = threadContext.get();
                threadContext.set(null);
                contextMap.put(connectionId, context);
            } else {
View Full Code Here

        }
    }

    public void handleNotification(Notification notification, Object o) {
        if (notification instanceof JMXConnectionNotification) {
            JMXConnectionNotification cxNotification = (JMXConnectionNotification) notification;
            String type = cxNotification.getType();
            String connectionId = cxNotification.getConnectionId();
            if (JMXConnectionNotification.OPENED.equals(type)) {
                LoginContext context = threadContext.get();
                threadContext.set(null);
                contextMap.put(connectionId, context);
            } else {
View Full Code Here

    @Override
    public void handleNotification(final Notification notif, final Object handback)
    {
        if (notif instanceof JMXConnectionNotification)
        {
            final JMXConnectionNotification n = (JMXConnectionNotification) notif;
            if (n.getType().equals(JMXConnectionNotification.OPENED))
            {
                LOGGER.log(Level.INFO,JMX_BOOTING_AMX_LISTENER,handback);
                mBooter.bootAMX();

                // job is done, stop listening
View Full Code Here

TOP

Related Classes of javax.management.remote.JMXConnectionNotification

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.