Examples of JMXConnectionNotification


Examples of javax.management.remote.JMXConnectionNotification

        }
    }

    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

Examples of javax.management.remote.JMXConnectionNotification

        }
    }

    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 = (LoginContext) threadContext.get();
                threadContext.set(null);
                contextMap.put(connectionId, context);
            } else {
View Full Code Here

Examples of javax.management.remote.JMXConnectionNotification

        Notification n = new Notification("touched", this, mSequence++, mTimestamp, "I was touched");
        sendNotification(n);
    }

    public void triggerConnectionNotification() {
        JMXConnectionNotification n = new JMXConnectionNotification("connection", this,
                "conn-123", mSequence++, "connection notification", null);
        n.setTimeStamp(mTimestamp);
        sendNotification(n);
    }
View Full Code Here

Examples of javax.management.remote.JMXConnectionNotification

        }
    }

    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 = (LoginContext) threadContext.get();
                threadContext.set(null);
                contextMap.put(connectionId, context);
            } else {
View Full Code Here

Examples of javax.management.remote.JMXConnectionNotification

        }
    }

    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 = (LoginContext) threadContext.get();
                threadContext.set(null);
                contextMap.put(connectionId, context);
            } else {
View Full Code Here

Examples of javax.management.remote.JMXConnectionNotification

            }
         }, null, null);

         cntor.connect(getEnvironment());

         JMXConnectionNotification notification = (JMXConnectionNotification) holder.get();
         assertEquals(notification.getType(), JMXConnectionNotification.OPENED);
      } catch (Exception x)
      {
         x.printStackTrace();
         throw x;
      } finally
View Full Code Here

Examples of javax.management.remote.JMXConnectionNotification

         }, null, null);

         cntor.connect(getEnvironment());
         cntor.close();

         JMXConnectionNotification notification = (JMXConnectionNotification) holder.get();
         assertEquals(notification.getType(), JMXConnectionNotification.CLOSED);
      } catch (Exception x)
      {
         x.printStackTrace();
         throw x;
      } finally
View Full Code Here

Examples of javax.management.remote.JMXConnectionNotification

         Map clientEnv = getEnvironment();
         clientEnv.put(MX4JRemoteConstants.CONNECTION_HEARTBEAT_PERIOD, new Long(period));
         clientEnv.put(MX4JRemoteConstants.CONNECTION_HEARTBEAT_RETRIES, new Integer(retries));
         cntor.connect(clientEnv);

         JMXConnectionNotification notification = (JMXConnectionNotification) holder.get();
         assertEquals(notification.getType(), JMXConnectionNotification.OPENED);
         holder.set(null);
      } catch (Exception x)
      {
         x.printStackTrace();
         throw x;
      } finally
      {
         cntorServer.stop();
         sleep(5000);
      }

      // Wait for the heartbeat to send the failed notification
      sleep((retries * 3) * period);

      JMXConnectionNotification notification = (JMXConnectionNotification) holder.get();
      assertNotNull(notification);
      assertEquals(notification.getType(), JMXConnectionNotification.FAILED);
   }
View Full Code Here

Examples of javax.management.remote.JMXConnectionNotification

*/
public class RemoteInstantiator
{
   public JMXConnectionNotification createJMXConnectionNotification()
   {
      JMXConnectionNotification jcn = new JMXConnectionNotification(JMXConnectionNotification.OPENED,
                                                                    "Source", "ConnectionID",
                                                                    0L, "Message", "UserData");
      return jcn;
   }
View Full Code Here

Examples of javax.management.remote.JMXConnectionNotification

public class RemoteComparator
{

   public void compareJMXConnectionNotification(Object obj1, Object obj2)
   {
      JMXConnectionNotification jcn1 = (JMXConnectionNotification)obj1;
      JMXConnectionNotification jcn2 = (JMXConnectionNotification)obj2;
      boolean valid = jcn1.getConnectionId().equals(jcn2.getConnectionId());
      compareNotifications(jcn1, jcn2);
      if (!valid) throw new RuntimeException();
   }
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.