dev@glassfish.java.net

Re: Resource Autodeploy Question (issue 4490)

From: Ken Paulsen <Ken.Paulsen_at_Sun.COM>
Date: Tue, 22 Apr 2008 23:16:31 -0700

If you don't get a response to this, let me or anissa know and we'll find a name you can send it to.  Sometime people (like me) don't respond unless its directly to them.



Jason Lee wrote:
I'm reading through the v3 source for the autodeployer, trying to make sure I understand what's going on before I get too excited about changing things.  From that effort, I made these notes:

HK2 services:
    AutoDeployService - Implements Startup, so hk2 creates a Singleton instance at startup
    AutoDeploymentOperation - Exposed as a service, with a new instance created "per lookup" via habitat.getComponent()
    AutoOperation - ditto, but never created directly; abstract
    AutoUndeploymentOperation - same as AutoDeploymentOperation
    AutodeployRetryManager - much like ADO, but @Injected into ADO and manually created in AutoDeployer.  Why the difference?
    AutoDeployer - not a service.  simple class created by ADS.  Gets needed components via habitat

Does that sound right so far?  My HK2 knowledge is pretty nascent, but I'm working on it.  Based on what I'm seeing in code, I think the above is pretty accurate.  That leads me to this depiction of the execution path:
   
AutoDeployer
    AutoDeployDirectoryScanner.getAllDeployableModules()
        AutoDeployedFilesManager.loadStatus()
        getListOfFiles()
            getListOfFilesAsSet() <- file ext check
        AutoDeployedFilesManager.getFilesForDeployment() // get list of files that haven't been deployed or whose tstamp is newer than status file
    deploy()
        retryManager.testFileAsArchive() <-- something here's going to have to change.  File ext check?
        AutoDeploymentOperation.newInstance()
        AutoDeploymentOperation.run()
            commandRunner.doCommand() // AutoOperation.java:116
                DeployCommand.execute() // line 253 - Synchronous commands
                    getSniffers()

And I'm stumped at about line 165 in DeployCommand (it doesn't help that it's after midnight, though I'm sure those involved in J1 will have much sympathy for me :).  I see that it checks to make sure there are Sniffers, then doesn't come back to that for a long time.  More importantly, what is a Sniffer?  In his comments on 4490, tjquinn mentioned something about sniffers, but I'm not sure what they are, what they do, how they plug in here, etc.  Is there any documentation on them, or can someone cobble together and quick-n-dirty explanation for me?  Beyond that question, am I reading the source correctly, on the right path, etc?

I hope all that makes sense.  I'm going to go crash and hope it's as coherent in the morning as it seems to me now :P

Thanks! :)

--
Jason Lee, SCJP
Software Architect -- Objectstream, Inc.
Mojarra and Mojarra Scales Dev Team
https://mojarra.dev.java.net
https://scales.dev.java.net
http://blogs.steeplesoft.com