geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r396287 - in /geronimo/branches/1.1: applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/ applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/activemqCF/ applications/console-s...
Date Sun, 23 Apr 2006 15:45:55 GMT
Author: ammulder
Date: Sun Apr 23 08:45:52 2006
New Revision: 396287

URL: http://svn.apache.org/viewcvs?rev=396287&view=rev
Log:
Fix breakage in repository lookups caused by change to base navigation
  on references instead of lookups.
Fix database driver download AJAX so it doesn't do all its work while
  hanging on a page submit, and also removes the usage of the unrelated
  config installer helper class.
Make the file copy monitor interface take an argument for the size of
  the file to copy.  Change various things to pass the size along so
  it can be populated in the monitor.
Fix a doc typo.

Added:
    geronimo/branches/1.1/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/downloadStatus.jsp
Modified:
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DriverDownloader.java
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/activemqCF/ActiveMQConnectorHelper.java
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/SelectProviderHandler.java
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/repository/RepositoryViewPortlet.java
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/securitymanager/realm/SecurityRealmPortlet.java
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/util/PortletManager.java
    geronimo/branches/1.1/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/selectDownload.jsp
    geronimo/branches/1.1/configs/j2ee-server/src/plan/plan.xml
    geronimo/branches/1.1/etc/project.properties
    geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEServerImpl.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/repository/ArtifactTypeHandler.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/repository/FileWriteMonitor.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/repository/WriteableRepository.java
    geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/J2EEManagedObject.java
    geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/J2EEServer.java
    geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigInstallerGBean.java
    geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
    geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/repository/AbstractRepository.java
    geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/repository/CopyArtifactTypeHandler.java
    geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/repository/UnpackArtifactTypeHandler.java
    geronimo/branches/1.1/modules/system/src/test/org/apache/geronimo/system/configuration/ConfigInstallerTest.java
    geronimo/branches/1.1/plugins/geronimo-assembly-plugin/project.xml
    geronimo/branches/1.1/plugins/geronimo-assembly-plugin/src/java/org/apache/geronimo/plugin/assembly/BaseConfigInstaller.java

Modified: geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java?rev=396287&r1=396286&r2=396287&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java (original)
+++ geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java Sun Apr 23 08:45:52 2006
@@ -16,6 +16,51 @@
  */
 package org.apache.geronimo.console.databasemanager.wizard;
 
+import java.io.BufferedOutputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.Serializable;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.sql.Connection;
+import java.sql.DatabaseMetaData;
+import java.sql.Driver;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.SortedSet;
+import javax.enterprise.deploy.model.DDBean;
+import javax.enterprise.deploy.model.DDBeanRoot;
+import javax.enterprise.deploy.spi.DeploymentConfiguration;
+import javax.enterprise.deploy.spi.DeploymentManager;
+import javax.enterprise.deploy.spi.Target;
+import javax.enterprise.deploy.spi.TargetModuleID;
+import javax.enterprise.deploy.spi.status.ProgressObject;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.PortletSession;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.WindowState;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
 import org.apache.commons.fileupload.FileItem;
 import org.apache.commons.fileupload.disk.DiskFileItemFactory;
 import org.apache.commons.fileupload.portlet.PortletFileUpload;
@@ -39,6 +84,7 @@
 import org.apache.geronimo.converter.jboss.JBoss4DatabaseConverter;
 import org.apache.geronimo.deployment.service.jsr88.EnvironmentData;
 import org.apache.geronimo.deployment.tools.loader.ConnectorDeployable;
+import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.kernel.proxy.GeronimoManagedBean;
@@ -49,60 +95,12 @@
 import org.apache.geronimo.kernel.repository.WriteableRepository;
 import org.apache.geronimo.management.geronimo.JCAManagedConnectionFactory;
 import org.apache.geronimo.management.geronimo.ResourceAdapterModule;
-import org.apache.geronimo.system.configuration.DownloadResults;
-import org.apache.geronimo.gbean.AbstractName;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 import org.xml.sax.InputSource;
 
-import javax.enterprise.deploy.model.DDBean;
-import javax.enterprise.deploy.model.DDBeanRoot;
-import javax.enterprise.deploy.spi.DeploymentConfiguration;
-import javax.enterprise.deploy.spi.DeploymentManager;
-import javax.enterprise.deploy.spi.Target;
-import javax.enterprise.deploy.spi.TargetModuleID;
-import javax.enterprise.deploy.spi.status.ProgressObject;
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.PortletConfig;
-import javax.portlet.PortletException;
-import javax.portlet.PortletRequest;
-import javax.portlet.PortletRequestDispatcher;
-import javax.portlet.PortletSession;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import javax.portlet.WindowState;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import java.io.BufferedOutputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.Serializable;
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.net.URI;
-import java.sql.Connection;
-import java.sql.DatabaseMetaData;
-import java.sql.Driver;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.SortedSet;
-
 /**
  * A portlet that lets you configure and deploy JDBC connection pools.
  *
@@ -121,6 +119,7 @@
     private static final String CONFIRM_URL_VIEW     = "/WEB-INF/view/dbwizard/confirmURL.jsp";
     private static final String TEST_CONNECTION_VIEW = "/WEB-INF/view/dbwizard/testConnection.jsp";
     private static final String DOWNLOAD_VIEW        = "/WEB-INF/view/dbwizard/selectDownload.jsp";
+    private static final String DOWNLOAD_STATUS_VIEW = "/WEB-INF/view/dbwizard/downloadStatus.jsp";
     private static final String SHOW_PLAN_VIEW       = "/WEB-INF/view/dbwizard/showPlan.jsp";
     private static final String IMPORT_UPLOAD_VIEW   = "/WEB-INF/view/dbwizard/importUpload.jsp";
     private static final String IMPORT_STATUS_VIEW   = "/WEB-INF/view/dbwizard/importStatus.jsp";
@@ -133,6 +132,7 @@
     private static final String TEST_CONNECTION_MODE = "test";
     private static final String SHOW_PLAN_MODE       = "plan";
     private static final String DOWNLOAD_MODE        = "download";
+    private static final String DOWNLOAD_STATUS_MODE = "downloadStatus";
     private static final String EDIT_EXISTING_MODE   = "editExisting";
     private static final String SAVE_MODE            = "save";
     private static final String IMPORT_START_MODE    = "startImport";
@@ -151,6 +151,7 @@
     private PortletRequestDispatcher confirmURLView;
     private PortletRequestDispatcher testConnectionView;
     private PortletRequestDispatcher downloadView;
+    private PortletRequestDispatcher downloadStatusView;
     private PortletRequestDispatcher planView;
     private PortletRequestDispatcher importUploadView;
     private PortletRequestDispatcher importStatusView;
@@ -165,6 +166,7 @@
         confirmURLView = portletConfig.getPortletContext().getRequestDispatcher(CONFIRM_URL_VIEW);
         testConnectionView = portletConfig.getPortletContext().getRequestDispatcher(TEST_CONNECTION_VIEW);
         downloadView = portletConfig.getPortletContext().getRequestDispatcher(DOWNLOAD_VIEW);
+        downloadStatusView = portletConfig.getPortletContext().getRequestDispatcher(DOWNLOAD_STATUS_VIEW);
         planView = portletConfig.getPortletContext().getRequestDispatcher(SHOW_PLAN_VIEW);
         importUploadView = portletConfig.getPortletContext().getRequestDispatcher(IMPORT_UPLOAD_VIEW);
         importStatusView = portletConfig.getPortletContext().getRequestDispatcher(IMPORT_STATUS_VIEW);
@@ -179,6 +181,7 @@
         confirmURLView = null;
         testConnectionView = null;
         downloadView = null;
+        downloadStatusView = null;
         planView = null;
         importUploadView = null;
         importStatusView = null;
@@ -275,45 +278,19 @@
                 }
             }
             if(found != null) {
-                DriverDownloader downloader = new DriverDownloader();
-                WriteableRepository repo = PortletManager.getWritableRepositories(actionRequest)[0];
-                try {
-                    final PortletSession session = actionRequest.getPortletSession();
-                    ProgressInfo progressInfo = new ProgressInfo();
-                    progressInfo.setMainMessage("Downloading " + found.getName());
-                    session.setAttribute(ProgressInfo.PROGRESS_INFO_KEY, progressInfo, PortletSession.APPLICATION_SCOPE);
-                    final DownloadResults downloadResults = new DownloadResults(); 
-                    downloader.loadDriver(repo, found, downloadResults, new FileWriteMonitor() {
-                    	
-                        public void writeStarted(String fileDescription) {
-                            System.out.println("Downloading "+fileDescription);
-                        }
-
-                        public void writeProgress(int bytes) {
-                            System.out.print("\rDownload progress: "+(bytes/1024)+"kB");
-                            System.out.flush();
-                            ProgressInfo progressInfo = (ProgressInfo)session.getAttribute(ProgressInfo.PROGRESS_INFO_KEY);
-                            int totalBytes = (int)downloadResults.getTotalDownloadBytes();
-                            int kbDownloaded = (int)Math.floor(bytes/1024);
-                            if (totalBytes > 0) {
-                            	int percent = (bytes*100)/totalBytes;
-                            	progressInfo.setProgressPercent(percent);
-                                progressInfo.setSubMessage(kbDownloaded + " / " + totalBytes/1024 + " Kb downloaded");
-                            } else {
-                                progressInfo.setSubMessage(kbDownloaded + " Kb downloaded");
-                            }
-                        }
-
-                        public void writeComplete(int bytes) {
-                            System.out.println();
-                            System.out.println("Finished downloading "+bytes+"b");
-                        }
-                    });
-                    data.jar1 = found.getRepositoryURI();
-                } catch (IOException e) {
-                    log.error("Unable to download JDBC driver", e);
-                }
+                data.jar1 = found.getRepositoryURI();
+                WriteableRepository repo = PortletManager.getCurrentServer(actionRequest).getWritableRepositories()[0];
+                final PortletSession session = actionRequest.getPortletSession();
+                ProgressInfo progressInfo = new ProgressInfo();
+                progressInfo.setMainMessage("Downloading " + found.getName());
+                session.setAttribute(ProgressInfo.PROGRESS_INFO_KEY, progressInfo, PortletSession.APPLICATION_SCOPE);
+                // Start the download monitoring
+                new Thread(new Downloader(found, progressInfo, repo)).start();
+                actionResponse.setRenderParameter(MODE_KEY, DOWNLOAD_STATUS_MODE);
+            } else {
+                actionResponse.setRenderParameter(MODE_KEY, DOWNLOAD_MODE);
             }
+        } else if(mode.equals("process-"+DOWNLOAD_STATUS_MODE)) {
             if(data.getDbtype() == null || data.getDbtype().equals("Other")) {
                 actionResponse.setRenderParameter(MODE_KEY, EDIT_MODE);
             } else {
@@ -403,6 +380,51 @@
         data.store(actionResponse);
     }
 
+    private static class Downloader implements Runnable {
+        private WriteableRepository repo;
+        private DriverDownloader.DriverInfo driver;
+        private ProgressInfo progressInfo;
+
+        public Downloader(DriverDownloader.DriverInfo driver, ProgressInfo progressInfo, WriteableRepository repo) {
+            this.driver = driver;
+            this.progressInfo = progressInfo;
+            this.repo = repo;
+        }
+
+        public void run() {
+            DriverDownloader downloader = new DriverDownloader();
+            try {
+                downloader.loadDriver(repo, driver, new FileWriteMonitor() {
+                    private int fileSize;
+
+                    public void writeStarted(String fileDescription, int fileSize) {
+                        this.fileSize = fileSize;
+                        log.info("Downloading "+fileDescription);
+                    }
+
+                    public void writeProgress(int bytes) {
+                        int kbDownloaded = (int)Math.floor(bytes/1024);
+                        if (fileSize > 0) {
+                            int percent = (bytes*100)/fileSize;
+                            progressInfo.setProgressPercent(percent);
+                            progressInfo.setSubMessage(kbDownloaded + " / " + fileSize/1024 + " Kb downloaded");
+                        } else {
+                            progressInfo.setSubMessage(kbDownloaded + " Kb downloaded");
+                        }
+                    }
+
+                    public void writeComplete(int bytes) {
+                        log.info("Finished downloading "+bytes+" b");
+                    }
+                });
+            } catch (IOException e) {
+                log.error("Unable to download database driver", e);
+            } finally {
+                progressInfo.setFinished(true);
+            }
+        }
+    }
+
     private void loadImportedData(PoolData data, ImportStatus.PoolProgress progress) {
         if(!progress.getType().equals(ImportStatus.PoolProgress.TYPE_XA)) {
             JDBCPool pool = (JDBCPool) progress.getPool();
@@ -642,6 +664,8 @@
                 renderSelectRDBMS(renderRequest, renderResponse);
             } else if(mode.equals(DOWNLOAD_MODE)) {
                 renderDownload(renderRequest, renderResponse);
+            } else if(mode.equals(DOWNLOAD_STATUS_MODE)) {
+                renderDownloadStatus(renderRequest, renderResponse);
             } else if(mode.equals(BASIC_PARAMS_MODE)) {
                 renderBasicParams(renderRequest, renderResponse, data);
             } else if(mode.equals(CONFIRM_URL_MODE)) {
@@ -736,6 +760,10 @@
         downloadView.include(renderRequest, renderResponse);
     }
 
+    private void renderDownloadStatus(RenderRequest renderRequest, RenderResponse renderResponse) throws IOException, PortletException {
+        downloadStatusView.include(renderRequest, renderResponse);
+    }
+
     private void renderBasicParams(RenderRequest renderRequest, RenderResponse renderResponse, PoolData data) throws IOException, PortletException {
         loadDriverJARList(renderRequest);
         // Make sure all properties available for the DB are listed
@@ -759,7 +787,7 @@
     private void loadDriverJARList(RenderRequest renderRequest) {
         // List the available JARs
         List list = new ArrayList();
-        ListableRepository[] repos = PortletManager.getListableRepositories(renderRequest);
+        ListableRepository[] repos = PortletManager.getCurrentServer(renderRequest).getRepositories();
         for (int i = 0; i < repos.length; i++) {
             ListableRepository repo = repos[i];
 
@@ -1031,7 +1059,7 @@
             org.apache.geronimo.kernel.repository.Artifact two = data.getJar2() == null ? null : org.apache.geronimo.kernel.repository.Artifact.create(data.getJar2());
             org.apache.geronimo.kernel.repository.Artifact three = data.getJar3() == null ? null : org.apache.geronimo.kernel.repository.Artifact.create(data.getJar3());
 
-            ListableRepository[] repos = PortletManager.getListableRepositories(request);
+            ListableRepository[] repos = PortletManager.getCurrentServer(request).getRepositories();
             for (int i = 0; i < repos.length; i++) {
                 ListableRepository repo = repos[i];
                 if(one != null) {

Modified: geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DriverDownloader.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DriverDownloader.java?rev=396287&r1=396286&r2=396287&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DriverDownloader.java (original)
+++ geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DriverDownloader.java Sun Apr 23 08:45:52 2006
@@ -16,13 +16,6 @@
  */
 package org.apache.geronimo.console.databasemanager.wizard;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.geronimo.kernel.repository.Artifact;
-import org.apache.geronimo.kernel.repository.FileWriteMonitor;
-import org.apache.geronimo.kernel.repository.WriteableRepository;
-import org.apache.geronimo.system.configuration.DownloadResults;
-
 import java.io.BufferedOutputStream;
 import java.io.File;
 import java.io.FileOutputStream;
@@ -42,6 +35,11 @@
 import java.util.Set;
 import java.util.jar.JarEntry;
 import java.util.jar.JarFile;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.kernel.repository.FileWriteMonitor;
+import org.apache.geronimo.kernel.repository.WriteableRepository;
 
 /**
  * A utility that handles listing and downloading available JDBC driver JARs.
@@ -118,7 +116,7 @@
     /**
      * Downloads a driver and loads it into the local repository.
      */
-    public void loadDriver(WriteableRepository repo, DriverInfo driver, DownloadResults downloadResults, FileWriteMonitor monitor) throws IOException {
+    public void loadDriver(WriteableRepository repo, DriverInfo driver, FileWriteMonitor monitor) throws IOException {
         int urlIndex = 0;
         if (driver.urls.length > 1) {
             if (random == null) {
@@ -135,7 +133,7 @@
             int total = 0;
             int threshold = 10240;
             URLConnection uc = url.openConnection();
-            downloadResults.addDownloadBytes(uc.getContentLength());
+            int filesize = uc.getContentLength();
             InputStream net = uc.getInputStream();
             JarFile jar = null;
             File download = null;
@@ -143,7 +141,7 @@
                 download = File.createTempFile("geronimo-driver-download", ".zip");
                 OutputStream out = new BufferedOutputStream(new FileOutputStream(download));
                 if (monitor != null) {
-                    monitor.writeStarted("Download driver archive to " + download);
+                    monitor.writeStarted("Download driver archive to " + download, filesize);
                 }
                 try {
                     while ((size = net.read(buf)) > -1) {
@@ -169,7 +167,7 @@
                     log.error("Cannot extract driver JAR " + driver.unzipPath + " from download file " + url);
                 } else {
                     in = jar.getInputStream(entry);
-                    repo.copyToRepository(in, Artifact.create(uri), monitor);
+                    repo.copyToRepository(in, (int)entry.getSize(), Artifact.create(uri), monitor);
                 }
             } finally {
                 if (jar != null) try {
@@ -182,38 +180,11 @@
                 }
             }
         } else {
-            in = url.openStream();
-            repo.copyToRepository(in, Artifact.create(uri), monitor);
+            URLConnection con = url.openConnection();
+            in = con.getInputStream();
+            repo.copyToRepository(in, con.getContentLength(), Artifact.create(uri), monitor);
         }
     }
-
-//    public static void main(String[] args) {
-//        Random random = new Random();
-//        DriverDownloader test = new DriverDownloader();
-//        try {
-//            DriverInfo[] all = test.loadDriverInfo(new URL("file:///Users/ammulder/driver-downloads.properties"));
-//            org.apache.geronimo.system.serverinfo.ServerInfo info = new org.apache.geronimo.system.serverinfo.BasicServerInfo("/Users/ammulder");
-//            org.apache.geronimo.system.repository.FileSystemRepository repo = new org.apache.geronimo.system.repository.FileSystemRepository(new URI("temp/"), info);
-//            repo.doStart();
-//            test.loadDriver(repo, all[random.nextInt(all.length)], new FileWriteMonitor() {
-//                public void writeStarted(String description) {
-//                    System.out.println("Writing "+description);
-//                }
-//
-//                public void writeProgress(int bytes) {
-//                    System.out.print("\r"+(bytes/1024)+"kB complete");
-//                    System.out.flush();
-//                }
-//
-//                public void writeComplete(int bytes) {
-//                    System.out.println();
-//                    System.out.println("Finished writing: "+bytes+"b");
-//                }
-//            });
-//        } catch (Exception e) {
-//            e.printStackTrace();
-//        }
-//    }
 
     public static class DriverInfo implements Comparable {
         private String name;

Modified: geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/activemqCF/ActiveMQConnectorHelper.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/activemqCF/ActiveMQConnectorHelper.java?rev=396287&r1=396286&r2=396287&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/activemqCF/ActiveMQConnectorHelper.java (original)
+++ geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/activemqCF/ActiveMQConnectorHelper.java Sun Apr 23 08:45:52 2006
@@ -180,7 +180,7 @@
     }
 
     public List getDependencies(PortletRequest request) {
-        ListableRepository[] repo = PortletManager.getListableRepositories(request);
+        ListableRepository[] repo = PortletManager.getCurrentServer(request).getRepositories();
         List dependencies = new ArrayList();
         for (int i = 0; i < repo.length; i++) {
             ListableRepository repository = repo[i];

Modified: geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/SelectProviderHandler.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/SelectProviderHandler.java?rev=396287&r1=396286&r2=396287&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/SelectProviderHandler.java (original)
+++ geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/SelectProviderHandler.java Sun Apr 23 08:45:52 2006
@@ -67,7 +67,7 @@
     private void loadRARList(RenderRequest renderRequest) {
         // List the available RARs
         List list = new ArrayList();
-        ListableRepository[] repos = PortletManager.getListableRepositories(renderRequest);
+        ListableRepository[] repos = PortletManager.getCurrentServer(renderRequest).getRepositories();
         for (int i = 0; i < repos.length; i++) {
             ListableRepository repo = repos[i];
             final SortedSet artifacts = repo.list();

Modified: geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/repository/RepositoryViewPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/repository/RepositoryViewPortlet.java?rev=396287&r1=396286&r2=396287&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/repository/RepositoryViewPortlet.java (original)
+++ geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/repository/RepositoryViewPortlet.java Sun Apr 23 08:45:52 2006
@@ -78,7 +78,7 @@
 
 
             List list = new ArrayList();
-            WriteableRepository repo = PortletManager.getWritableRepositories(actionRequest)[0];
+            WriteableRepository repo = PortletManager.getCurrentServer(actionRequest).getWritableRepositories()[0];
 
             File uploadFile = null;
             File file = null;
@@ -151,7 +151,7 @@
 
 
                 repo.copyToRepository(file, new Artifact(group, artifact, version, fileType), new FileWriteMonitor() {
-                    public void writeStarted(String fileDescription) {
+                    public void writeStarted(String fileDescription, int fileSize) {
                         System.out.print("Copying into repository " + fileDescription + "...");
                         System.out.flush();
                     }
@@ -180,7 +180,7 @@
 
         try {
             List list = new ArrayList();
-            ListableRepository[] repos = PortletManager.getListableRepositories(request);
+            ListableRepository[] repos = PortletManager.getCurrentServer(request).getRepositories();
             for (int i = 0; i < repos.length; i++) {
                 ListableRepository repo = repos[i];
                 final SortedSet artifacts = repo.list();

Modified: geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/securitymanager/realm/SecurityRealmPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/securitymanager/realm/SecurityRealmPortlet.java?rev=396287&r1=396286&r2=396287&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/securitymanager/realm/SecurityRealmPortlet.java (original)
+++ geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/securitymanager/realm/SecurityRealmPortlet.java Sun Apr 23 08:45:52 2006
@@ -279,7 +279,7 @@
         if(data.jar != null && !data.jar.equals("")) {
             try {
                 Artifact one = Artifact.create(data.getJar());
-                ListableRepository[] repos = PortletManager.getListableRepositories(request);
+                ListableRepository[] repos = PortletManager.getCurrentServer(request).getRepositories();
                 for (int i = 0; i < repos.length; i++) {
                     ListableRepository repo = repos[i];
                     File file = repo.getLocation(one);
@@ -624,7 +624,7 @@
     private void loadDriverJARList(RenderRequest renderRequest) {
         // List the available JARs
         List list = new ArrayList();
-        ListableRepository[] repos = PortletManager.getListableRepositories(renderRequest);
+        ListableRepository[] repos = PortletManager.getCurrentServer(renderRequest).getRepositories();
         for (int i = 0; i < repos.length; i++) {
             ListableRepository repo = repos[i];
 

Modified: geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/util/PortletManager.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/util/PortletManager.java?rev=396287&r1=396286&r2=396287&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/util/PortletManager.java (original)
+++ geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/util/PortletManager.java Sun Apr 23 08:45:52 2006
@@ -161,30 +161,6 @@
         return helper.testLoginModule(getCurrentServer(request), module, options, username, password);
     }
 
-    public static ListableRepository[] getListableRepositories(PortletRequest request) {
-        Repository[] list = getCurrentServer(request).getRepositories();
-        List result = new ArrayList();
-        for (int i = 0; i < list.length; i++) {
-            Repository repository = list[i];
-            if (repository instanceof ListableRepository) {
-                result.add(repository);
-            }
-        }
-        return (ListableRepository[]) result.toArray(new ListableRepository[result.size()]);
-    }
-
-    public static WriteableRepository[] getWritableRepositories(PortletRequest request) {
-        Repository[] list = getCurrentServer(request).getRepositories();
-        List result = new ArrayList();
-        for (int i = 0; i < list.length; i++) {
-            Repository repository = list[i];
-            if (repository instanceof WriteableRepository) {
-                result.add(repository);
-            }
-        }
-        return (WriteableRepository[]) result.toArray(new WriteableRepository[result.size()]);
-    }
-
     public static ResourceAdapterModule[] getOutboundRAModules(PortletRequest request, String iface) {
         ManagementHelper helper = getManagementHelper(request);
         return helper.getOutboundRAModules(getCurrentServer(request), iface);

Added: geronimo/branches/1.1/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/downloadStatus.jsp
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/downloadStatus.jsp?rev=396287&view=auto
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/downloadStatus.jsp (added)
+++ geronimo/branches/1.1/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/downloadStatus.jsp Sun Apr 23 08:45:52 2006
@@ -0,0 +1,45 @@
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
+<portlet:defineObjects/>
+
+<p><b>Create Database Pool</b> -- Driver Download</p>
+
+<p>This page monitors the driver download progress.</p>
+
+<!--   Form that will be submitted when the download is complete   -->
+<form name="<portlet:namespace/>ContinueForm" action="<portlet:actionURL/>" method="POST">
+    <input type="hidden" name="mode" value="process-downloadStatus" />
+    <input type="hidden" name="name" value="${pool.name}" />
+    <input type="hidden" name="dbtype" value="${pool.dbtype}" />
+    <input type="hidden" name="user" value="${pool.user}" />
+    <input type="hidden" name="password" value="${pool.password}" />
+    <input type="hidden" name="driverClass" value="${pool.driverClass}" />
+    <input type="hidden" name="url" value="${pool.url}" />
+    <input type="hidden" name="urlPrototype" value="${pool.urlPrototype}" />
+    <input type="hidden" name="jar1" value="${pool.jar1}" />
+    <input type="hidden" name="jar2" value="${pool.jar2}" />
+    <input type="hidden" name="jar3" value="${pool.jar3}" />
+    <input type="hidden" name="minSize" value="${pool.minSize}" />
+    <input type="hidden" name="maxSize" value="${pool.maxSize}" />
+    <input type="hidden" name="idleTimeout" value="${pool.idleTimeout}" />
+    <input type="hidden" name="blockingTimeout" value="${pool.blockingTimeout}" />
+    <input type="hidden" name="adapterDisplayName" value="${pool.adapterDisplayName}" />
+    <input type="hidden" name="adapterDescription" value="${pool.adapterDescription}" />
+    <input type="hidden" name="rarPath" value="${pool.rarPath}" />
+  <c:forEach var="prop" items="${pool.properties}">
+    <input type="hidden" name="${prop.key}" value="${prop.value}" />
+  </c:forEach>
+  <c:forEach var="prop" items="${pool.urlProperties}">
+    <input type="hidden" name="${prop.key}" value="${prop.value}" />
+  </c:forEach>
+</form>
+
+<%-- Display the download progress bar --%>
+<jsp:include flush="true" page="../ajax/progressbar.jsp"/>
+<script type="text/javascript">
+    <portlet:namespace/>startProgress();
+</script>
+
+<p><a href="<portlet:actionURL portletMode="view">
+              <portlet:param name="mode" value="list" />
+            </portlet:actionURL>">Return to List</a></p>

Modified: geronimo/branches/1.1/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/selectDownload.jsp
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/selectDownload.jsp?rev=396287&r1=396286&r2=396287&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/selectDownload.jsp (original)
+++ geronimo/branches/1.1/applications/console-standard/src/webapp/WEB-INF/view/dbwizard/selectDownload.jsp Sun Apr 23 08:45:52 2006
@@ -64,8 +64,6 @@
     </table>
 </form>
 
-<jsp:include flush="true" page="../ajax/progressbar.jsp"/>
-
 <!--   END OF FORM TO COLLECT DATA FOR THIS PAGE   -->
 
 <%--

Modified: geronimo/branches/1.1/configs/j2ee-server/src/plan/plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/configs/j2ee-server/src/plan/plan.xml?rev=396287&r1=396286&r2=396287&view=diff
==============================================================================
--- geronimo/branches/1.1/configs/j2ee-server/src/plan/plan.xml (original)
+++ geronimo/branches/1.1/configs/j2ee-server/src/plan/plan.xml Sun Apr 23 08:45:52 2006
@@ -149,8 +149,10 @@
         <reference name="WebManagers"/>
         <reference name="EJBManagers"/>
         <reference name="JMSManagers"/>
+        <reference name="JMSManagers"/>
         <reference name="ThreadPools"/>
         <reference name="Repositories"/>
+        <reference name="WritableRepos"/>
         <reference name="SecurityRealms"/>
         <reference name="LoginServices"/>
         <reference name="KeystoreManagers"/>

Modified: geronimo/branches/1.1/etc/project.properties
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/etc/project.properties?rev=396287&r1=396286&r2=396287&view=diff
==============================================================================
--- geronimo/branches/1.1/etc/project.properties (original)
+++ geronimo/branches/1.1/etc/project.properties Sun Apr 23 08:45:52 2006
@@ -96,7 +96,7 @@
 release_notes_version=1.0
 
 geronimo_packaging_plugin_version=1.1.0-7
-geronimo_assembly_plugin_version=1.1.0-10
+geronimo_assembly_plugin_version=1.1.0-11
 geronimo_deployment_plugin_version=1.1.0-2
 geronimo_dependency_plugin_version=1.1.0-3
 

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=396287&r1=396286&r2=396287&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 Sun Apr 23 08:45:52 2006
@@ -28,6 +28,8 @@
 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;
 import org.apache.geronimo.management.EJBModule;
 import org.apache.geronimo.management.J2EEDeployedObject;
@@ -66,6 +68,7 @@
     private final Collection jmsManagers;
     private final Collection threadPools;
     private final Collection repositories;
+    private final Collection writableRepos;
     private final Collection securityRealms;
     private final Collection loginServices;
     private final Collection keystoreManagers;
@@ -86,6 +89,7 @@
             Collection jmsManagers,
             Collection threadPools,
             Collection repositories,
+            Collection writableRepos,
             Collection securityRealms,
             Collection loginServices,
             Collection keystoreManagers,
@@ -112,6 +116,7 @@
 
         this.threadPools = threadPools;
         this.repositories = repositories;
+        this.writableRepos = writableRepos;
         this.securityRealms = securityRealms;
         this.loginServices = loginServices;
         this.keystoreManagers = keystoreManagers;
@@ -246,9 +251,14 @@
         return (ThreadPool[]) threadPools.toArray(new ThreadPool[threadPools.size()]);
     }
 
-    public Repository[] getRepositories() {
-        if (repositories == null) return new Repository[0];
-        return (Repository[]) repositories.toArray(new Repository[repositories.size()]);
+    public ListableRepository[] getRepositories() {
+        if (repositories == null) return new ListableRepository[0];
+        return (ListableRepository[]) repositories.toArray(new ListableRepository[repositories.size()]);
+    }
+
+    public WritableListableRepository[] getWritableRepositories() {
+        if (writableRepos == null) return new WritableListableRepository[0];
+        return (WritableListableRepository[]) writableRepos.toArray(new WritableListableRepository[writableRepos.size()]);
     }
 
     public SecurityRealm[] getSecurityRealms() {
@@ -303,7 +313,8 @@
         infoFactory.addReference("EJBManagers", EJBManager.class);
         infoFactory.addReference("JMSManagers", JMSManager.class);
         infoFactory.addReference("ThreadPools", ThreadPool.class);
-        infoFactory.addReference("Repositories", Repository.class);
+        infoFactory.addReference("Repositories", ListableRepository.class);
+        infoFactory.addReference("WritableRepos", WritableListableRepository.class);
         infoFactory.addReference("SecurityRealms", SecurityRealm.class);
         infoFactory.addReference("LoginServices", LoginService.class);
         infoFactory.addReference("KeystoreManagers", KeystoreManager.class);
@@ -325,6 +336,7 @@
                 "JMSManagers",
                 "ThreadPools",
                 "Repositories",
+                "WritableRepos",
                 "SecurityRealms",
                 "LoginServices",
                 "KeystoreManagers",

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/repository/ArtifactTypeHandler.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/repository/ArtifactTypeHandler.java?rev=396287&r1=396286&r2=396287&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/repository/ArtifactTypeHandler.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/repository/ArtifactTypeHandler.java Sun Apr 23 08:45:52 2006
@@ -24,5 +24,5 @@
  * @version $Rev$ $Date$
  */
 public interface ArtifactTypeHandler {
-    void install(InputStream source, Artifact artifactId, FileWriteMonitor monitor, File target) throws IOException;
+    void install(InputStream source, int size, Artifact artifactId, FileWriteMonitor monitor, File target) throws IOException;
 }

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=396287&r1=396286&r2=396287&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 Sun Apr 23 08:45:52 2006
@@ -22,7 +22,14 @@
  * @version $Rev$ $Date$
  */
 public interface FileWriteMonitor {
-    public void writeStarted(String fileDescription);
+    /**
+     * @param fileSize If it's known ahead of time, this is the total size of
+     *                 the file to be written.  This would typically be the
+     *                 case for a copy operation, for example, but not
+     *                 necessarily for a download.  If the file size is not
+     *                 known, this will be set to a negative number.
+     */
+    public void writeStarted(String fileDescription, int fileSize);
     public void writeProgress(int bytes);
     public void writeComplete(int bytes);
 }

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/repository/WriteableRepository.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/repository/WriteableRepository.java?rev=396287&r1=396286&r2=396287&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/repository/WriteableRepository.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/repository/WriteableRepository.java Sun Apr 23 08:45:52 2006
@@ -55,5 +55,5 @@
      *                     where it should save the data to
      * @param monitor      Tracks the progress of the installation
      */
-    public void copyToRepository(InputStream source, Artifact destination, FileWriteMonitor monitor) throws IOException;
+    public void copyToRepository(InputStream source, int size, Artifact destination, FileWriteMonitor monitor) throws IOException;
 }

Modified: geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/J2EEManagedObject.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/J2EEManagedObject.java?rev=396287&r1=396286&r2=396287&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/J2EEManagedObject.java (original)
+++ geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/J2EEManagedObject.java Sun Apr 23 08:45:52 2006
@@ -43,7 +43,7 @@
     /**
      * Determines if this object implemnts the statistics provider type defined in the J2EE Management specification.
      *
-     * @return true if this class also implements the state manageable type; false otherwise
+     * @return true if this class also implements the statistics provider type; false otherwise
      */
     boolean isStatisticsProvider();
 

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=396287&r1=396286&r2=396287&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 Sun Apr 23 08:45:52 2006
@@ -21,6 +21,8 @@
 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;
@@ -83,7 +85,12 @@
     /**
      * Gets the Repositories associated with this J2EEServer.
      */
-    public Repository[] getRepositories();
+    public ListableRepository[] getRepositories();
+
+    /**
+     * Gets the writable repositories associated with this J2EEServer.
+     */
+    public WritableListableRepository[] getWritableRepositories();
 
     /**
      * Gets the SecurityRealms associated with this J2EEServer.

Modified: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigInstallerGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigInstallerGBean.java?rev=396287&r1=396286&r2=396287&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigInstallerGBean.java (original)
+++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigInstallerGBean.java Sun Apr 23 08:45:52 2006
@@ -682,7 +682,7 @@
         if(matches.length == 0) {
             OpenResult result = openStream(configID, repoURL, backups, username, password, monitor);
             try {
-                writeableRepo.copyToRepository(result.getStream(), result.getConfigID(), monitor); //todo: download SNAPSHOTS if previously available?
+                writeableRepo.copyToRepository(result.getStream(), result.getFileSize(), result.getConfigID(), monitor); //todo: download SNAPSHOTS if previously available?
                 monitor.getResults().addDependencyInstalled(configID);
                 configID = result.getConfigID();
             } finally {
@@ -781,7 +781,7 @@
             log.debug("Attempting to download "+artifact+" from "+url);
             in = connect(url, username, password, monitor);
             if(in != null) {
-                return new OpenResult(artifact, in);
+                return new OpenResult(artifact, in, monitor == null ? -1 : monitor.getTotalBytes());
             }
         }
     }
@@ -924,7 +924,12 @@
             this.totalBytes = totalBytes;
         }
 
-        public void writeStarted(String fileDescription) {
+        public int getTotalBytes() {
+            return totalBytes;
+        }
+
+        public void writeStarted(String fileDescription, int fileSize) {
+            totalBytes = fileSize;
             file = fileDescription;
             results.setCurrentFile(fileDescription);
             results.setCurrentMessage("Downloading "+fileDescription+"...");
@@ -1137,10 +1142,12 @@
     private static class OpenResult {
         private final InputStream stream;
         private final Artifact configID;
+        private final int fileSize;
 
-        public OpenResult(Artifact configID, InputStream stream) {
+        public OpenResult(Artifact configID, InputStream stream, int fileSize) {
             this.configID = configID;
             this.stream = stream;
+            this.fileSize = fileSize;
         }
 
         public Artifact getConfigID() {
@@ -1149,6 +1156,10 @@
 
         public InputStream getStream() {
             return stream;
+        }
+
+        public int getFileSize() {
+            return fileSize;
         }
     }
 

Modified: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java?rev=396287&r1=396286&r2=396287&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java (original)
+++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java Sun Apr 23 08:45:52 2006
@@ -259,9 +259,9 @@
         }
     }
 
-    public void install(InputStream in, Artifact configId, FileWriteMonitor fileWriteMonitor) throws IOException {
+    public void install(InputStream in, int size, Artifact configId, FileWriteMonitor fileWriteMonitor) throws IOException {
         try {
-            repository.copyToRepository(in, configId, fileWriteMonitor);
+            repository.copyToRepository(in, size, configId, fileWriteMonitor);
         } catch (IOException e) {
             throw e;
         } finally {

Modified: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/repository/AbstractRepository.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/repository/AbstractRepository.java?rev=396287&r1=396286&r2=396287&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/repository/AbstractRepository.java (original)
+++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/repository/AbstractRepository.java Sun Apr 23 08:45:52 2006
@@ -177,10 +177,10 @@
         if (!source.exists() || !source.canRead() || source.isDirectory()) {
             throw new IllegalArgumentException("Cannot read source file at " + source.getAbsolutePath());
         }
-        copyToRepository(new FileInputStream(source), destination, monitor);
+        copyToRepository(new FileInputStream(source), (int)source.length(), destination, monitor);
     }
 
-    public void copyToRepository(InputStream source, Artifact destination, FileWriteMonitor monitor) throws IOException {
+    public void copyToRepository(InputStream source, int size, Artifact destination, FileWriteMonitor monitor) throws IOException {
         if(!destination.isResolved()) {
             throw new IllegalArgumentException("Artifact "+destination+" is not fully resolved");
         }
@@ -199,7 +199,7 @@
 
         ArtifactTypeHandler typeHandler = (ArtifactTypeHandler) typeHandlers.get(destination.getType());
         if (typeHandler == null) typeHandler = DEFAULT_TYPE_HANDLER;
-        typeHandler.install(source, destination, monitor, location);
+        typeHandler.install(source, size, destination, monitor, location);
 
         if (destination.getType().equalsIgnoreCase("car")) {
             System.out.println("############################################################");

Modified: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/repository/CopyArtifactTypeHandler.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/repository/CopyArtifactTypeHandler.java?rev=396287&r1=396286&r2=396287&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/repository/CopyArtifactTypeHandler.java (original)
+++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/repository/CopyArtifactTypeHandler.java Sun Apr 23 08:45:52 2006
@@ -34,7 +34,7 @@
     private final static int TRANSFER_NOTIFICATION_SIZE = 10240;  // announce every this many bytes
     private final static int TRANSFER_BUF_SIZE = 10240;  // try this many bytes at a time
 
-    public void install(InputStream source, Artifact artifact, FileWriteMonitor monitor, File target) throws IOException {
+    public void install(InputStream source, int size, Artifact artifact, FileWriteMonitor monitor, File target) throws IOException {
         // assure that the target directory exists
         File parent = target.getParentFile();
         if (!parent.exists() && !parent.mkdirs()) {
@@ -43,7 +43,7 @@
 
         // copy it
         if (monitor != null) {
-            monitor.writeStarted(artifact.toString());
+            monitor.writeStarted(artifact.toString(), size);
         }
         int total = 0;
         try {

Modified: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/repository/UnpackArtifactTypeHandler.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/repository/UnpackArtifactTypeHandler.java?rev=396287&r1=396286&r2=396287&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/repository/UnpackArtifactTypeHandler.java (original)
+++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/repository/UnpackArtifactTypeHandler.java Sun Apr 23 08:45:52 2006
@@ -36,7 +36,7 @@
     private final static int TRANSFER_NOTIFICATION_SIZE = 10240;  // announce every this many bytes
     private final static int TRANSFER_BUF_SIZE = 10240;  // try this many bytes at a time
 
-    public void install(InputStream source, Artifact artifact, FileWriteMonitor monitor, File target) throws IOException {
+    public void install(InputStream source, int size, Artifact artifact, FileWriteMonitor monitor, File target) throws IOException {
         // assure that the target directory exists
         File parent = target.getParentFile();
         if (!parent.exists() && !parent.mkdirs()) {
@@ -45,7 +45,7 @@
 
         // copy it
         if (monitor != null) {
-            monitor.writeStarted(artifact.toString());
+            monitor.writeStarted(artifact.toString(), size);
         }
 
         int total = 0;

Modified: geronimo/branches/1.1/modules/system/src/test/org/apache/geronimo/system/configuration/ConfigInstallerTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/test/org/apache/geronimo/system/configuration/ConfigInstallerTest.java?rev=396287&r1=396286&r2=396287&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/test/org/apache/geronimo/system/configuration/ConfigInstallerTest.java (original)
+++ geronimo/branches/1.1/modules/system/src/test/org/apache/geronimo/system/configuration/ConfigInstallerTest.java Sun Apr 23 08:45:52 2006
@@ -96,7 +96,7 @@
         public void copyToRepository(File source, Artifact destination, FileWriteMonitor monitor) throws IOException {
         }
 
-        public void copyToRepository(InputStream source, Artifact destination, FileWriteMonitor monitor) throws IOException {
+        public void copyToRepository(InputStream source, int size, Artifact destination, FileWriteMonitor monitor) throws IOException {
         }
 
         public boolean contains(Artifact artifact) {

Modified: geronimo/branches/1.1/plugins/geronimo-assembly-plugin/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/plugins/geronimo-assembly-plugin/project.xml?rev=396287&r1=396286&r2=396287&view=diff
==============================================================================
--- geronimo/branches/1.1/plugins/geronimo-assembly-plugin/project.xml (original)
+++ geronimo/branches/1.1/plugins/geronimo-assembly-plugin/project.xml Sun Apr 23 08:45:52 2006
@@ -23,7 +23,7 @@
     <id>geronimo-assembly-plugin</id>
     <name>Geronimo :: Maven Assembly Plugin</name>
     <description>A plugin used to assemble a distribution of Geronimo</description>
-    <currentVersion>1.1.0-10</currentVersion>
+    <currentVersion>1.1.0-11</currentVersion>
 
     <dependencies>
         <dependency>

Modified: geronimo/branches/1.1/plugins/geronimo-assembly-plugin/src/java/org/apache/geronimo/plugin/assembly/BaseConfigInstaller.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/plugins/geronimo-assembly-plugin/src/java/org/apache/geronimo/plugin/assembly/BaseConfigInstaller.java?rev=396287&r1=396286&r2=396287&view=diff
==============================================================================
--- geronimo/branches/1.1/plugins/geronimo-assembly-plugin/src/java/org/apache/geronimo/plugin/assembly/BaseConfigInstaller.java (original)
+++ geronimo/branches/1.1/plugins/geronimo-assembly-plugin/src/java/org/apache/geronimo/plugin/assembly/BaseConfigInstaller.java Sun Apr 23 08:45:52 2006
@@ -168,7 +168,7 @@
                 File sourceFile = sourceRepo.getLocation(configId);
                 InputStream in = new FileInputStream(sourceFile);
                 try {
-                    targetStore.install(in, configId, LOG_COPY_START);
+                    targetStore.install(in, (int)sourceFile.length(), configId, LOG_COPY_START);
                 } finally {
                     in.close();
                 }
@@ -200,7 +200,7 @@
                 File sourceFile = sourceRepo.getLocation(configId);
                 InputStream in = new FileInputStream(sourceFile);
                 try {
-                    targetRepo.copyToRepository(in, configId, LOG_COPY_START);
+                    targetRepo.copyToRepository(in, (int)sourceFile.length(), configId, LOG_COPY_START);
                 } finally {
                     in.close();
                 }
@@ -217,7 +217,7 @@
     }
 
     private static class StartFileWriteMonitor implements FileWriteMonitor {
-        public void writeStarted(String fileDescription) {
+        public void writeStarted(String fileDescription, int fileSize) {
             System.out.println("Copying " + fileDescription);
         }
 



Mime
View raw message