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

Examples of org.rhq.enterprise.communications.command.impl.remotepojo.RemotePojoInvocationCommand


     * @return <code>true</code> if the given command is asking to register an agent; any other command results in this
     *         method returning <code>false</code>
     */
    private boolean isRegisterCommand(Command command) {
        if (REGISTER_COMMAND_TYPE_NAME.equals(command.getCommandType().getName())) {
            RemotePojoInvocationCommand remote_cmd = (RemotePojoInvocationCommand) command;
            String iface_name = remote_cmd.getTargetInterfaceName();

            if (REGISTER_SERVICE_INTERFACE.equals(iface_name)) {
                String method_name = remote_cmd.getNameBasedInvocation().getMethodName();

                if ("registerAgent".equals(method_name)) {
                    return true;
                }
            }
View Full Code Here


        String agentName = config.getAgentName();
        boolean agentUpdateEnabled = config.isAgentUpdateEnabled();
        AgentVersion version = getAgentVersion();
        ConnectAgentRequest request = new ConnectAgentRequest(agentName, version, agentUpdateEnabled);

        RemotePojoInvocationCommand connectCommand = new RemotePojoInvocationCommand();
        Method connectMethod = CoreServerService.class.getMethod("connectAgent", ConnectAgentRequest.class);
        NameBasedInvocation inv = new NameBasedInvocation(connectMethod, new Object[] { request });
        connectCommand.setNameBasedInvocation(inv);
        connectCommand.setTargetInterfaceName(CoreServerService.class.getName());
        return connectCommand;
    }
View Full Code Here

            String[] paramSig = createParamSignature(method.getParameterTypes());
            NameBasedInvocation invocation = new NameBasedInvocation(methodName, args, paramSig);
            RemotePojoInvocationCommandResponse response = null;
            Throwable throwable = null;

            RemotePojoInvocationCommand cmd = new RemotePojoInvocationCommand();
            cmd.setNameBasedInvocation(invocation);
            cmd.setTargetInterfaceName(m_targetInterfaceName);

            boolean async_mode_enabled = determineAsynchronous(method);
            Long timeout = determineTimeout(method);
            boolean guaranteed_delivery = determineGuaranteedDelivery(method);
            boolean send_throttle_enabled = determineSendThrottling(method);

            if (send_throttle_enabled) {
                cmd.getConfiguration().setProperty(ClientCommandSender.CMDCONFIG_PROP_SEND_THROTTLE,
                    Boolean.toString(true));
            }

            if (timeout != null) {
                cmd.getConfiguration().setProperty(ClientCommandSender.CMDCONFIG_PROP_TIMEOUT, timeout.toString());
            }

            try {
                if (async_mode_enabled) {
                    if (guaranteed_delivery) {
View Full Code Here

    public static String getCommandString(Command command) {
        String commandString;
        if (command == null) {
            commandString = "null command";
        } else if (command.getCommandType().equals(RemotePojoInvocationCommand.COMMAND_TYPE)) {
            RemotePojoInvocationCommand remoteCmd = (RemotePojoInvocationCommand) command;
            StringBuilder fullMethod = new StringBuilder(getInterfaceSimpleName(remoteCmd.getTargetInterfaceName()));
            fullMethod.append('.');
            fullMethod.append(remoteCmd.getNameBasedInvocation().getMethodName());
            commandString = fullMethod.toString();
        } else if (command.getCommandType().equals(RemoteOutputStreamCommand.COMMAND_TYPE)) {
            RemoteOutputStreamCommand streamCmd = (RemoteOutputStreamCommand) command;
            StringBuilder fullMethod = new StringBuilder("OutputStream.");
            fullMethod.append(streamCmd.getNameBasedInvocation().getMethodName());
View Full Code Here

     * target POJO in the response.
     *
     * @see CommandExecutor#execute(Command, java.io.InputStream, java.io.OutputStream)
     */
    public CommandResponse execute(Command command, InputStream in, OutputStream out) {
        RemotePojoInvocationCommand remote_pojo_command = new RemotePojoInvocationCommand(command);
        NameBasedInvocation invocation = remote_pojo_command.getNameBasedInvocation();
        String target_interface_name = remote_pojo_command.getTargetInterfaceName();
        String method_name = invocation.getMethodName();
        Object[] params = invocation.getParameters();
        String[] signature = invocation.getSignature();
        Class<?>[] class_signature = new Class[signature.length];

View Full Code Here

            }
        } catch (Throwable t) {
            // See if the failing command was a ping and th exception was a CanNotConnectException
            boolean isPing = false;
            if (command instanceof RemotePojoInvocationCommand) {
                RemotePojoInvocationCommand rp = (RemotePojoInvocationCommand) command;
                if (rp.getTargetInterfaceName().endsWith("Ping")) {
                    if (t instanceof CannotConnectException) {
                        isPing = true;
                    }
                }
            }
View Full Code Here

            if (cmd != null) {
                CommandType cmdType = cmd.getCommandType();
                m_metrics.addCallTimeData(cmdType.getName(), elapsed, unsuccessfulReason);
                if (cmd instanceof RemotePojoInvocationCommand) {
                    // add additional metrics for the individual pojo method that was invoked
                    RemotePojoInvocationCommand pojoCmd = (RemotePojoInvocationCommand) cmd;
                    String ifaceName = pojoCmd.getTargetInterfaceName();
                    ifaceName = ifaceName.substring(ifaceName.lastIndexOf('.') + 1);
                    String methodName = pojoCmd.getNameBasedInvocation().getMethodName();
                    m_metrics.addCallTimeData(ifaceName + '.' + methodName, elapsed, unsuccessfulReason);
                }
            }
        } finally {
            m_metrics.writeUnlock();
View Full Code Here

TOP

Related Classes of org.rhq.enterprise.communications.command.impl.remotepojo.RemotePojoInvocationCommand

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.