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 {