dev@grizzly.java.net

Re: Embedding WebAppAdapter was RFC Deployer refactoring

From: Hubert Iwaniuk <neotyk_at_kungfoo.pl>
Date: Fri, 18 Sep 2009 01:20:33 +0200

Hi *

Attached Deployer API proposal.

Short description of what's in it.

   1. New method GWS.deploy(URI, Deployer<V>) to deploy from URI using
   deployer.
   2. Deployer abstract class that will deploy to GWS. Extending classes
   need to provide implementations for:
      1. creating deployable object from URI
      2. creating map of GrizzlyAdapters to patch for them to be deployed
      to.

First implementation will be WarDeployer extends Deployer<WebApp> and will
probably
need to introduce additional entities for deployment configuration like
server wide libs and webdefaultxml.
But before that happening I would like to hear from you if you find this API
idea acceptable/usable and how it can be improved.

Thanks in advance,
   Hubert.


On Wed, Sep 16, 2009 at 10:01 PM, Survivant 00 <survivant00_at_gmail.com>wrote:

> it what I add in mind.
>
> GWSD should become a client of this WAA.
>
> like if we have 5 war to deploy from GWSD command line
>
> List cachedList;
>
> for(String warPath : list){
> WebAppAdapter w = new WebAppAdapter(warPath).deploy();
> cachedList.add(w);
>
> }
>
> something liek that
>
> and be able to do
>
> w.undeploy();
>
>
>
> 2009/9/16 Jeanfrancois Arcand <Jeanfrancois.Arcand_at_sun.com>
>
> Salut,
>>
>>
>> Hubert Iwaniuk wrote:
>>
>>> 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?
>>>
>>
>> I would like to see WebAppAdapter.deploy(GWS,path_to_war/dir)> Mianly I
>> would like to be able to do something as simple as:
>>
>> WebAppAdapter w = new WebAppAdapter();
>> w.deploy("/foo");
>> gws.addGrizzlyAdapter(w);
>>
>> without the needs of the GWSD class. The idea then would consist of moving
>> the WebAppAdapter under the http-servlet module so people can really embed
>> and deploy their application programmatically.
>>
>> What do you think?
>>
>> Great work BTW!
>>
>> -- Jeanfrancois
>>
>>
>>
>>
>>
>>
>>> Cheers,
>>> Hubert.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe_at_grizzly.dev.java.net
>>> For additional commands, e-mail: dev-help_at_grizzly.dev.java.net
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_grizzly.dev.java.net
>> For additional commands, e-mail: dev-help_at_grizzly.dev.java.net
>>
>>
>
>
> --
>
> Vous pouvez me suivre sur Twitter / You can follow me on Twitter :
> http://twitter.com/survivant
>