Package org.rhq.enterprise.communications.command.client

Examples of org.rhq.enterprise.communications.command.client.ClientRemotePojoFactory$RemotePojoProxyHandler


    @Override
    public boolean ping(long timeoutMillis) {
        try {
            // create our own factory so we can customize the timeout
            ClientRemotePojoFactory factory = sender.getClientRemotePojoFactory();
            factory.setTimeout(timeoutMillis);
            Ping pinger = factory.getRemotePojo(Ping.class);
            pinger.ping("", null);
            return true;
        } catch (Exception e) {
            return false;
        }
View Full Code Here


    @Override
    public boolean pingService(long timeoutMillis) {
        try {
            // create our own factory so we can customize the timeout
            ClientRemotePojoFactory factory = sender.getClientRemotePojoFactory();
            factory.setTimeout(timeoutMillis);
            PingAgentService pinger = factory.getRemotePojo(PingAgentService.class);
            long agentTime = pinger.ping();
            long skew = Math.abs(System.currentTimeMillis() - agentTime);
            if (skew > 5 * 60 * 1000L) {
                LogFactory.getLog(this.getClass()).debug(
                    "Agent [" + agent.getName() + "] either took a long time to process a ping (" + skew
View Full Code Here

        ClientCommandSender sender = agent.getClientCommandSender();
        if (sender == null) {
            out.println(MSG.getMsg(AgentI18NResourceKeys.DOWNLOAD_ERROR_NOT_SENDING, file_to_download));
        } else {
            // now let's ask the server for the file's stream
            ClientRemotePojoFactory factory = sender.getClientRemotePojoFactory();
            CoreServerService server = factory.getRemotePojo(CoreServerService.class);
            InputStream in = server.getFileContents(file_to_download);
            downloadStream(out, storage_dir, file_to_download, in);
        }
    }
View Full Code Here

                Ping ping = sender.getClientRemotePojoFactory().getRemotePojo(Ping.class);
                agent.getOut().println(MSG.getMsg(AgentI18NResourceKeys.PING_PINGING));
                String ping_results = ping.ping("PING", "Ack: ");
                agent.getOut().println(MSG.getMsg(AgentI18NResourceKeys.PING_PING_RESULTS, ping_results));
            } else {
                ClientRemotePojoFactory factory = sender.getClientRemotePojoFactory();
                factory.setDeliveryGuaranteed(guaranteed);
                factory.setAsynch(true, new Callback(agent));

                Ping ping = factory.getRemotePojo(Ping.class);

                for (int i = 0; i < numberOfTimes; i++) {
                    agent.getOut().println(MSG.getMsg(AgentI18NResourceKeys.PING_ASYNC_PING, i, guaranteed));
                    ping.ping("PING", "Ack #"
                        + i
View Full Code Here

    private PluginUpdate getPluginUpdateObject(AgentMain agent) {
        ClientCommandSender sender = agent.getClientCommandSender();
        CoreServerService server = null;

        if (sender != null) {
            ClientRemotePojoFactory factory = sender.getClientRemotePojoFactory();
            server = factory.getRemotePojo(CoreServerService.class);
        }

        PluginContainerConfiguration pc_config = agent.getConfiguration().getPluginContainerConfiguration();
        PluginUpdate plugin_update = new PluginUpdate(server, pc_config);
View Full Code Here

    private PluginUpdate getPluginUpdateObject() {
        ClientCommandSender sender = m_agent.getClientCommandSender();
        CoreServerService server = null;

        if (sender != null) {
            ClientRemotePojoFactory factory = sender.getClientRemotePojoFactory();
            server = factory.getRemotePojo(CoreServerService.class);
        }

        PluginContainerConfiguration pc_config = m_agent.getConfiguration().getPluginContainerConfiguration();
        PluginUpdate plugin_update = new PluginUpdate(server, pc_config);
View Full Code Here

            sender = getServiceContainer().createClientCommandSender(endpoint, client_config);
            sender.startSending();

            // create our own factory so we can customize the timeout
            ClientRemotePojoFactory factory = sender.getClientRemotePojoFactory();
            factory.setTimeout(timeoutMillis);
            Ping pinger = factory.getRemotePojo(Ping.class);
            pinger.ping("", null);
            return true;
        } catch (Exception e) {
            LOG.debug(ServerI18NResourceKeys.PING_FAILED, endpoint, ThrowableUtil.getAllMessages(e, true));
            pinged = false;
View Full Code Here

                }

                boolean updateAvail = PluginContainer.getInstance().isStarted();
                PingRequest request = new PingRequest(getConfiguration().getAgentName(), updateAvail, true);

                ClientRemotePojoFactory factory = m_clientSender.getClientRemotePojoFactory();
                CoreServerService server = factory.getRemotePojo(CoreServerService.class);
                request = server.ping(request);

                // take this opportunity to check the agent-server clock sync
                serverClockNotification(request.getReplyServerTimestamp());
View Full Code Here

    public FailoverListComposite downloadServerFailoverList() {
        try {
            ClientCommandSender sender = getClientCommandSender();
            if (sender != null) {
                String agent_name = this.getConfiguration().getAgentName();
                ClientRemotePojoFactory factory = sender.getClientRemotePojoFactory();
                CoreServerService pojo = factory.getRemotePojo(CoreServerService.class);
                FailoverListComposite list = pojo.getFailoverList(agent_name);
                if (list == null) {
                    list = new FailoverListComposite(new ArrayList<ServerEntry>());
                }
                // if we do not yet have a list or the new list is different than our current one, store the new one
View Full Code Here

                        if ((sender == null) || Thread.currentThread().isInterrupted()) {
                            LOG.debug(AgentI18NResourceKeys.AGENT_REGISTRATION_ABORTED);
                            retry = false;
                        } else {
                            String token = getAgentSecurityToken();
                            ClientRemotePojoFactory pojo_factory = sender.getClientRemotePojoFactory();
                            CoreServerService remote_pojo = pojo_factory.getRemotePojo(CoreServerService.class);
                            AgentConfiguration agent_config = getConfiguration();
                            ServiceContainerConfiguration server_config = agent_config.getServiceContainerPreferences();
                            String agent_name = agent_config.getAgentName();
                            String address = server_config.getConnectorBindAddress();
                            int port = server_config.getConnectorBindPort();
View Full Code Here

TOP

Related Classes of org.rhq.enterprise.communications.command.client.ClientRemotePojoFactory$RemotePojoProxyHandler

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.