ServerPluginManagerLocal serverPluginsManager = LookupUtil.getServerPluginManager();
// see if this plugin has been deleted previously; if so, don't register and delete the file
PluginKey newPluginKey = new PluginKey(plugin);
PluginStatusType status = serverPluginsManager.getServerPluginStatus(newPluginKey);
if (PluginStatusType.DELETED == status) {
log.warn("Plugin file [" + pluginFile + "] has been detected but that plugin with name [" + pluginName
+ "] was previously undeployed. Will not re-register that plugin and the file will be deleted.");
boolean succeeded = pluginFile.delete();