dev@grizzly.java.net

Embedding WebAppAdapter was RFC Deployer refactoring

From: Hubert Iwaniuk <neotyk_at_kungfoo.pl>
Date: Wed, 16 Sep 2009 21:38:16 +0200

Hi *,

Excerpt from RFC Deployer Refactoring http://bit.ly/UfgUK

>
> can it be used embedded easily ?
>
> like
>
>
> webAdapter.deploy("xxx/webapp.war"); ?

Not that easy, we can create convenience method like WAA.deploy(...)

So far we have:
   /**
    * Default constructor, takes care of setting up adapter.
    *
    * @param gws Grizzly Web Server to register {_at_link ServletAdapter}s.
    * @param root Root folder, for serving static resources
    * @param context Context to be deployed to.
    * @param webApp Web application to be run by this adapter.
    * @param webAppCL Web application class loader.
    * @param webdefault Default web application.
    */
   public WebAppAdapter(GrizzlyWebServer gws, String root, String
context, final WebApp webApp, URLClassLoader webAppCL, WebApp
webdefault)

So what it takes now for embedding is GWS, parsed WebApp, Classloader
to be used by this WebApp, optional webdefault.

I think this embeddable entry method would have better place in
GrizzlyWebServerDeployer
We already have quite some deploy methods there.

As I see WebAppAdapter is to serve welcome-file, hold information on
what was deployed for particular WebApp (convenience for some
management interface) and help in un/redeploying. Do you agree on
that?

Back to GWSD.deploy.
    /**
     * Deploy WAR file.
     *
     * TODO make {_at_link GrizzlyWebServer} a parameter here for easier
embadability.
     *
     * @param location Location of WAR file.
     * @param context Context to deploy to.
     * @param serverLibLoader Server wide {_at_link ClassLoader}. Optional.
     * @param defaultWebApp webdefault application, get's merged with
application to deploy. Optional.
     * @throws Exception Duh. TODO refactor Exception handling.
     */
    public void deployWar(
            String location, String context, URLClassLoader
serverLibLoader, WebApp defaultWebApp) throws Exception {

What do you think of it?

Cheers,
   Hubert.