[Jboss-cvs] JBossAS SVN: r55169 - branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/plugins/scanner
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Aug 4 02:47:55 EDT 2006
Author: scott.stark at jboss.org
Date: 2006-08-04 02:47:53 -0400 (Fri, 04 Aug 2006)
New Revision: 55169
Modified:
branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/plugins/scanner/VFSDeploymentScannerImpl.java
Log:
Use the deployment context watch file.
Modified: branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/plugins/scanner/VFSDeploymentScannerImpl.java
===================================================================
--- branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/plugins/scanner/VFSDeploymentScannerImpl.java 2006-08-04 06:43:08 UTC (rev 55168)
+++ branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/plugins/scanner/VFSDeploymentScannerImpl.java 2006-08-04 06:47:53 UTC (rev 55169)
@@ -42,7 +42,6 @@
import org.jboss.deployers.spi.Deployment;
import org.jboss.deployers.spi.MainDeployer;
-import org.jboss.deployment.IncompleteDeploymentException;
import org.jboss.deployment.scanner.VFSDeploymentScanner;
import org.jboss.util.JBossObject;
import org.jboss.util.StringPropertyReplacer;
@@ -92,9 +91,6 @@
/** A set of scanned VirtualFiles which have been deployed */
private Map<VirtualFile, Deployment> deployedMap = Collections.synchronizedMap(new HashMap());
- /** Remember the last exception for reporting */
- private IncompleteDeploymentException lastIncompleteDeploymentException;
-
// Constructor ---------------------------------------------------
public VFSDeploymentScannerImpl()
@@ -405,7 +401,6 @@
throw new IllegalStateException("not initialized");
}
boolean trace = log.isTraceEnabled();
- lastIncompleteDeploymentException = null;
// Scan for deployments
if (trace)
@@ -535,24 +530,7 @@
i = toDeployList.iterator();
}
*/
- }
-
- /* TODO: Validate that there are still incomplete deployments
- if (lastIncompleteDeploymentException != null)
- {
- try
- {
- Object[] args = {};
- String[] sig = {};
- getServer().invoke(getDeployer(), "checkIncompleteDeployments", args, sig);
- }
- catch (Exception e)
- {
- Throwable t = JMXExceptionDecoder.decode(e);
- log.error(t);
- }
- }
- */
+ }
}
/**
@@ -636,30 +614,17 @@
}
catch (Exception e)
{
- log.debug("Failed to deploy: " + vf, e);
+ log.warn("Failed to deploy: " + vf, e);
+ // TODO: somehow need to ignore bad deployments to avoid repeated errors
+ return;
}
- String watchPath = getWatchURL(deployment);
- VirtualFile watchComponent = null;
- long deployedLastModified = -1;
- try
- {
- if (watchPath != null)
- {
- watchComponent = vf.findChild(watchPath);
- deployedLastModified = watchComponent.getLastModified();
- }
- else
- {
- deployedLastModified = vf.getLastModified();
- }
- }
- catch (IOException e)
- {
- log.warn(e);
- }
- //vf.setContext(new ComponentContext(watchComponent, deployedLastModified));
-
+ VirtualFile watchFile = deployment.getRootContext().getWatchFile();
+ if( watchFile == null )
+ watchFile = deployment.getRootContext().getFile();
+ long deployedLastModified = watchFile.getLastModified();
+ deployment.getRootContext().putContextData(getClass(), "deployedLastModified", deployedLastModified);
+
if (!deployedMap.containsKey(vf))
{
deployedMap.put(vf, deployment);
@@ -684,16 +649,6 @@
}
/**
- * Helper to get the watchURL for a deployment, if different.
- * Returns null otherwise
- */
- private String getWatchURL(Deployment deployment)
- {
- String watchPath = (String) deployment.getRootContext().getContextData().get("");
- return watchPath;
- }
-
- /**
* Helper to find out if a deployed vf has been modified
* TODO: How should this be implemented
*/
More information about the jboss-cvs-commits
mailing list