dev@glassfish.java.net

Re: Resource Autodeployment

From: Hong Zhang <Hong.Zhang_at_Sun.COM>
Date: Wed, 04 Jun 2008 11:42:06 -0400

Hi, Jason

> On Tue, Jun 3, 2008 at 3:40 PM, Hong Zhang <Hong.Zhang_at_sun.com
> <mailto:Hong.Zhang_at_sun.com>> wrote:
>
> This sounds ok. But if we use the second option you mentioned
> before (creating a jar), we could possibly re-use the existing
> InputJarArchive and JarHandler code.
>
>
> That's an excellent point, and unless I miss my guess, that Jar
> creation can still be handle by the ArchiveFactory, even if
> redirectly. Let me think along those lines and see where that gets me...
>
>
> The code in DeployCommand to handle redeployment is just to call
> UndeployCommand first. So as long as we can make sure the
> UndeployCommand can undeploy the resources properly, the code in
> DeployCommand to handle redeployment for other archives could be
> used to handle the resource archive as well.
>
>
> Perfect.
>
>
> You would need to write a ResourceDeployer to handle the lifecycle
> of the resources.
>
> In v2, there used to be a ResourcesMBean which can be used to
> create/delete resources. I am not sure what's the equivalent of
> that in v3. Your ResourceDeployer should be just calling the
> equivalent of this ResourcesMBean to create/delete resources.
>
> I have Cced Jagadish in this thread. He is the owner of the
> resource backend. He should be able to help you on this.
>
> The ResourceDeployer will be invoked (through
> Sniffer/ContainerInfo) in ApplicationLifecycle to do the
> deployment/undeployment of the resources.
>
>
> OK. I had just traced the execution through those classes (I'm
> looking at the web-related classes for a concrete example of how all
> this works). I'm still not sure what container this would be
> associated with and how the ResourceDeployer reference would be
> acquired, but I'm getting there...

Yes, it will take some time to understand the relationships of these
classes. There are a few interfaces you will need to look at (and
implement if there is nothing you could re-use): Sniffer, Deployer,
Container, ApplicationContainer. I am not sure if the resource backend
has already had some kind of container implementation you could re-use,
please follow up with Jagadish.
If you end up having to implement everything yourself, and your
container implementation does not need to do much but just to fit into
the framework, you could use some of the dummy implementation there.
There is a SimpleDeployer class you could extend, and there is also a
DummyApplication class for the ApplicationContainer implementation. You
could look at the SecurityDeployer and related classes for example..

- Hong

>
>
> Jadagish should be able to point you to the right directories for
> this.
>
>
> That would be great. :)
>
> --
> 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