You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by am...@apache.org on 2006/05/04 06:09:23 UTC
svn commit: r399534 [2/4] - in /geronimo/branches/1.1:
applications/console-standard/src/java/org/apache/geronimo/console/car/
applications/console-standard/src/webapp/WEB-INF/view/car/
configs/console-jetty/src/conf/ configs/console-tomcat/src/conf/ c...
Modified: geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/RemoteDeploymentManager.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/RemoteDeploymentManager.java?rev=399534&r1=399533&r2=399534&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/RemoteDeploymentManager.java (original)
+++ geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/RemoteDeploymentManager.java Wed May 3 21:09:17 2006
@@ -26,6 +26,9 @@
import java.util.Iterator;
import java.util.Set;
import java.util.Map;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Arrays;
import javax.enterprise.deploy.shared.CommandType;
import javax.enterprise.deploy.spi.Target;
import javax.enterprise.deploy.spi.TargetModuleID;
@@ -33,6 +36,7 @@
import javax.enterprise.deploy.spi.status.ProgressListener;
import javax.management.MBeanServerConnection;
import javax.management.remote.JMXConnector;
+import javax.security.auth.login.FailedLoginException;
import org.apache.geronimo.deployment.plugin.GeronimoDeploymentManager;
import org.apache.geronimo.deployment.plugin.local.AbstractDeployCommand;
@@ -41,11 +45,13 @@
import org.apache.geronimo.deployment.plugin.remote.RemoteDeployUtil;
import org.apache.geronimo.gbean.AbstractName;
import org.apache.geronimo.gbean.AbstractNameQuery;
-import org.apache.geronimo.system.configuration.ConfigurationList;
-import org.apache.geronimo.system.configuration.DownloadPoller;
-import org.apache.geronimo.system.configuration.DownloadResults;
-import org.apache.geronimo.system.configuration.ConfigurationArchiveData;
import org.apache.geronimo.system.jmx.KernelDelegate;
+import org.apache.geronimo.system.plugin.DownloadResults;
+import org.apache.geronimo.system.plugin.PluginList;
+import org.apache.geronimo.system.plugin.DownloadPoller;
+import org.apache.geronimo.system.plugin.PluginMetadata;
+import org.apache.geronimo.system.plugin.PluginInstaller;
+import org.apache.geronimo.system.plugin.PluginRepositoryList;
import org.apache.geronimo.kernel.repository.Artifact;
/**
@@ -134,57 +140,49 @@
}
}
- public ConfigurationList listConfigurations(URL mavenRepository, String username, String password) {
- Set set = kernel.listGBeans(new AbstractNameQuery("org.apache.geronimo.system.configuration.ConfigurationInstaller"));
+ public PluginList listPlugins(URL mavenRepository, String username, String password) throws FailedLoginException, IOException {
+ Set set = kernel.listGBeans(new AbstractNameQuery(PluginInstaller.class.getName()));
for (Iterator it = set.iterator(); it.hasNext();) {
AbstractName name = (AbstractName) it.next();
- try {
- return (ConfigurationList) kernel.invoke(name, "listConfigurations", new Object[]{mavenRepository, username, password}, new String[]{URL.class.getName(), String.class.getName(), String.class.getName()});
- } catch (Exception e) {
- System.err.println("Unable to install configurations: "+e.getMessage());
- e.printStackTrace();
- }
+ PluginInstaller installer = (PluginInstaller) kernel.getProxyManager().createProxy(name, PluginInstaller.class);
+ PluginList results = installer.listPlugins(mavenRepository, username, password);
+ kernel.getProxyManager().destroyProxy(installer);
+ return results;
}
return null;
}
- public DownloadResults install(ConfigurationList installList, String username, String password) {
- Set set = kernel.listGBeans(new AbstractNameQuery("org.apache.geronimo.system.configuration.ConfigurationInstaller"));
+ public DownloadResults install(PluginList installList, String username, String password) {
+ Set set = kernel.listGBeans(new AbstractNameQuery(PluginInstaller.class.getName()));
for (Iterator it = set.iterator(); it.hasNext();) {
AbstractName name = (AbstractName) it.next();
- try {
- return (DownloadResults) kernel.invoke(name, "install", new Object[]{installList, username, password}, new String[]{ConfigurationList.class.getName(), String.class.getName(), String.class.getName()});
- } catch (Exception e) {
- System.err.println("Unable to install configurations: "+e.getMessage());
- e.printStackTrace();
- }
+ PluginInstaller installer = (PluginInstaller) kernel.getProxyManager().createProxy(name, PluginInstaller.class);
+ DownloadResults results = installer.install(installList, username, password);
+ kernel.getProxyManager().destroyProxy(installer);
+ return results;
}
return null;
}
- public void install(ConfigurationList configsToInstall, String username, String password, DownloadPoller poller) {
- Set set = kernel.listGBeans(new AbstractNameQuery("org.apache.geronimo.system.configuration.ConfigurationInstaller"));
+ public void install(PluginList configsToInstall, String username, String password, DownloadPoller poller) {
+ Set set = kernel.listGBeans(new AbstractNameQuery(PluginInstaller.class.getName()));
for (Iterator it = set.iterator(); it.hasNext();) {
AbstractName name = (AbstractName) it.next();
- try {
- kernel.invoke(name, "install", new Object[]{configsToInstall, username, password, poller}, new String[]{ConfigurationList.class.getName(), String.class.getName(), String.class.getName(), DownloadPoller.class.getName()});
- } catch (Exception e) {
- System.err.println("Unable to install configurations: "+e.getMessage());
- e.printStackTrace();
- }
+ PluginInstaller installer = (PluginInstaller) kernel.getProxyManager().createProxy(name, PluginInstaller.class);
+ installer.install(configsToInstall, username, password, poller);
+ kernel.getProxyManager().destroyProxy(installer);
+ return;
}
}
- public Object startInstall(ConfigurationList configsToInstall, String username, String password) {
- Set set = kernel.listGBeans(new AbstractNameQuery("org.apache.geronimo.system.configuration.ConfigurationInstaller"));
+ public Object startInstall(PluginList configsToInstall, String username, String password) {
+ Set set = kernel.listGBeans(new AbstractNameQuery(PluginInstaller.class.getName()));
for (Iterator it = set.iterator(); it.hasNext();) {
AbstractName name = (AbstractName) it.next();
- try {
- return kernel.invoke(name, "startInstall", new Object[]{configsToInstall, username, password}, new String[]{ConfigurationList.class.getName(), String.class.getName(), String.class.getName()});
- } catch (Exception e) {
- System.err.println("Unable to start installing configurations: "+e.getMessage());
- e.printStackTrace();
- }
+ PluginInstaller installer = (PluginInstaller) kernel.getProxyManager().createProxy(name, PluginInstaller.class);
+ Object result = installer.startInstall(configsToInstall, username, password);
+ kernel.getProxyManager().destroyProxy(installer);
+ return result;
}
return null;
}
@@ -203,71 +201,73 @@
});
RemoteDeployUtil.uploadFilesToServer(args, progress);
}
- Set set = kernel.listGBeans(new AbstractNameQuery("org.apache.geronimo.system.configuration.ConfigurationInstaller"));
+ Set set = kernel.listGBeans(new AbstractNameQuery(PluginInstaller.class.getName()));
for (Iterator it = set.iterator(); it.hasNext();) {
AbstractName name = (AbstractName) it.next();
- try {
- return kernel.invoke(name, "startInstall", new Object[]{args[0], username, password}, new String[]{File.class.getName(), String.class.getName(), String.class.getName()});
- } catch (Exception e) {
- System.err.println("Unable to start installing configurations: "+e.getMessage());
- e.printStackTrace();
- }
+ PluginInstaller installer = (PluginInstaller) kernel.getProxyManager().createProxy(name, PluginInstaller.class);
+ Object result = installer.startInstall(carFile, username, password);
+ kernel.getProxyManager().destroyProxy(installer);
+ return result;
}
return null;
}
public DownloadResults checkOnInstall(Object key) {
- Set set = kernel.listGBeans(new AbstractNameQuery("org.apache.geronimo.system.configuration.ConfigurationInstaller"));
+ Set set = kernel.listGBeans(new AbstractNameQuery(PluginInstaller.class.getName()));
for (Iterator it = set.iterator(); it.hasNext();) {
AbstractName name = (AbstractName) it.next();
- try {
- return (DownloadResults)kernel.invoke(name, "checkOnInstall", new Object[]{key}, new String[]{Object.class.getName()});
- } catch (Exception e) {
- System.err.println("Unable to check on configuration install: "+e.getMessage());
- e.printStackTrace();
- }
+ PluginInstaller installer = (PluginInstaller) kernel.getProxyManager().createProxy(name, PluginInstaller.class);
+ DownloadResults result = installer.checkOnInstall(key);
+ kernel.getProxyManager().destroyProxy(installer);
+ return result;
}
return null;
}
public Map getInstalledPlugins() {
- Set set = kernel.listGBeans(new AbstractNameQuery("org.apache.geronimo.system.configuration.ConfigurationInstaller"));
+ Set set = kernel.listGBeans(new AbstractNameQuery(PluginInstaller.class.getName()));
for (Iterator it = set.iterator(); it.hasNext();) {
AbstractName name = (AbstractName) it.next();
- try {
- return (Map)kernel.invoke(name, "getInstalledPlugins", new Object[0], new String[0]);
- } catch (Exception e) {
- System.err.println("Unable to get installed plugins: "+e.getMessage());
- e.printStackTrace();
- }
+ PluginInstaller installer = (PluginInstaller) kernel.getProxyManager().createProxy(name, PluginInstaller.class);
+ Map result = installer.getInstalledPlugins();
+ kernel.getProxyManager().destroyProxy(installer);
+ return result;
}
return null;
}
- public ConfigurationArchiveData getPluginMetadata(Artifact configId) {
- Set set = kernel.listGBeans(new AbstractNameQuery("org.apache.geronimo.system.configuration.ConfigurationInstaller"));
+ public PluginMetadata getPluginMetadata(Artifact configId) {
+ Set set = kernel.listGBeans(new AbstractNameQuery(PluginInstaller.class.getName()));
for (Iterator it = set.iterator(); it.hasNext();) {
AbstractName name = (AbstractName) it.next();
- try {
- return (ConfigurationArchiveData)kernel.invoke(name, "getPluginMetadata", new Object[]{configId}, new String[]{Artifact.class.getName()});
- } catch (Exception e) {
- System.err.println("Unable to get plugin metadata: "+e.getMessage());
- e.printStackTrace();
- }
+ PluginInstaller installer = (PluginInstaller) kernel.getProxyManager().createProxy(name, PluginInstaller.class);
+ PluginMetadata result = installer.getPluginMetadata(configId);
+ kernel.getProxyManager().destroyProxy(installer);
+ return result;
}
return null;
}
- public void updatePluginMetadata(ConfigurationArchiveData metadata) {
- Set set = kernel.listGBeans(new AbstractNameQuery("org.apache.geronimo.system.configuration.ConfigurationInstaller"));
+ public void updatePluginMetadata(PluginMetadata metadata) {
+ Set set = kernel.listGBeans(new AbstractNameQuery(PluginInstaller.class.getName()));
for (Iterator it = set.iterator(); it.hasNext();) {
AbstractName name = (AbstractName) it.next();
- try {
- kernel.invoke(name, "updatePluginMetadata", new Object[]{metadata}, new String[]{ConfigurationArchiveData.class.getName()});
- } catch (Exception e) {
- System.err.println("Unable to check on configuration install: "+e.getMessage());
- e.printStackTrace();
- }
+ PluginInstaller installer = (PluginInstaller) kernel.getProxyManager().createProxy(name, PluginInstaller.class);
+ installer.updatePluginMetadata(metadata);
+ kernel.getProxyManager().destroyProxy(installer);
+ return;
+ }
+ }
+
+ public URL[] getRepositories() {
+ List list = new ArrayList();
+ Set set = kernel.listGBeans(new AbstractNameQuery(PluginRepositoryList.class.getName()));
+ for (Iterator it = set.iterator(); it.hasNext();) {
+ AbstractName name = (AbstractName) it.next();
+ PluginRepositoryList repo = (PluginRepositoryList) kernel.getProxyManager().createProxy(name, PluginRepositoryList.class);
+ list.addAll(Arrays.asList(repo.getRepositories()));
+ kernel.getProxyManager().destroyProxy(repo);
}
+ return (URL[]) list.toArray(new URL[list.size()]);
}
}
Modified: geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandInstallCAR.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandInstallCAR.java?rev=399534&r1=399533&r2=399534&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandInstallCAR.java (original)
+++ geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandInstallCAR.java Wed May 3 21:09:17 2006
@@ -22,7 +22,7 @@
import org.apache.geronimo.common.DeploymentException;
import org.apache.geronimo.deployment.plugin.GeronimoDeploymentManager;
import org.apache.geronimo.kernel.repository.Artifact;
-import org.apache.geronimo.system.configuration.DownloadResults;
+import org.apache.geronimo.system.plugin.DownloadResults;
/**
* The CLI deployer logic to start.
Modified: geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandListConfigurations.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandListConfigurations.java?rev=399534&r1=399533&r2=399534&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandListConfigurations.java (original)
+++ geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandListConfigurations.java Wed May 3 21:09:17 2006
@@ -31,9 +31,9 @@
import org.apache.geronimo.common.DeploymentException;
import org.apache.geronimo.deployment.plugin.GeronimoDeploymentManager;
import org.apache.geronimo.kernel.repository.Artifact;
-import org.apache.geronimo.system.configuration.ConfigurationList;
-import org.apache.geronimo.system.configuration.ConfigurationMetadata;
-import org.apache.geronimo.system.configuration.DownloadResults;
+import org.apache.geronimo.system.plugin.DownloadResults;
+import org.apache.geronimo.system.plugin.PluginList;
+import org.apache.geronimo.system.plugin.PluginMetadata;
/**
* The CLI deployer logic to start.
@@ -42,10 +42,14 @@
*/
public class CommandListConfigurations extends AbstractCommand {
public CommandListConfigurations() {
- super("search-plugins", "3. Geronimo Plugins", "MavenRepoURL",
+ super("search-plugins", "3. Geronimo Plugins", "[MavenRepoURL]",
"Lists the Geronimo plugins available in a Maven repository "+
"and lets you select a plugin to download and install. This "+
- "is used to add new functionality to the Geronimo server.");
+ "is used to add new functionality to the Geronimo server. If " +
+ "no repository is specified the default repositories will be " +
+ "listed to select from, but this means there must have been " +
+ "some default repositories set (by hand or by having the " +
+ "console update to the latest defaults).");
}
//todo: provide a way to handle a username and password for the remote repo?
@@ -55,72 +59,75 @@
}
public void execute(PrintWriter out, ServerConnection connection, String[] args) throws DeploymentException {
- if(args.length == 0) {
- throw new DeploymentSyntaxException("Must specify Maven repository URL");
- }
DeploymentManager dmgr = connection.getDeploymentManager();
if(dmgr instanceof GeronimoDeploymentManager) {
GeronimoDeploymentManager mgr = (GeronimoDeploymentManager) dmgr;
- ConfigurationList data;
- URL repository;
try {
- repository = new URL(args[0]);
- data = mgr.listConfigurations(repository, null, null);
- } catch (IOException e) {
- throw new DeploymentException("Unable to list configurations", e);
- } catch (FailedLoginException e) {
- throw new DeploymentException("Invalid login for Maven repository '"+args[0]+"'");
- }
- Map categories = new HashMap();
- List available = new ArrayList();
- for (int i = 0; i < data.getConfigurations().length; i++) {
- ConfigurationMetadata metadata = data.getConfigurations()[i];
- List list = (List) categories.get(metadata.getCategory());
- if(list == null) {
- list = new ArrayList();
- categories.put(metadata.getCategory(), list);
+ String repo = null;
+ if(args.length == 1) {
+ repo = args[0];
+ } else {
+ repo = getRepository(out, new BufferedReader(new InputStreamReader(System.in)), mgr);
}
- list.add(metadata);
- }
- for (Iterator it = categories.entrySet().iterator(); it.hasNext();) {
- Map.Entry entry = (Map.Entry) it.next();
- String category = (String) entry.getKey();
- List items = (List) entry.getValue();
- out.println();
- out.print(DeployUtils.reformat(category, 4, 72));
- for (int i = 0; i < items.size(); i++) {
- ConfigurationMetadata metadata = (ConfigurationMetadata) items.get(i);
- String prefix = " ";
- if(!metadata.isInstalled() && metadata.isEligible()) {
- available.add(metadata);
- prefix = Integer.toString(available.size());
- if(available.size() < 10) {
- prefix += " ";
+ PluginList data;
+ URL repository;
+ try {
+ repository = new URL(repo);
+ data = mgr.listPlugins(repository, null, null);
+ } catch (IOException e) {
+ throw new DeploymentException("Unable to list configurations", e);
+ } catch (FailedLoginException e) {
+ throw new DeploymentException("Invalid login for Maven repository '"+repo+"'");
+ }
+ Map categories = new HashMap();
+ List available = new ArrayList();
+ for (int i = 0; i < data.getPlugins().length; i++) {
+ PluginMetadata metadata = data.getPlugins()[i];
+ List list = (List) categories.get(metadata.getCategory());
+ if(list == null) {
+ list = new ArrayList();
+ categories.put(metadata.getCategory(), list);
+ }
+ list.add(metadata);
+ }
+ for (Iterator it = categories.entrySet().iterator(); it.hasNext();) {
+ Map.Entry entry = (Map.Entry) it.next();
+ String category = (String) entry.getKey();
+ List items = (List) entry.getValue();
+ out.println();
+ out.print(DeployUtils.reformat(category, 4, 72));
+ for (int i = 0; i < items.size(); i++) {
+ PluginMetadata metadata = (PluginMetadata) items.get(i);
+ String prefix = " ";
+ if(!metadata.isInstalled() && metadata.isEligible()) {
+ available.add(metadata);
+ prefix = Integer.toString(available.size());
+ if(available.size() < 10) {
+ prefix += " ";
+ }
+ prefix += ": ";
}
- prefix += ": ";
+ out.print(DeployUtils.reformat(prefix+metadata.getName()+" ("+metadata.getVersion()+")", 8, 72));
+ out.flush();
}
- out.print(DeployUtils.reformat(prefix+metadata.getName()+" ("+metadata.getVersion()+")", 8, 72));
- out.flush();
}
- }
- if(available.size() == 0) {
+ if(available.size() == 0) {
+ out.println();
+ out.println("No plugins from this site are eligible for installation.");
+ return;
+ }
out.println();
- out.println("No plugins from this site are eligible for installation.");
- return;
- }
- out.println();
- out.print("Install Service [enter number or 'q' to quit]: ");
- out.flush();
- try {
+ out.print("Install Service [enter number or 'q' to quit]: ");
+ out.flush();
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String answer = in.readLine();
if(answer.equalsIgnoreCase("q")) {
return;
}
int selection = Integer.parseInt(answer);
- ConfigurationMetadata target = ((ConfigurationMetadata) available.get(selection - 1));
+ PluginMetadata target = ((PluginMetadata) available.get(selection - 1));
long start = System.currentTimeMillis();
- Object key = mgr.startInstall(ConfigurationList.createInstallList(data, target.getConfigId()), null, null);
+ Object key = mgr.startInstall(PluginList.createInstallList(data, target.getModuleId()), null, null);
DownloadResults results = CommandInstallCAR.showProgress(mgr, key);
int time = (int)(System.currentTimeMillis() - start) / 1000;
out.println();
@@ -138,9 +145,9 @@
out.println(DeployUtils.reformat("Downloaded "+(results.getTotalDownloadBytes()/1024)+" kB in "+time+"s ("+results.getTotalDownloadBytes()/(1024*time)+" kB/s)", 4, 72));
}
if(results.isFinished() && !results.isFailed()) {
- out.print(DeployUtils.reformat("Now starting "+target.getConfigId()+"...", 4, 72));
+ out.print(DeployUtils.reformat("Now starting "+target.getModuleId()+"...", 4, 72));
out.flush();
- new CommandStart().execute(out, connection, new String[]{target.getConfigId().toString()});
+ new CommandStart().execute(out, connection, new String[]{target.getModuleId().toString()});
}
} catch (IOException e) {
throw new DeploymentException("Unable to install configuration", e);
@@ -150,5 +157,26 @@
} else {
throw new DeploymentException("Cannot list repositories when connected to "+connection.getServerURI());
}
+ }
+
+ private String getRepository(PrintWriter out, BufferedReader in, GeronimoDeploymentManager mgr) throws IOException, DeploymentException {
+ URL[] all = mgr.getRepositories();
+ if(all.length == 0) {
+ throw new DeploymentException("No default repositories available. Please either specify the repository " +
+ "URL on the command line, or go into the console Plugin page and update the list of available " +
+ "repositories.");
+ }
+ out.println();
+ out.println("Select repository:");
+ for (int i = 0; i < all.length; i++) {
+ URL url = all[i];
+ out.println(" "+(i+1)+". "+url);
+ }
+ out.println();
+ out.print("Enter Repository Number: ");
+ out.flush();
+ String entry = in.readLine().trim();
+ int index = Integer.parseInt(entry);
+ return all[index-1].toString();
}
}
Modified: geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEServerImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEServerImpl.java?rev=399534&r1=399533&r2=399534&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEServerImpl.java (original)
+++ geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEServerImpl.java Wed May 3 21:09:17 2006
@@ -27,7 +27,6 @@
import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
import org.apache.geronimo.kernel.ObjectNameUtil;
import org.apache.geronimo.kernel.config.ConfigurationManager;
-import org.apache.geronimo.kernel.repository.Repository;
import org.apache.geronimo.kernel.repository.ListableRepository;
import org.apache.geronimo.kernel.repository.WritableListableRepository;
import org.apache.geronimo.management.AppClientModule;
@@ -45,9 +44,10 @@
import org.apache.geronimo.management.geronimo.SecurityRealm;
import org.apache.geronimo.management.geronimo.WebManager;
import org.apache.geronimo.management.geronimo.WebModule;
-import org.apache.geronimo.system.configuration.ConfigurationInstaller;
import org.apache.geronimo.system.serverinfo.ServerInfo;
import org.apache.geronimo.system.threads.ThreadPool;
+import org.apache.geronimo.system.plugin.PluginInstaller;
+import org.apache.geronimo.system.plugin.PluginRepositoryList;
/**
* @version $Rev$ $Date$
@@ -68,33 +68,35 @@
private final Collection jmsManagers;
private final Collection threadPools;
private final Collection repositories;
+ private final Collection pluginRepoLists;
private final Collection writableRepos;
private final Collection securityRealms;
private final Collection loginServices;
private final Collection keystoreManagers;
- private final ConfigurationInstaller configurationInstaller;
+ private final PluginInstaller pluginInstaller;
private final ConfigurationManager configurationManager;
public J2EEServerImpl(String objectName,
- ServerInfo serverInfo,
- Collection jvms,
- Collection resources,
- Collection applications,
- Collection appClientModules,
- Collection webModules,
- Collection ejbModules,
- Collection resourceAdapterModules,
- Collection webManagers,
- Collection ejbManagers,
- Collection jmsManagers,
- Collection threadPools,
- Collection repositories,
- Collection writableRepos,
- Collection securityRealms,
- Collection loginServices,
- Collection keystoreManagers,
- ConfigurationInstaller configurationInstaller,
- ConfigurationManager configurationManager) {
+ ServerInfo serverInfo,
+ Collection jvms,
+ Collection resources,
+ Collection applications,
+ Collection appClientModules,
+ Collection webModules,
+ Collection ejbModules,
+ Collection resourceAdapterModules,
+ Collection webManagers,
+ Collection ejbManagers,
+ Collection jmsManagers,
+ Collection threadPools,
+ Collection repositories,
+ Collection writableRepos,
+ Collection securityRealms,
+ Collection loginServices,
+ Collection keystoreManagers,
+ PluginInstaller configurationInstaller,
+ ConfigurationManager configurationManager,
+ Collection pluginRepoLists) {
this.objectName = objectName;
ObjectName myObjectName = ObjectNameUtil.getObjectName(this.objectName);
@@ -120,8 +122,9 @@
this.securityRealms = securityRealms;
this.loginServices = loginServices;
this.keystoreManagers = keystoreManagers;
- this.configurationInstaller = configurationInstaller;
+ this.pluginInstaller = configurationInstaller;
this.configurationManager = configurationManager;
+ this.pluginRepoLists = pluginRepoLists;
}
public String getObjectName() {
@@ -266,6 +269,11 @@
return (SecurityRealm[]) securityRealms.toArray(new SecurityRealm[securityRealms.size()]);
}
+ public PluginRepositoryList[] getPluginRepositoryLists() {
+ if (pluginRepoLists == null) return new PluginRepositoryList[0];
+ return (PluginRepositoryList[]) pluginRepoLists.toArray(new PluginRepositoryList[pluginRepoLists.size()]);
+ }
+
public ServerInfo getServerInfo() {
return serverInfo;
}
@@ -280,8 +288,8 @@
return (KeystoreManager) keystoreManagers.iterator().next();
}
- public ConfigurationInstaller getConfigurationInstaller() {
- return configurationInstaller;
+ public PluginInstaller getPluginInstaller() {
+ return pluginInstaller;
}
public ConfigurationManager getConfigurationManager() {
@@ -318,7 +326,8 @@
infoFactory.addReference("SecurityRealms", SecurityRealm.class);
infoFactory.addReference("LoginServices", LoginService.class);
infoFactory.addReference("KeystoreManagers", KeystoreManager.class);
- infoFactory.addReference("ConfigurationInstaller", ConfigurationInstaller.class);
+ infoFactory.addReference("PluginInstaller", PluginInstaller.class);
+ infoFactory.addReference("PluginRepoLists", PluginRepositoryList.class);
infoFactory.addReference("ConfigurationManager", ConfigurationManager.class);
infoFactory.setConstructor(new String[]{
@@ -340,8 +349,9 @@
"SecurityRealms",
"LoginServices",
"KeystoreManagers",
- "ConfigurationInstaller",
+ "PluginInstaller",
"ConfigurationManager",
+ "PluginRepoLists",
});
GBEAN_INFO = infoFactory.getBeanInfo();
Modified: geronimo/branches/1.1/modules/j2ee/src/test/org/apache/geronimo/j2ee/management/Abstract77Test.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee/src/test/org/apache/geronimo/j2ee/management/Abstract77Test.java?rev=399534&r1=399533&r2=399534&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee/src/test/org/apache/geronimo/j2ee/management/Abstract77Test.java (original)
+++ geronimo/branches/1.1/modules/j2ee/src/test/org/apache/geronimo/j2ee/management/Abstract77Test.java Wed May 3 21:09:17 2006
@@ -39,6 +39,8 @@
import org.apache.geronimo.kernel.Kernel;
import org.apache.geronimo.kernel.repository.Artifact;
import org.apache.geronimo.system.serverinfo.BasicServerInfo;
+import org.apache.geronimo.system.plugin.PluginInstaller;
+import org.apache.geronimo.system.plugin.PluginRepositoryList;
import org.apache.geronimo.management.J2EEResource;
import org.apache.geronimo.management.EJBModule;
import org.apache.geronimo.management.AppClientModule;
@@ -53,7 +55,7 @@
import org.apache.log4j.PatternLayout;
/**
- * @version $Rev: 386505 $ $Date$
+ * @version $Rev$ $Date$
*/
public abstract class Abstract77Test extends TestCase {
protected static final GBeanData SERVER_INFO_DATA = buildGBeanData(new String[] {"role"}, new String[] {"ServerInfo"}, BasicServerInfo.getGBeanInfo());
@@ -122,6 +124,9 @@
SERVER_DATA.setReferencePatterns("EJBModules", new ReferencePatterns(new AbstractNameQuery(EJBModule.class.getName())));
SERVER_DATA.setReferencePatterns("ResourceAdapterModules", new ReferencePatterns(new AbstractNameQuery(ResourceAdapterModule.class.getName())));
SERVER_DATA.setReferencePatterns("WebModules", new ReferencePatterns(new AbstractNameQuery(WebModule.class.getName())));
+ // Can't test, there are none of these available
+ //SERVER_DATA.setReferencePatterns("PluginInstaller", new ReferencePatterns(new AbstractNameQuery(PluginInstaller.class.getName())));
+ SERVER_DATA.setReferencePatterns("PluginRepoLists", new ReferencePatterns(new AbstractNameQuery(PluginRepositoryList.class.getName())));
kernel.loadGBean(SERVER_DATA, classLoader);
// JVM
Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/repository/FileWriteMonitor.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/repository/FileWriteMonitor.java?rev=399534&r1=399533&r2=399534&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/repository/FileWriteMonitor.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/repository/FileWriteMonitor.java Wed May 3 21:09:17 2006
@@ -30,6 +30,15 @@
* known, this will be set to a negative number.
*/
public void writeStarted(String fileDescription, int fileSize);
+
+ /**
+ * The running count of bytes written.
+ */
public void writeProgress(int bytes);
+
+ /**
+ * Indicates that the write completed with the specified number
+ * of total bytes.
+ */
public void writeComplete(int bytes);
}
Modified: geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/J2EEServer.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/J2EEServer.java?rev=399534&r1=399533&r2=399534&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/J2EEServer.java (original)
+++ geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/J2EEServer.java Wed May 3 21:09:17 2006
@@ -20,13 +20,13 @@
import org.apache.geronimo.management.J2EEResource;
import org.apache.geronimo.management.AppClientModule;
import org.apache.geronimo.management.EJBModule;
-import org.apache.geronimo.kernel.repository.Repository;
import org.apache.geronimo.kernel.repository.ListableRepository;
import org.apache.geronimo.kernel.repository.WritableListableRepository;
import org.apache.geronimo.kernel.config.ConfigurationManager;
import org.apache.geronimo.system.serverinfo.ServerInfo;
-import org.apache.geronimo.system.configuration.ConfigurationInstaller;
import org.apache.geronimo.system.threads.ThreadPool;
+import org.apache.geronimo.system.plugin.PluginInstaller;
+import org.apache.geronimo.system.plugin.PluginRepositoryList;
/**
* Geronimo-specific extensions to the standard J2EE server management
@@ -75,10 +75,7 @@
public JMSManager[] getJMSManagers();
/**
- * Gets the ObjectNames of the thread pools associated with this
- * J2EEServer.
- *
- * @return The ObjectNames of the thread pools, in String form.
+ * Gets the thread pools associated with this J2EEServer.
*/
public ThreadPool[] getThreadPools();
@@ -94,8 +91,6 @@
/**
* Gets the SecurityRealms associated with this J2EEServer.
- *
- * @return The ObjectNames of the realms, in String form.
*/
public SecurityRealm[] getSecurityRealms();
@@ -105,38 +100,52 @@
public ServerInfo getServerInfo();
/**
- * Gets the ObjectName of the LoginService associated with this
- * J2EEServer.
- *
- * @return The ObjectName of the LoginService, in String form.
+ * Gets the LoginService associated with this J2EEServer.
*/
public LoginService getLoginService();
/**
- * Gets the ObjectName of the KeystoreManager associated with this
- * J2EEServer.
- *
- * @return The ObjectName of the KeystoreManager, in String form.
+ * Gets the KeystoreManager associated with this J2EEServer.
*/
public KeystoreManager getKeystoreManager();
/**
- * Gets the ConfigurationInstaller associated with this J2EEServer.
+ * Gets the lists of plugin repositories available in this server.
*/
- public ConfigurationInstaller getConfigurationInstaller();
+ public PluginRepositoryList[] getPluginRepositoryLists();
+
+ /**
+ * Gets the PluginInstaller associated with this J2EEServer.
+ */
+ public PluginInstaller getPluginInstaller();
/**
* Gets the ConfigurationManager associated with this J2EEServer.
*/
public ConfigurationManager getConfigurationManager();
+ /**
+ * Gets the applications currently running in this J2EEServer.
+ */
J2EEApplication[] getApplications();
+ /**
+ * Gets the application clients currently running in this J2EEServer.
+ */
AppClientModule[] getAppClients();
+ /**
+ * Gets the web modules currently running in this J2EEServer.
+ */
WebModule[] getWebModules();
+ /**
+ * Gets the EJB modules currently running in this J2EEServer.
+ */
EJBModule[] getEJBModules();
+ /**
+ * Gets the J2EE Connector modules currently running in this J2EEServer.
+ */
ResourceAdapterModule[] getResourceAdapterModules();
}
Modified: geronimo/branches/1.1/modules/system/maven.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/maven.xml?rev=399534&r1=399533&r2=399534&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/maven.xml (original)
+++ geronimo/branches/1.1/modules/system/maven.xml Wed May 3 21:09:17 2006
@@ -29,6 +29,11 @@
</preGoal>
<postGoal name="java:compile">
+ <mkdir dir="${basedir}/target/classes/META-INF" />
+ <mkdir dir="${basedir}/target/classes/META-INF/schema" />
+ <copy todir="${basedir}/target/classes/META-INF/schema">
+ <fileset dir="${basedir}/src/schema/" includes="*.xsd" />
+ </copy>
<!-- generate the version properties file -->
<j:new var="now" className="java.util.Date"/>
<j:new var="dateFormat" className="java.text.SimpleDateFormat">
@@ -45,6 +50,12 @@
build.date=${dateFormat.format(now)}
build.time=${timeFormat.format(now)}
copyright=Copyright (C) 2003-${yearFormat.format(now)}, The Apache Software Foundation
+</ant:echo>
+ <ant:echo file="${basedir}/target/classes/META-INF/product-versions.properties">##### Generated by Maven ####
+geronimo=${geronimo_version}
+activemq=${activemq_version}
+openejb=${openejb_version}
+tranql=${tranql_version}
</ant:echo>
</postGoal>
Modified: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigurationStoreUtil.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigurationStoreUtil.java?rev=399534&r1=399533&r2=399534&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigurationStoreUtil.java (original)
+++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigurationStoreUtil.java Wed May 3 21:09:17 2006
@@ -31,6 +31,9 @@
import org.apache.commons.logging.LogFactory;
/**
+ * Utility methods for dealing with checksums (hashes) of files in the
+ * configuration store.
+ *
* @version $Rev$ $Date$
*/
public class ConfigurationStoreUtil {
@@ -46,7 +49,7 @@
// calculate the checksum
String actualChecksum;
try {
- actualChecksum = calculateChecksum(file);
+ actualChecksum = calculateChecksum(file, "SHA-1");
} catch (NoSuchAlgorithmException e) {
throw new IOException("SHA-1 algorithm not available");
}
@@ -119,19 +122,22 @@
}
public static String getActualChecksum(File file) {
+ return getActualChecksum(file, "SHA-1");
+ }
+ public static String getActualChecksum(File file, String algorithm) {
try {
- return calculateChecksum(file);
+ return calculateChecksum(file, algorithm);
} catch (Exception e) {
log.error("Unable to calculate checksum for configuration file: " + file.getAbsolutePath(), e);
}
return null;
}
- private static String calculateChecksum(File file) throws NoSuchAlgorithmException, IOException {
+ private static String calculateChecksum(File file, String algorithm) throws NoSuchAlgorithmException, IOException {
InputStream stream = new FileInputStream(file);
try {
- MessageDigest digester = MessageDigest.getInstance("SHA-1");
+ MessageDigest digester = MessageDigest.getInstance(algorithm);
digester.reset();
byte buf[] = new byte[4096];
Copied: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/plugin/DownloadPoller.java (from r399072, geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/DownloadPoller.java)
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/plugin/DownloadPoller.java?p2=geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/plugin/DownloadPoller.java&p1=geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/DownloadPoller.java&r1=399072&r2=399534&rev=399534&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/DownloadPoller.java (original)
+++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/plugin/DownloadPoller.java Wed May 3 21:09:17 2006
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.geronimo.system.configuration;
+package org.apache.geronimo.system.plugin;
import org.apache.geronimo.kernel.repository.Artifact;
@@ -22,7 +22,7 @@
* An interface for callers who want to monitor the progress of an installation.
* These are all callbacks sent by the server.
*
- * @see ConfigurationInstaller
+ * @see PluginInstaller
*
* @version $Rev: 46019 $ $Date: 2004-09-14 05:56:06 -0400 (Tue, 14 Sep 2004) $
*/
Copied: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/plugin/DownloadResults.java (from r399072, geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/DownloadResults.java)
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/plugin/DownloadResults.java?p2=geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/plugin/DownloadResults.java&p1=geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/DownloadResults.java&r1=399072&r2=399534&rev=399534&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/DownloadResults.java (original)
+++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/plugin/DownloadResults.java Wed May 3 21:09:17 2006
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.geronimo.system.configuration;
+package org.apache.geronimo.system.plugin;
import java.io.Serializable;
import java.util.List;
Copied: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/plugin/PluginInstaller.java (from r399072, geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigurationInstaller.java)
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/plugin/PluginInstaller.java?p2=geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/plugin/PluginInstaller.java&p1=geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigurationInstaller.java&r1=399072&r2=399534&rev=399534&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigurationInstaller.java (original)
+++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/plugin/PluginInstaller.java Wed May 3 21:09:17 2006
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.geronimo.system.configuration;
+package org.apache.geronimo.system.plugin;
import java.io.IOException;
import java.io.File;
@@ -28,16 +28,18 @@
*
* @version $Rev: 46019 $ $Date: 2004-09-14 05:56:06 -0400 (Tue, 14 Sep 2004) $
*/
-public interface ConfigurationInstaller {
+public interface PluginInstaller {
/**
- * Lists the configurations available for download in a particular Geronimo repository.
- * @param mavenRepository The base URL to the maven repository
+ * Lists the plugins available for download in a particular Geronimo repository.
+ *
+ * @param mavenRepository The base URL to the maven repository. This must
+ * contain the file geronimo-plugins.xml
* @param username Optional username, if the maven repo uses HTTP Basic authentication.
* Set this to null if no authentication is required.
* @param password Optional password, if the maven repo uses HTTP Basic authentication.
* Set this to null if no authentication is required.
*/
- public ConfigurationList listConfigurations(URL mavenRepository, String username, String password) throws IOException, FailedLoginException;
+ public PluginList listPlugins(URL mavenRepository, String username, String password) throws IOException, FailedLoginException;
/**
* Lists the plugins installed in the local Geronimo server, by name and
@@ -53,11 +55,11 @@
* server. Should load a saved one if available, or else create a new
* default one to the best of its abilities.
*
- * @param configId Identifies the configuration. This must match a
+ * @param moduleId Identifies the configuration. This must match a
* configuration currently installed in the local server.
* The configId must be fully resolved (isResolved() == true)
*/
- public ConfigurationArchiveData getPluginMetadata(Artifact configId);
+ public PluginMetadata getPluginMetadata(Artifact moduleId);
/**
* Saves a ConfigurationMetadata for a particular plugin, if the server is
@@ -69,7 +71,7 @@
* be fully resolved) identifies the configuration to save
* this for.
*/
- public void updatePluginMetadata(ConfigurationArchiveData metadata);
+ public void updatePluginMetadata(PluginMetadata metadata);
/**
* Installs a configuration from a remote repository into the local Geronimo server,
@@ -81,9 +83,9 @@
* Set this to null if no authentication is required.
* @param password Optional password, if the maven repo uses HTTP Basic authentication.
* Set this to null if no authentication is required.
- * @param configsToInstall The list of configurations to install
+ * @param pluginsToInstall The list of configurations to install
*/
- public DownloadResults install(ConfigurationList configsToInstall, String username, String password);
+ public DownloadResults install(PluginList pluginsToInstall, String username, String password);
/**
* Installs a configuration from a remote repository into the local Geronimo server,
@@ -94,14 +96,14 @@
* throw exceptions on failure, but instead sets the failure property of the
* DownloadPoller.
*
- * @param configsToInstall The list of configurations to install
+ * @param pluginsToInstall The list of configurations to install
* @param username Optional username, if the maven repo uses HTTP Basic authentication.
* Set this to null if no authentication is required.
* @param password Optional password, if the maven repo uses HTTP Basic authentication.
* Set this to null if no authentication is required.
* @param poller Will be notified with status updates as the download proceeds
*/
- public void install(ConfigurationList configsToInstall, String username, String password, DownloadPoller poller);
+ public void install(PluginList pluginsToInstall, String username, String password, DownloadPoller poller);
/**
* Installs a configuration from a remote repository into the local Geronimo server,
@@ -110,7 +112,7 @@
* installation does not throw exceptions on failure, but instead sets the failure
* property of the DownloadResults that the caller can poll for.
*
- * @param configsToInstall The list of configurations to install
+ * @param pluginsToInstall The list of configurations to install
* @param username Optional username, if the maven repo uses HTTP Basic authentication.
* Set this to null if no authentication is required.
* @param password Optional password, if the maven repo uses HTTP Basic authentication.
@@ -118,7 +120,7 @@
*
* @return A key that can be passed to checkOnInstall
*/
- public Object startInstall(ConfigurationList configsToInstall, String username, String password);
+ public Object startInstall(PluginList pluginsToInstall, String username, String password);
/**
* Installs a configuration downloaded from a remote repository into the local Geronimo