Package org.rhq.enterprise.communications.command.impl.generic

Examples of org.rhq.enterprise.communications.command.impl.generic.GenericCommandClient


                ServerEndpoint serverEndpoint = AgentUtils.getServerEndpoint(agent.getConfiguration(), args[1]);

                // use the generic client utility to issue the command
                RemoteCommunicator rc = agent.createServerRemoteCommunicator(serverEndpoint.transport,
                    serverEndpoint.namePort.address, serverEndpoint.namePort.port, serverEndpoint.transportParams);
                GenericCommandClient client = new GenericCommandClient(rc);

                out.println(MSG.getMsg(AgentI18NResourceKeys.IDENTIFY_ASK_REMOTE_SERVER_FOR_ID, args[1]));
                sender.preprocessCommand(command);
                CommandResponse response = client.invoke(command);

                client.disconnectRemoteCommunicator();

                out.println(response);
            }
        } catch (MalformedURLException e) {
            out.println(MSG.getMsg(AgentI18NResourceKeys.IDENTIFY_INVALID_LOCATOR_URI, args[1]));
View Full Code Here


     *
     * @return server's invoker locator or <code>null</code> if server could not be identified
     */
    private InvokerLocator attemptToIdentifyServer() {
        try {
            GenericCommandClient client = new GenericCommandClient(m_remoteCommunicator);
            CommandResponse genericResponse = client.invoke(new IdentifyCommand());
            IdentifyCommandResponse identifyResponse = new IdentifyCommandResponse(genericResponse);

            if (identifyResponse.getException() != null) {
                throw identifyResponse.getException();
            }
View Full Code Here

            // can't find the command in question - assume the user knows best and just issue a generic command
            // cross your fingers and hope that the command type defined by the user is processable on the server-side
            LOG.debug(CommI18NResourceKeys.CMDLINE_CLIENT_USING_GENERIC_CLIENT, cnfe.getMessage());

            try {
                GenericCommandClient customClient = new GenericCommandClient();
                customClient.setCommandType(new CommandType(m_commandName, m_commandVersion));
                commandClient = customClient;
            } catch (Exception e) {
                // any exception that occurred while trying to build a generic client should throw a ClassNotFound
                // to alert the caller that the original client class was not found and our workaround didn't work
                throw new ClassNotFoundException(cnfe.toString(), e);
View Full Code Here

        // Keep this method short and simple - all it should do is blindly send the command, return or throw exceptions.
        // Do not attempt to recover or otherwise persist information - callers will be responsible for error handling.
        CommandResponse response;

        try {
            GenericCommandClient client = new GenericCommandClient(m_remoteCommunicator);

            // Give the pre-send callbacks a chance to execute
            executePreSendCallbacks(command);

            long start = System.currentTimeMillis();
            response = client.invoke(command);
            long elapsed = System.currentTimeMillis() - start;

            // Give the post-send callbacks a chance to execute
            response = executePostSendCallbacks(command, response);
View Full Code Here

TOP

Related Classes of org.rhq.enterprise.communications.command.impl.generic.GenericCommandClient

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.