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

Examples of org.rhq.enterprise.communications.command.impl.identify.IdentifyCommand


        m_agent2Test.createAgent(true);

        Thread.sleep(2000L); // wait for the initial connectAgent messages to get sent

        assert SimpleCounterCommandPreprocessor.COUNTER.get() == 0L : "Counter should have been reset to 0";
        agent1.getClientCommandSender().sendSynch(new IdentifyCommand());
        assert SimpleCounterCommandPreprocessor.COUNTER.get() == 1L : "Should have counted 1 commands (there should be no auto-connectAgent at startup)";
        agent1.getClientCommandSender().sendSynch(new IdentifyCommand());
        assert SimpleCounterCommandPreprocessor.COUNTER.get() == 2L : "Should have counted 2 commands (there should be no auto-connectAgent at startup)";
        agent1.getClientCommandSender().sendSynch(new IdentifyCommand());
        assert SimpleCounterCommandPreprocessor.COUNTER.get() == 3L : "Should have counted 3 commands (there should be no auto-connectAgent at startup)";

        return;
    }
View Full Code Here


        AgentMain agent1 = m_agent1Test.createAgent(true);
        AgentMain agent2 = m_agent2Test.createAgent(true);

        IdentifyCommandResponse response;

        response = (IdentifyCommandResponse) agent1.getClientCommandSender().sendSynch(new IdentifyCommand());
        assert response.isSuccessful() : "Failed to send command from agent1 to agent2";
        assert new InvokerLocator(response.getIdentification().getInvokerLocator()).getPort() == agent2
            .getServiceContainer().getConfiguration().getConnectorBindPort() : "Didn't get the identify of agent2 - what remoting server did we just communicate with??";

        CommandResponse generic_response;
        generic_response = agent2.getClientCommandSender().sendSynch(new IdentifyCommand());
        assert !generic_response.isSuccessful() : "Should have failed to send command from agent2 to agent1 since it didn't preprocess the command";
        assert generic_response.getException() != null;

        return;
    }
View Full Code Here

        assert agent1.getServiceContainer().getConfiguration().getConnectorSecurityClientAuthMode().equals(
            SSLSocketBuilder.CLIENT_AUTH_MODE_WANT);
        assert agent2.getServiceContainer().getConfiguration().getConnectorSecurityClientAuthMode().equals(
            SSLSocketBuilder.CLIENT_AUTH_MODE_WANT);

        IdentifyCommand command = new IdentifyCommand();
        CommandResponse cmdresponse;
        IdentifyCommandResponse response;

        cmdresponse = agent1.getClientCommandSender().sendSynch(command);
        assert cmdresponse.isSuccessful() : "Failed to send command from agent1 to agent2: " + cmdresponse;
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

    /**
     * @see CommandExecutor#execute(Command, java.io.InputStream, java.io.OutputStream)
     */
    public CommandResponse execute(Command command, InputStream in, OutputStream out) {
        IdentifyCommand identifyCommand = new IdentifyCommand(command);

        String our_type = null;
        InvokerLocator locator = null;
        Identification our_ident;

View Full Code Here

        try {
            while (!isInterrupted()) {
                try {
                    // Send a small, simple identify command to the server and if it succeeds, tell the client
                    // sender that it is OK to start sending messages, if it is not already sending
                    IdentifyCommand id_cmd = new IdentifyCommand();
                    m_clientSender.preprocessCommand(id_cmd);
                    CommandResponse response = m_clientSender.send(id_cmd);

                    // let all our listeners know what the results of the poll was
                    for (PollingListener listener : m_pollingListeners) {
View Full Code Here

        c1.start();

        try {
            JBossRemotingRemoteCommunicator client1 = new JBossRemotingRemoteCommunicator(locatorString1);
            client1.connect();
            CommandResponse results = client1.send(new IdentifyCommand());
            assert "foo".equals(results.getResults()) : "Results were " + results;

            c1.stop();
            c1.destroy();

            Thread.sleep(5000); // I have no idea if this will matter, but maybe this avoids the address-already-in-use error we periodically get

            c1.create();

            c1.addInvocationHandler("test", this);
            c1.start();

            results = client1.send(new IdentifyCommand());
            assert "foo".equals(results.getResults()) : "Results were " + results;
        } finally {
            c1.stop();
            c1.destroy();
        }
View Full Code Here

TOP

Related Classes of org.rhq.enterprise.communications.command.impl.identify.IdentifyCommand

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.