[jboss-cvs] JBossAS SVN: r61177 - trunk/system/src/main/org/jboss/system/server/profileservice.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Mar 7 01:43:13 EST 2007
Author: scott.stark at jboss.org
Date: 2007-03-07 01:43:13 -0500 (Wed, 07 Mar 2007)
New Revision: 61177
Modified:
trunk/system/src/main/org/jboss/system/server/profileservice/VFSScanner.java
Log:
Remove old code
Modified: trunk/system/src/main/org/jboss/system/server/profileservice/VFSScanner.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/VFSScanner.java 2007-03-07 04:43:43 UTC (rev 61176)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/VFSScanner.java 2007-03-07 06:43:13 UTC (rev 61177)
@@ -387,19 +387,14 @@
}
}
LinkedList<VirtualFile> toRemoveList = new LinkedList<VirtualFile>();
- LinkedList<VirtualFile> toCheckForUpdateList = new LinkedList<VirtualFile>();
synchronized (deployedSet)
{
// remove previously deployed URLs no longer needed
for (VirtualFile deployedComponent : deployedSet.keySet())
{
- if (toDeployList.contains(deployedComponent))
+ if (toDeployList.contains(deployedComponent) == false)
{
- toCheckForUpdateList.add(deployedComponent);
- }
- else
- {
toRemoveList.add(deployedComponent);
}
}
@@ -415,47 +410,10 @@
undeploy(deployedComponent);
}
- // ********
- // Redeploy
- // ********
-
- // compute the DeployedURL list to update
- ArrayList<VirtualFile> toUpdateList = new ArrayList<VirtualFile>(toCheckForUpdateList.size());
- for (Iterator i = toCheckForUpdateList.iterator(); i.hasNext();)
- {
- VirtualFile deployedComponent = (VirtualFile)i.next();
- if (isModified(deployedComponent))
- {
- if (trace)
- {
- log.trace("Re-deploying " + deployedComponent);
- }
- toUpdateList.add(deployedComponent);
- }
- }
-
- // sort to update list
- //Collections.sort(toUpdateList, sorter);
-
- // Undeploy in order
- for (int i = toUpdateList.size() - 1; i >= 0; i--)
- {
- VirtualFile vf = toUpdateList.get(i);
- undeploy(vf);
- }
-
- // Deploy in order
- for (int i = 0; i < toUpdateList.size(); i++)
- {
- VirtualFile vf = toUpdateList.get(i);
- deploy(vf);
- }
-
// ******
// Deploy
// ******
- //Collections.sort(toDeployList, sorter);
for (Iterator i = toDeployList.iterator(); i.hasNext();)
{
VirtualFile component = (VirtualFile)i.next();
@@ -469,31 +427,8 @@
// component must have been deployed by now, so remove it from list
i.remove();
- /* Check to see if mainDeployer suffix list has changed, if so, then resort
- if (i.hasNext() && updateSorter())
- {
- Collections.sort(toDeployList, sorter);
- 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);
- }
- }
- */
}
/**
@@ -575,29 +510,6 @@
log.debug("Failed to deploy: " + component, e);
}
- /* TODO
- String watchPath = getWatchURL(deployment);
- VirtualFile watchComponent = null;
- long deployedLastModified = -1;
- try
- {
- if (watchPath != null)
- {
- watchComponent = component.findChild(watchPath);
- deployedLastModified = watchComponent.getLastModified();
- }
- else
- {
- deployedLastModified = component.getLastModified();
- }
- }
- catch (IOException e)
- {
- log.warn(e);
- }
- component.setContext(new ComponentContext(watchComponent, deployedLastModified));
- */
-
if (!deployedSet.containsKey(component))
{
deployedSet.put(component, deployment.getName());
@@ -645,45 +557,6 @@
*/
protected abstract void remove(Profile profile, String name) throws Exception;
- /**
- * Helper to get the watchURL for a deployment, if different.
- * Returns null otherwise
- *
- * @param deployment the deployment
- * @return the watch url
- */
- /* TODO
- private String getWatchURL(DeploymentContext deployment)
- {
- String watchPath = (String) deployment.getPredeterminedManagedObjects().getAttachment("WATCH_URL");
- return watchPath;
- }
- /*/
-
- /**
- * Helper to find out if a deployed component has been modified
- * TODO: How should this be implemented
- *
- * @param component the component
- * @return true when modified
- * @throws IOException for any error accessing the file
- */
- public boolean isModified(VirtualFile component) throws IOException
- {
- // get the context stored with every deployed component
- ComponentContext cc = null; //(ComponentContext)component.getContext();
-
- // get modification time at the time of deployment
- long deployedLastModified = cc.deployedLastModified;
-
- // find out the current lastModified time either from
- // the component or the watched component, if exists
- long lastModified = (cc.watchComponent != null) ? cc.watchComponent.getLastModified()
- : component.getLastModified();
-
- return deployedLastModified != lastModified;
- }
-
private VirtualFile getVFforURI(URI uri)
throws IOException
{
@@ -691,19 +564,4 @@
return vfs.getRoot();
}
- /**
- * Simple holder class to let us store extra info
- * on a VirtualFile object
- */
- private static class ComponentContext
- {
- public VirtualFile watchComponent;
- public long deployedLastModified;
-
- public ComponentContext(VirtualFile watchComponent, long deployedLastModified)
- {
- this.watchComponent = watchComponent;
- this.deployedLastModified = deployedLastModified;
- }
- }
}
More information about the jboss-cvs-commits
mailing list