Return-Path: X-Original-To: apmail-ace-commits-archive@www.apache.org Delivered-To: apmail-ace-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3C8F4105AB for ; Tue, 8 Oct 2013 11:33:03 +0000 (UTC) Received: (qmail 4203 invoked by uid 500); 8 Oct 2013 11:33:02 -0000 Delivered-To: apmail-ace-commits-archive@ace.apache.org Received: (qmail 4179 invoked by uid 500); 8 Oct 2013 11:33:00 -0000 Mailing-List: contact commits-help@ace.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ace.apache.org Delivered-To: mailing list commits@ace.apache.org Received: (qmail 4147 invoked by uid 99); 8 Oct 2013 11:32:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Oct 2013 11:32:58 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Oct 2013 11:32:56 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 934EF238896F; Tue, 8 Oct 2013 11:32:36 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1530234 - /ace/trunk/org.apache.ace.agent/src/org/apache/ace/agent/impl/DefaultController.java Date: Tue, 08 Oct 2013 11:32:36 -0000 To: commits@ace.apache.org From: marrs@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20131008113236.934EF238896F@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: marrs Date: Tue Oct 8 11:32:36 2013 New Revision: 1530234 URL: http://svn.apache.org/r1530234 Log: ACE-415 Updated the code after feedback on previous commit. Modified: ace/trunk/org.apache.ace.agent/src/org/apache/ace/agent/impl/DefaultController.java Modified: ace/trunk/org.apache.ace.agent/src/org/apache/ace/agent/impl/DefaultController.java URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.agent/src/org/apache/ace/agent/impl/DefaultController.java?rev=1530234&r1=1530233&r2=1530234&view=diff ============================================================================== --- ace/trunk/org.apache.ace.agent/src/org/apache/ace/agent/impl/DefaultController.java (original) +++ ace/trunk/org.apache.ace.agent/src/org/apache/ace/agent/impl/DefaultController.java Tue Oct 8 11:32:36 2013 @@ -488,28 +488,18 @@ public class DefaultController extends C logDebug("Controller disabled by configuration. Skipping..."); return; } - logDebug("Controller syncing..."); try { + logDebug("Controller syncing..."); runFeedback(); - try { - runAgentUpdate(); - } - catch (IOException e) { - logError("Agent update aborted due to Exception.", e); - } - try { - runDeploymentUpdate(); - } - catch (IOException e) { - logError("Deployment update aborted due to Exception.", e); - } + runAgentUpdate(); + runDeploymentUpdate(); logDebug("Sync completed. Rescheduled in %d seconds", interval); } catch (RetryAfterException e) { // any method may throw this causing the sync to abort. The server is busy so no sense in trying // anything else until the retry window has passed. interval = e.getBackoffTime(); - logWarning("Sync received retry exception from server. Rescheduled in %d seconds", e.getBackoffTime()); + logWarning("Sync received retry exception from server. Rescheduled in %d seconds", interval); } finally { scheduleRun(interval); @@ -623,24 +613,34 @@ public class DefaultController extends C return m_updateInstaller; } - private void runAgentUpdate() throws RetryAfterException, IOException { + private void runAgentUpdate() throws RetryAfterException { logDebug("Checking for agent updates..."); long maxRetries = m_maxRetries.get(); boolean fixPackage = m_fixPackage.get(); UpdateInstaller updateInstaller = getUpdateInstaller(); - updateInstaller.installUpdate(getAgentUpdateHandler(), fixPackage, maxRetries); + try { + updateInstaller.installUpdate(getAgentUpdateHandler(), fixPackage, maxRetries); + } + catch (IOException e) { + logError("Agent update aborted due to Exception.", e); + } } - private void runDeploymentUpdate() throws RetryAfterException, IOException { + private void runDeploymentUpdate() throws RetryAfterException { logDebug("Checking for deployment updates..."); long maxRetries = m_maxRetries.get(); boolean fixPackage = m_fixPackage.get(); UpdateInstaller updateInstaller = getUpdateInstaller(); - updateInstaller.installUpdate(getDeploymentHandler(), fixPackage, maxRetries); + try { + updateInstaller.installUpdate(getDeploymentHandler(), fixPackage, maxRetries); + } + catch (IOException e) { + logError("Deployment update aborted due to Exception.", e); + } } private void runFeedback() throws RetryAfterException {