modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java
| 155 ++-----
modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/PluginUpdate.java
| 214 +++-------
modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java
| 16
3 files changed, 123 insertions(+), 262 deletions(-)
New commits:
commit fd21e3a42153c9e205afc5a25418f2970c6e5c7d
Author: Elias Ross <genman(a)noderunner.net>
Date: Thu Nov 28 18:04:46 2013 +0100
Bug 1030063 - Clean up plugin update to work synchronously
The plugin update is problematic as it is driven by listener ordering and possibly has
many race conditions like seen in Bug 1025844. For example, the listener is actually added
before the plugin container starts. Although effectively, the dependent systems are
initialized before be the listener is called, this is not something predictable or clear.
The other weird thing is a lot of polling (of directory states, etc.) for a count of
files. There is no notion of completed state, i.e. the update actually completed.
I've seen agents come up with the old version of plugins (like if the server
blocked for a very long time), etc.
Using marker files isn't terribly reliable either, and not really helpful. Maybe
it is a diagnostic feature, but why not use a static semaphore to order updates?
Anyway, my patch is simply having AgentMain do (more or less):
new PluginUpdate(...).updatePlugins()
when the server starts.
diff --git
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java
index 1e43996..4f05315 100644
--- a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java
+++ b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,14 +13,11 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.enterprise.agent;
-import gnu.getopt.Getopt;
-import gnu.getopt.LongOpt;
-
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
@@ -28,7 +25,6 @@ import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileWriter;
-import java.io.FilenameFilter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
@@ -63,6 +59,8 @@ import javax.management.ObjectName;
import mazz.i18n.Logger;
import mazz.i18n.Msg;
+import gnu.getopt.Getopt;
+import gnu.getopt.LongOpt;
import org.apache.log4j.Level;
import org.apache.log4j.LogManager;
@@ -168,9 +166,6 @@ import org.rhq.enterprise.communications.util.SecurityUtil;
* @author John Mazzitelli
*/
public class AgentMain {
- /**
- * The logger.
- */
private static final Logger LOG = AgentI18NFactory.getLogger(AgentMain.class);
/**
@@ -393,6 +388,11 @@ public class AgentMain {
private boolean m_loggedNativeSystemInfoUnavailableWarning;
/**
+ * Plugin update instance, used by management.
+ */
+ private PluginUpdate m_pluginUpdate;
+
+ /**
* The main method that starts the whole thing.
*
* @param args the arguments passed on the command line (e.g. java
org.rhq.enterprise.agent.AgentMain arg1 arg2 arg3)
@@ -1677,7 +1677,6 @@ public class AgentMain {
* <p/>
* <ul>
* <li>Registering with the server (if the agent needs to do so at
startup)</li>
- * <li>Updating the plugins with the latest versions that are found on the
server</li>
* <li>Setup a conditional restart of the plugin container, see {@link
PluginContainerConditionalRestartListener}</li>
* </ul>
*
@@ -1706,11 +1705,6 @@ public class AgentMain {
m_clientSender.addStateListener(new RegisterStateListener(), true);
}
- // now we want to prepare to update the plugins if told to do so
- if (m_configuration.isUpdatePluginsAtStartupEnabled()) {
- updatePlugins();
- }
-
//the next thing is to setup the conditional restart of the PC if it fails to
merge
//the upgrade results with the server due to some network glitch
m_clientSender.addStateListener(new PluginContainerConditionalRestartListener(),
false);
@@ -1719,12 +1713,20 @@ public class AgentMain {
}
/**
- * This asks that the agent update its plugins. If the RHQ Server is already up and
the agent has detected it, this
- * method will immediately pull down the new/updated plugins. Otherwise, this will
schedule the agent to update the
- * plugins from the server once it comes up and the agent detects it.
+ * Management method to manually update plugins.
+ * This method will fail if the server is down.
+ * @throws IllegalStateException if the container is not initialized
+ * @throws RuntimeException for any other reason (failed to download, etc.)
*/
public void updatePlugins() {
- m_clientSender.addStateListener(new UpdatePluginsStateListener(), true);
+ if (m_pluginUpdate == null) {
+ throw new IllegalStateException("plugin update uninitialized");
+ }
+ try {
+ m_pluginUpdate.updatePlugins();
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
}
/**
@@ -1885,59 +1887,34 @@ public class AgentMain {
return false;
}
- try {
- File plugin_dir = pc_config.getPluginDirectory();
- boolean keep_waiting = (plugin_dir.list().length == 0)
- || PluginUpdate.waitForUpdateToComplete(pc_config, 1000L);
-
- // we block until we get our plugins - there is no sense continuing until we
have plugins
- // there may be instances, though, where we don't want to block (in unit
tests for example)
- // so allow this to be configurable via the "update plugins at
startup" flag.
- if (m_configuration.isUpdatePluginsAtStartupEnabled()) {
- boolean notified_user = false;
-
- while (keep_waiting) {
- if (!notified_user) {
- LOG.info(AgentI18NResourceKeys.WAITING_FOR_PLUGINS_WITH_DIR,
plugin_dir);
-
getOut().println(MSG.getMsg(AgentI18NResourceKeys.WAITING_FOR_PLUGINS));
- notified_user = true;
- } else {
- // let's keep logging this at debug level so we don't
look hung
- LOG.debug(AgentI18NResourceKeys.WAITING_FOR_PLUGINS_WITH_DIR,
plugin_dir);
- }
-
- boolean updating = PluginUpdate.waitForUpdateToComplete(pc_config,
30000L);
- int after = plugin_dir.list().length;
-
- if ((after == 0) && !updating) {
- // still nothing and it doesn't look like we are downloading
- try to update them again right now
- // (doing this because I saw a case where the startup update
somehow happened just prior to the
- // registration finishing, so the original update was rejected by
the server as "unauthorized")
- updatePluginsNow(m_clientSender);
- after = plugin_dir.list().length;
- }
-
- keep_waiting = ((after == 0) || (updating));
+ File plugin_dir = pc_config.getPluginDirectory();
- if (!keep_waiting) {
- after = plugin_dir.list(new FilenameFilter() {
- public boolean accept(File dir, String name) {
- return name.endsWith(".jar");
- }
- }).length;
- LOG.info(AgentI18NResourceKeys.DONE_WAITING_FOR_PLUGINS, after);
-
getOut().println(MSG.getMsg(AgentI18NResourceKeys.DONE_WAITING_FOR_PLUGINS, after));
- }
+ // we block until we get our plugins - there is no sense continuing until we have
plugins
+ // there may be instances, though, where we don't want to block (in unit
tests for example)
+ // so allow this to be configurable via the "update plugins at startup"
flag.
+ m_pluginUpdate = new
PluginUpdate(pc_config.getServerServices().getCoreServerService(), pc_config);
+ if (m_configuration.isUpdatePluginsAtStartupEnabled()) {
+ boolean notified_user = false;
+ // this can block forever...perhaps exit after a few tries?
+ while (true) {
+ if (!notified_user) {
+ LOG.info(AgentI18NResourceKeys.WAITING_FOR_PLUGINS_WITH_DIR,
plugin_dir);
+
getOut().println(MSG.getMsg(AgentI18NResourceKeys.WAITING_FOR_PLUGINS));
+ notified_user = true;
+ } else {
+ // let's keep logging this at debug level so we don't look
hung
+ LOG.debug(AgentI18NResourceKeys.WAITING_FOR_PLUGINS_WITH_DIR,
plugin_dir);
+ }
+ try {
+ m_pluginUpdate.updatePlugins();
+ break;
+ } catch (Exception e) {
+ LOG.error(e, AgentI18NResourceKeys.UPDATING_PLUGINS_FAILURE, e);
}
- } else if (plugin_dir.list().length == 0) {
- LOG.warn(AgentI18NResourceKeys.NO_PLUGINS);
- getOut().println(MSG.getMsg(AgentI18NResourceKeys.NO_PLUGINS));
- return false;
}
- } catch (InterruptedException e) {
- Thread.currentThread().interrupt();
- LOG.warn(AgentI18NResourceKeys.PLUGIN_CONTAINER_INITIALIZATION_INTERRUPTED);
-
getOut().println(MSG.getMsg(AgentI18NResourceKeys.PLUGIN_CONTAINER_INITIALIZATION_INTERRUPTED));
+ } else if (plugin_dir.list().length == 0) {
+ LOG.warn(AgentI18NResourceKeys.NO_PLUGINS);
+ getOut().println(MSG.getMsg(AgentI18NResourceKeys.NO_PLUGINS));
return false;
}
@@ -3522,29 +3499,6 @@ public class AgentMain {
m_startTime = (started) ? System.currentTimeMillis() : 0L;
}
- /**
- * Immediately sends a request to the server to update the plugins.
- *
- * @param sender the sender used to comminucate with server
- *
- * @return <code>true</code> if the plugins were succesfully updated,
<code>false</code> if an error occurred
- *
- * @see PluginUpdate
- */
- private boolean updatePluginsNow(ClientCommandSender sender) {
- try {
- ClientRemotePojoFactory factory = sender.getClientRemotePojoFactory();
- CoreServerService server = factory.getRemotePojo(CoreServerService.class);
- PluginContainerConfiguration pc_config =
m_configuration.getPluginContainerConfiguration();
- PluginUpdate plugin_update = new PluginUpdate(server, pc_config);
- plugin_update.updatePlugins();
- return true;
- } catch (Exception e) {
- LOG.warn(e, AgentI18NResourceKeys.UPDATING_PLUGINS_FAILURE);
- return false;
- }
- }
-
private static void reconfigureJavaLogging() {
try {
LOG.debug(AgentI18NResourceKeys.RECONFIGURE_JAVA_LOGGING_START);
@@ -3582,21 +3536,6 @@ public class AgentMain {
}
/**
- * Listener that will update the plugins once the sender is able to start sending.
- */
- private class UpdatePluginsStateListener implements ClientCommandSenderStateListener
{
- public boolean startedSending(ClientCommandSender sender) {
- updatePluginsNow(sender);
-
- return false; // no need to keep listening
- }
-
- public boolean stoppedSending(ClientCommandSender sender) {
- return true; // no-op but keep listening
- }
- }
-
- /**
* Sender listener that will remove the command listener once the sender starts. It
will also add the command
* listener once the sender stops. The command listener will allow us to immediately
turn on the sender when the
* server sends us a message. We don't need this command listener once we know
the sender has started (because that
diff --git
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/PluginUpdate.java
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/PluginUpdate.java
index 8aa81a0..5e24b14 100644
--- a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/PluginUpdate.java
+++ b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/PluginUpdate.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,8 +13,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.enterprise.agent;
@@ -26,10 +26,9 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.concurrent.Semaphore;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
-import java.util.concurrent.locks.ReadWriteLock;
-import java.util.concurrent.locks.ReentrantReadWriteLock;
import mazz.i18n.Logger;
@@ -55,57 +54,15 @@ import
org.rhq.enterprise.communications.command.client.RemoteIOException;
public class PluginUpdate {
private static final Logger LOG = AgentI18NFactory.getLogger(PluginUpdate.class);
- private static final String MARKER_FILENAME = ".updatelock";
-
/**
- * Static lock that prohibits concurrent plugin updates.
+ * Lock that prohibits concurrent plugin updates between threads.
*/
- private static final ReadWriteLock lock = new ReentrantReadWriteLock();
+ private static final Semaphore SEMAPHORE = new Semaphore(1);
private final CoreServerService coreServerService;
private final PluginContainerConfiguration config;
/**
- * All {@link PluginUpdate} objects know if they are currently updating plugins given
a specific <code>
- * config</code>. Call this static method to ask if any plugin update object is
currently updating plugins with the
- * given configuration
- *
- * @param config used to determine where the plugins are being updated
- *
- * @return <code>true</code> if a plugin updater object is currently
updating plugin; <code>false</code> if all
- * plugins are up-to-date and nothing is being updated anymore.
- */
- public static boolean isCurrentlyUpdating(PluginContainerConfiguration config) {
- File marker = new File(config.getPluginDirectory(), MARKER_FILENAME);
- return marker.exists();
- }
-
- /**
- * Blocks the calling thread for a maximum of the given amount of milliseconds
timeout waiting for a plugin update
- * to completely. This will return sooner if the update finishes early or if there is
no update currently happening.
- *
- * @param config used to determine where the plugins are being updated
- * @param timeout max milliseconds to wait
- *
- * @return <code>true</code> if a plugin updater object is currently
updating plugin and this method timed out;
- * <code>false</code> if all plugins are up-to-date and nothing
is being updated anymore.
- *
- * @throws InterruptedException if thread was interrupted while waiting
- */
- public static boolean waitForUpdateToComplete(PluginContainerConfiguration config,
long timeout)
- throws InterruptedException {
- long time_limit = System.currentTimeMillis() + timeout;
- boolean currently_updating = true; // for us to sleep at least an initial amount
before checking the first time
-
- while (currently_updating && (time_limit >
System.currentTimeMillis())) {
- Thread.sleep(2000L);
- currently_updating = isCurrentlyUpdating(config);
- }
-
- return currently_updating;
- }
-
- /**
* Constructor for {@link PluginUpdate}. You can pass in a
<code>null</code> <code>core_server_service</code> if you
* only plan to use this object to obtain information on the currently installed
plugins and not actually update
* them.
@@ -151,97 +108,101 @@ public class PluginUpdate {
List<Plugin> updated_plugins = new ArrayList<Plugin>();
// block if some other thread is updating, too - we can only ever have one thread
updating plugins
- if (!PluginUpdate.lock.writeLock().tryLock(3600, TimeUnit.SECONDS)) {
+ if (!SEMAPHORE.tryAcquire(3600, TimeUnit.SECONDS)) {
// it should never take this long to update plugins. But if it does, just
barf
throw new TimeoutException();
}
try {
- createMarkerFile();
-
- try {
- List<String> disabled_plugin_names =
this.config.getDisabledPlugins();
+ List<String> disabled_plugin_names = this.config.getDisabledPlugins();
- // find out what plugins we already have locally
- Map<String, Plugin> current_plugins = getCurrentPlugins();
+ // find out what plugins we already have locally
+ Map<String, Plugin> current_plugins = getCurrentPlugins();
- // find out what the latest plugins are available to us
- List<Plugin> latest_plugins =
coreServerService.getLatestPlugins();
+ // find out what the latest plugins are available to us
+ List<Plugin> latest_plugins = coreServerService.getLatestPlugins();
+ if (LOG.isDebugEnabled()) {
if (LOG.isDebugEnabled()) {
LOG.debug(AgentI18NResourceKeys.LATEST_PLUGINS_COUNT,
latest_plugins.size());
- for (Plugin latest_plugin : latest_plugins) {
+ }
+ for (Plugin latest_plugin : latest_plugins) {
+ if (LOG.isDebugEnabled()) {
LOG.debug(AgentI18NResourceKeys.LATEST_PLUGIN,
latest_plugin.getId(), latest_plugin.getName(),
latest_plugin.getDisplayName(), latest_plugin.getVersion(),
latest_plugin.getPath(),
latest_plugin.getMd5(), latest_plugin.isEnabled(),
latest_plugin.getDescription());
}
}
+ }
- Map<String, Plugin> latest_plugins_map = new HashMap<String,
Plugin>(latest_plugins.size());
+ Map<String, Plugin> latest_plugins_map = new HashMap<String,
Plugin>(latest_plugins.size());
- // determine if we need to upgrade any of our current plugins to the
latest versions
- for (Plugin latest_plugin : latest_plugins) {
- String plugin_filename = latest_plugin.getPath();
- latest_plugins_map.put(plugin_filename, latest_plugin);
- Plugin current_plugin = current_plugins.get(plugin_filename);
+ // determine if we need to upgrade any of our current plugins to the latest
versions
+ for (Plugin latest_plugin : latest_plugins) {
+ String plugin_filename = latest_plugin.getPath();
+ latest_plugins_map.put(plugin_filename, latest_plugin);
+ Plugin current_plugin = current_plugins.get(plugin_filename);
- if (current_plugin == null) {
- updated_plugins.add(latest_plugin); // we don't have any
version of this plugin, we'll need to get it
+ if (current_plugin == null) {
+ updated_plugins.add(latest_plugin); // we don't have any version
of this plugin, we'll need to get it
+ if (LOG.isDebugEnabled()) {
LOG.debug(AgentI18NResourceKeys.NEED_MISSING_PLUGIN,
plugin_filename);
- } else {
- if (latest_plugin.isEnabled() &&
!disabled_plugin_names.contains(latest_plugin.getName())) {
- String latest_md5 = latest_plugin.getMD5();
- String current_md5 = current_plugin.getMD5();
-
- if (!current_md5.equals(latest_md5)) {
- updated_plugins.add(latest_plugin);
-
LOG.debug(AgentI18NResourceKeys.PLUGIN_NEEDS_TO_BE_UPDATED, plugin_filename,
- current_md5, latest_md5);
- } else {
- LOG.debug(AgentI18NResourceKeys.PLUGIN_ALREADY_AT_LATEST,
plugin_filename);
+ }
+ } else {
+ if (latest_plugin.isEnabled() &&
!disabled_plugin_names.contains(latest_plugin.getName())) {
+ String latest_md5 = latest_plugin.getMD5();
+ String current_md5 = current_plugin.getMD5();
+
+ if (!current_md5.equals(latest_md5)) {
+ updated_plugins.add(latest_plugin);
+ if (LOG.isDebugEnabled()) {
+
LOG.debug(AgentI18NResourceKeys.PLUGIN_NEEDS_TO_BE_UPDATED, plugin_filename, current_md5,
+ latest_md5);
}
} else {
- // we have a plugin file locally, but it is to be disabled,
so delete the plugin .jar
- File disabled_file = getPluginFile(latest_plugin);
- if (disabled_file.delete()) {
-
LOG.info(AgentI18NResourceKeys.PLUGIN_DISABLED_PLUGIN_DELETED, disabled_file);
- } else {
-
LOG.error(AgentI18NResourceKeys.PLUGIN_DISABLED_PLUGIN_DELETE_FAILED, disabled_file);
+ if (LOG.isDebugEnabled()) {
+ LOG.debug(AgentI18NResourceKeys.PLUGIN_ALREADY_AT_LATEST,
plugin_filename);
}
}
+ } else {
+ // we have a plugin file locally, but it is to be disabled, so
delete the plugin .jar
+ File disabled_file = getPluginFile(latest_plugin);
+ if (disabled_file.delete()) {
+
LOG.info(AgentI18NResourceKeys.PLUGIN_DISABLED_PLUGIN_DELETED, disabled_file);
+ } else {
+
LOG.error(AgentI18NResourceKeys.PLUGIN_DISABLED_PLUGIN_DELETE_FAILED, disabled_file);
+ }
}
}
+ }
- deleteIllegitimatePlugins(current_plugins, latest_plugins_map);
-
- // Let's go ahead and download all the plugins that we need.
- // Try to update all plugins, even if one or more fails to update. At the
end,
- // if an exception was thrown, we'll rethrow it but only after all
update attempts were made
- // NOTE: we do not download any plugins that are to be disabled
- Exception last_error = null;
-
- for (Plugin updated_plugin : updated_plugins) {
- String name = updated_plugin.getName();
- if (updated_plugin.isEnabled() &&
!disabled_plugin_names.contains(name)) {
- try {
- downloadPluginWithRetries(updated_plugin); // tries our very
best to get it
- } catch (Exception e) {
- last_error = e;
- }
- } else {
-
LOG.info(AgentI18NResourceKeys.PLUGIN_DISABLED_PLUGIN_DOWNLOAD_SKIPPED, name);
- updated_plugin.setEnabled(false);
+ deleteIllegitimatePlugins(current_plugins, latest_plugins_map);
+
+ // Let's go ahead and download all the plugins that we need.
+ // Try to update all plugins, even if one or more fails to update. At the
end,
+ // if an exception was thrown, we'll rethrow it but only after all update
attempts were made
+ // NOTE: we do not download any plugins that are to be disabled
+ Exception last_error = null;
+
+ for (Plugin updated_plugin : updated_plugins) {
+ String name = updated_plugin.getName();
+ if (updated_plugin.isEnabled() &&
!disabled_plugin_names.contains(name)) {
+ try {
+ downloadPluginWithRetries(updated_plugin); // tries our very best
to get it
+ } catch (Exception e) {
+ last_error = e;
}
+ } else {
+
LOG.info(AgentI18NResourceKeys.PLUGIN_DISABLED_PLUGIN_DOWNLOAD_SKIPPED, name);
+ updated_plugin.setEnabled(false);
}
+ }
- if (last_error != null) {
- throw last_error;
- }
- } finally {
- deleteMarkerFile();
+ if (last_error != null) {
+ throw last_error;
}
} finally {
- PluginUpdate.lock.writeLock().unlock();
+ SEMAPHORE.release();
}
LOG.info(AgentI18NResourceKeys.UPDATING_PLUGINS_COMPLETE);
@@ -408,39 +369,6 @@ public class PluginUpdate {
return plugins;
}
- private void createMarkerFile() {
- File marker = null;
- try {
- marker = new File(config.getPluginDirectory(), MARKER_FILENAME);
-
- // shouldn't exist, but if it does, oh well, just reuse it
- if (!marker.exists()) {
- new FileOutputStream(marker).close();
- }
- } catch (Exception e) {
- LOG.warn(AgentI18NResourceKeys.UPDATING_PLUGINS_MARKER_CREATE_FAILURE,
marker, e);
- }
-
- return;
- }
-
- private void deleteMarkerFile() {
- try {
- File marker = new File(config.getPluginDirectory(), MARKER_FILENAME);
-
- // it should exist, but if it doesn't oh well, just skip trying to delete
it
- if (marker.exists()) {
- if (!marker.delete()) {
-
LOG.warn(AgentI18NResourceKeys.UPDATING_PLUGINS_MARKER_DELETE_FAILURE, marker);
- }
- }
- } catch (Throwable t) {
- LOG.warn(AgentI18NResourceKeys.UPDATING_PLUGINS_MARKER_DELETE_FAILURE,
MARKER_FILENAME);
- }
-
- return;
- }
-
private void deleteIllegitimatePlugins(Map<String, Plugin> current_plugins,
Map<String, Plugin> latest_plugins_map) {
for (Plugin current_plugin : current_plugins.values()) {
if (!latest_plugins_map.containsKey(current_plugin.getPath())) {
@@ -473,4 +401,4 @@ public class PluginUpdate {
File file = new File(plugin_dir, plugin_filename);
return file;
}
-}
\ No newline at end of file
+}
diff --git
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java
index 16c110a..8c35d13 100644
---
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java
+++
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/i18n/AgentI18NResourceKeys.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2010 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,8 +13,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.enterprise.agent.i18n;
@@ -356,12 +356,6 @@ public interface AgentI18NResourceKeys {
@I18NMessage("Completed updating the plugins to their latest versions.")
String UPDATING_PLUGINS_COMPLETE = "PluginUpdate.updating-complete";
- @I18NMessage("Failed to create updater marker file [{0}] - will continue but
agent startup may fail. If so, restart agent. Cause. {1}")
- String UPDATING_PLUGINS_MARKER_CREATE_FAILURE =
"PluginUpdate.marker-create-failure";
-
- @I18NMessage("Failed to delete updater marker file [{0}] - will continue but
agent startup may fail. If so, delete the file manually.")
- String UPDATING_PLUGINS_MARKER_DELETE_FAILURE =
"PluginUpdate.marker-delete-failure";
-
@I18NMessage("The plugin [{0}] is current and does not need to be
updated.")
String PLUGIN_ALREADY_AT_LATEST = "PluginUpdate.already-at-latest";
@@ -1608,10 +1602,10 @@ public interface AgentI18NResourceKeys {
@I18NMessage("The agent will now wait until it has registered with the
server...")
String WAITING_TO_BE_REGISTERED_BEGIN =
"AgentMain.waiting-to-be-registered-begin";
- @I18NMessage("The agent does not have plugins - it will now wait for them to be
downloaded...")
+ @I18NMessage("The agent is waiting for plugins to be downloaded...")
String WAITING_FOR_PLUGINS = "AgentMain.waiting-for-plugins";
- @I18NMessage("The agent does not have plugins - it will now wait for them to be
downloaded to [{0}]...")
+ @I18NMessage("The agent is waiting for plugins to be downloaded to
[{0}]...")
String WAITING_FOR_PLUGINS_WITH_DIR =
"AgentMain.waiting-for-plugins-with-dir";
@I18NMessage("[{0}] plugins downloaded.")