Package com.sun.jmx.remote.generic

Examples of com.sun.jmx.remote.generic.ProfileClient


            // Execute client selected profiles
            //
            List profileList = selectProfiles(serverProfiles);
            for (Iterator i = profileList.iterator(); i.hasNext(); ) {
                String profile = (String) i.next();
    ProfileClient p =
        ProfileClientFactory.createProfile(profile, env);
    if (logger.traceOn()) {
        logger.trace("connectionOpen",
         ">>>>> Profile " +
         p.getClass().getName() +
         " <<<<<");
    }
    ProfileMessage pm = null;
    p.initialize(mc);
    while (!p.isComplete()) {
        pm = p.produceMessage();
        mc.writeMessage(pm);
        msg = mc.readMessage();
        if (msg instanceof ProfileMessage) {
      p.consumeMessage((ProfileMessage)msg);
        } else if (msg instanceof HandshakeErrorMessage) {
      // Throw exception and let GenericConnector
      // close the connection
      //
      sendError = false;
      error = (HandshakeErrorMessage) msg;
      throwExceptionOnError(error);
        } else {
      throw new IOException("Unexpected message: " +
                msg.getClass().getName());
        }
    }
    p.activate();
    profilesList.add(p);
      }

            // Send client handshake end
            //
View Full Code Here


        return mc;
    }

    public void connectionClosed(MessageConnection mc) {
        for (Iterator i = profilesList.iterator(); i.hasNext(); ) {
            ProfileClient p = (ProfileClient) i.next();
            try {
                p.terminate();
            } catch (Exception e) {
    if (logger.debugOn()) {
        logger.debug("connectionClosed",
         "Got an exception to terminate a ProfileClient: "+p.getName(), e);
    }
            }
        }
        profilesList.clear();
    }
View Full Code Here

TOP

Related Classes of com.sun.jmx.remote.generic.ProfileClient

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.