Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 46111 invoked from network); 13 Sep 2010 06:19:58 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 13 Sep 2010 06:19:58 -0000 Received: (qmail 9998 invoked by uid 500); 13 Sep 2010 06:19:58 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 9872 invoked by uid 500); 13 Sep 2010 06:19:55 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 9865 invoked by uid 99); 13 Sep 2010 06:19:54 -0000 Received: from Unknown (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Sep 2010 06:19:54 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Sep 2010 06:19:35 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 05B9723888E7; Mon, 13 Sep 2010 06:19:14 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r996430 - in /geronimo/server/trunk/plugins/hotdeploy/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot: DirectoryHotDeployer.java DirectoryMonitor.java Date: Mon, 13 Sep 2010 06:19:13 -0000 To: scm@geronimo.apache.org From: xuhaihong@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100913061914.05B9723888E7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: xuhaihong Date: Mon Sep 13 06:19:13 2010 New Revision: 996430 URL: http://svn.apache.org/viewvc?rev=996430&view=rev Log: No function changes, fix some warning and use generic type Modified: geronimo/server/trunk/plugins/hotdeploy/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java geronimo/server/trunk/plugins/hotdeploy/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryMonitor.java Modified: geronimo/server/trunk/plugins/hotdeploy/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/hotdeploy/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java?rev=996430&r1=996429&r2=996430&view=diff ============================================================================== --- geronimo/server/trunk/plugins/hotdeploy/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java (original) +++ geronimo/server/trunk/plugins/hotdeploy/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java Mon Sep 13 06:19:13 2010 @@ -216,9 +216,9 @@ public class DirectoryHotDeployer implem } // a bit of a hack, but the PersistentConfigurationList is the only thing that knows whether the server is full started! - Set configLists = kernel.listGBeans(new AbstractNameQuery(PersistentConfigurationList.class.getName())); - for (Iterator i = configLists.iterator(); i.hasNext();) { - AbstractName configListName = (AbstractName) i.next(); + Set configLists = kernel.listGBeans(new AbstractNameQuery(PersistentConfigurationList.class.getName())); + for (Iterator i = configLists.iterator(); i.hasNext();) { + AbstractName configListName = i.next(); try { Boolean result = (Boolean) kernel.getAttribute(configListName, "kernelFullyStarted"); if (!result.booleanValue()) { @@ -354,7 +354,7 @@ public class DirectoryHotDeployer implem mgr = getDeploymentManager(); Target[] targets = mgr.getTargets(); TargetModuleID[] ids = mgr.getAvailableModules(null, targets); - ids = (TargetModuleID[]) DeployUtils.identifyTargetModuleIDs(ids, configId, true).toArray(new TargetModuleID[0]); + ids = DeployUtils.identifyTargetModuleIDs(ids, configId, true).toArray(new TargetModuleID[0]); ProgressObject po = mgr.undeploy(ids); waitForProgress(po); if (po.getDeploymentStatus().isCompleted()) { @@ -381,7 +381,7 @@ public class DirectoryHotDeployer implem public String getModuleId(String config) { DeploymentManager mgr = null; - TargetModuleID[] modules = null; + //TargetModuleID[] modules = null; try { mgr = getDeploymentManager(); Target[] targets = mgr.getTargets(); @@ -409,7 +409,7 @@ public class DirectoryHotDeployer implem mgr = getDeploymentManager(); Target[] targets = mgr.getTargets(); TargetModuleID[] ids = mgr.getAvailableModules(null, targets); - ids = (TargetModuleID[]) DeployUtils.identifyTargetModuleIDs(ids, configId, true).toArray(new TargetModuleID[0]); + ids = DeployUtils.identifyTargetModuleIDs(ids, configId, true).toArray(new TargetModuleID[0]); ProgressObject po; if (JarUtils.isJarFile(file) || file.isDirectory()) { po = mgr.redeploy(ids, file, null); Modified: geronimo/server/trunk/plugins/hotdeploy/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryMonitor.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/hotdeploy/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryMonitor.java?rev=996430&r1=996429&r2=996430&view=diff ============================================================================== --- geronimo/server/trunk/plugins/hotdeploy/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryMonitor.java (original) +++ geronimo/server/trunk/plugins/hotdeploy/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryMonitor.java Mon Sep 13 06:19:13 2010 @@ -116,7 +116,7 @@ public class DirectoryMonitor implements private File directory; private boolean done = false; private Listener listener; // a little cheesy, but do we really need multiple listeners? - private final Map files = new HashMap(); + private final Map files = new HashMap(); private volatile String workingOnConfigId; public DirectoryMonitor(File directory, Listener listener, int pollIntervalMillis) { @@ -175,9 +175,9 @@ public class DirectoryMonitor implements return; // don't react to events we generated ourselves } synchronized(files) { - for (Iterator it = files.keySet().iterator(); it.hasNext();) { - String path = (String) it.next(); - FileInfo info = (FileInfo) files.get(path); + for (Iterator it = files.keySet().iterator(); it.hasNext();) { + String path = it.next(); + FileInfo info = files.get(path); Artifact target = Artifact.create(info.getConfigId()); if(id.matches(target)) { // need to remove record & delete file File file = new File(path); @@ -259,15 +259,15 @@ log.info("At startup, found "+now.getPat return; } synchronized (files) { - Set oldList = new HashSet(files.keySet()); - List actions = new LinkedList(); + Set oldList = new HashSet(files.keySet()); + List actions = new LinkedList(); for (int i = 0; i < children.length; i++) { File child = children[i]; if (!child.canRead()) { continue; } FileInfo now = child.isDirectory() ? getDirectoryInfo(child) : getFileInfo(child); - FileInfo then = (FileInfo) files.get(now.getPath()); + FileInfo then = files.get(now.getPath()); if (then == null) { // Brand new, wait a bit to make sure it's not still changing now.setNewFile(true); files.put(now.getPath(), now); @@ -296,9 +296,9 @@ log.info("At startup, found "+now.getPat } } // Look for any files we used to know about but didn't find in this pass - for (Iterator it = oldList.iterator(); it.hasNext();) { - String name = (String) it.next(); - FileInfo info = (FileInfo) files.get(name); + for (Iterator it = oldList.iterator(); it.hasNext();) { + String name = it.next(); + FileInfo info = files.get(name); log.debug("File removed: " + name); if (info.isNewFile()) { // Was never added, just whack it files.remove(name); @@ -308,16 +308,16 @@ log.info("At startup, found "+now.getPat } if (listener != null) { // First pass: validate all changed files, so any obvious errors come out first - for (Iterator it = actions.iterator(); it.hasNext();) { - FileAction action = (FileAction) it.next(); + for (Iterator it = actions.iterator(); it.hasNext();) { + FileAction action = it.next(); if (!listener.validateFile(action.child, action.info.getConfigId())) { resolveFile(action); it.remove(); } } // Second pass: do what we're meant to do - for (Iterator it = actions.iterator(); it.hasNext();) { - FileAction action = (FileAction) it.next(); + for (Iterator it = actions.iterator(); it.hasNext();) { + FileAction action = it.next(); try { if (action.action == FileAction.REMOVED_FILE) { workingOnConfigId = action.info.getConfigId(); @@ -341,7 +341,7 @@ log.info("At startup, found "+now.getPat File[] childs = directory.listFiles(); for (int i = 0; i < childs.length; i++) { String path = childs[i].getAbsolutePath(); - String configId = ((FileInfo)files.get(path)).configId; + String configId = (files.get(path)).configId; if (configId != null && configId.equals(workingOnConfigId) && !action.child.getAbsolutePath().equals(path)) { File fd = new File(path); if (fd.isDirectory()) {