[jboss-dev-forums] [Design of POJO Server] - Re: HDScanner scanPeriod

alesj do-not-reply at jboss.com
Sun Apr 19 04:50:57 EDT 2009


"jaikiran" wrote : 
  | From my understanding of HDScanner (and i might be wrong), it monitors the last modified time of the deployment descriptor and nothing more than that. 
  | 
It depends on the type of StructureModificationChecker.
Currently we have an impl that watches only metadata locations.

"jaikiran" wrote : 
  | So how is it going to trigger the OverrideSynchAdapter to copy a new page (jsp/jsf) to a temped deployment, when a new page has been added to the original deployment?
  | 
That's the tricky new part. ;-)

>From SynchWrapperModificationChecker

  |    protected boolean hasStructureBeenModifed(VirtualFile root, VFSDeploymentContext deploymentContext) throws IOException
  |    {
  |       boolean modified = delegate.hasStructureBeenModifed(root, deploymentContext);
  |       // it was not modifed & we're actually temped
  |       if (modified == false && root != deploymentContext.getRoot())
  |       {
  |          // check for update or delete
  |          UpdateDeleteVisitor udVisitor = new UpdateDeleteVisitor(tempAttributes, getCache(), synchAdapter, root);
  |          VirtualFile tempRoot = deploymentContext.getRoot();
  |          tempRoot.visit(udVisitor);
  |          // check for addition
  |          AddVisitor addVisitor = new AddVisitor(originalAttributes, getCache(), synchAdapter, tempRoot, root.getPathName().length());
  |          root.visit(addVisitor);
  |       }
  |       return modified;
  |    }
  | 

UpdateDeleteVisitor works on tempRoot, as that should be transparent to the user
(the user should never (have to) modify temp),
traversing over temps and asking matching original if it changed or if it still exists.

AddVisitor traverses over originals, checking if matching temp exists,
if not, new file has been added --> solving your problem. ;-)

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4226350#4226350

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4226350



More information about the jboss-dev-forums mailing list