dev@glassfish.java.net

Re: Resource Autodeploy Question (issue 4490)

From: Tim Quinn <Timothy.Quinn_at_Sun.COM>
Date: Sat, 26 Apr 2008 21:18:40 -0500

Hi, Jason.

Yes, your comment about people prepping for JavaOne was right on target!

I brought over the v2 autodeployer code to v3, with some changes and a
little bit of clean-up, although I didn't have as much time then as I'd
have liked.

You heard (read) some from Bhakti and perhaps some from the spi
document, but here's what sniffers are about...

GF v3, being module based, defers loading classes (as packaged in
moduled) until they are needed. This even includes the various kinds of
containers we are used to, such as the web and EJB containers, as well
as types of containers that might not even be JavaEE containers or that
we might not even know about ahead of time.

In v3 each container is responsible for doing most of the work of
deploying an app of that type. Yet the basic GF deployment framework
needs to be able to tell which container to ask to deploy a given app,
and it needs to do so without loading the candidate containers' modules
and starting the candidate containers. This is where sniffers come in.
All sniffers, regardless of the module type they might recognize, are
checked during deployment. When a deployment request arrives, GF asks
each sniffer it knows about whether it recognizes the type of the module
being deployed. If so, the GF deployment framework delegates the work
to the deployer corresponding to that module type. (Note that a given
app might be recognized by more than one sniffer; for example, a given
app might be recognized by both the EJB sniffer and the persistence
sniffer.)

So that's the idea behind sniffers.

Hope that helps.

If you have specific questions about autodeployment feel free to post
them to the list and we'll try to respond.

- Tim

Jason Lee wrote:
> On Wed, Apr 23, 2008 at 5:05 PM, Bhakti Mehta <Bhakti.Mehta_at_sun.com
> <mailto:Bhakti.Mehta_at_sun.com>> wrote:
>
> Jason,
> Here is some document to help you
> http://wiki.glassfish.java.net/Wiki.jsp?page=ContainerSPI
> I too had run into these questions initially As long as a Sniffer
> is packaged in an Hk2 module they are registered. I have some code
> in webservices/jsr109-impl if that can help you get started
>
>
> That does help some. Thanks. I'll need to stare at that document
> some more and the sample you pointed out, and I'm sure I'll have more
> questions for the list. :)
>
> --
> 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