dev@grizzly.java.net

Re: Embedding WebAppAdapter was RFC Deployer refactoring

From: Hubert Iwaniuk <neotyk_at_kungfoo.pl>
Date: Mon, 21 Sep 2009 21:31:03 +0200

So maybe some eventing model for converted deployables could be useful.
Events fired around abstract methods of deployers.
So in simple case potential events:

   1. Deployable deployed under id
   2. Undeployed deploy id.
   3. Before converting Deployable to Map<GA,Set<String>> (potential
   customization point, not sure if needed)
   4. After converting Deployable to Map<GA,Set<String>> (potential
   customization point, not sure if needed)

In case of additional URI support additional two events:

   1. Before converting URI to Deployable
   2. After conversion.

That way manager application could register itself as listener for some/all
of those events and have all information available.

What do you think of it?
Hubert


On Mon, Sep 21, 2009 at 9:07 PM, Survivant 00 <survivant00_at_gmail.com> wrote:

> nice
>
> Just as a remainder, I would like to create a admin webpage (not packaged
> with deployer, but more a addon), that will allow the users to
> deploy/undeploy applications, activate/desactivate Comet support...
>
> something like that, so Deployer has to be able to allow that..
>
> 2009/9/21 Hubert Iwaniuk <neotyk_at_kungfoo.pl>
>
> Hi,
>>
>> I'll improve documentation.
>>
>> This loading war file from remote location can be used for distribution in
>> clustered/ha environment.
>> Just a thought.
>>
>> Cheers,
>> Hubert
>>
>>
>>
>> On Mon, Sep 21, 2009 at 8:36 PM, Jeanfrancois Arcand <
>> Jeanfrancois.Arcand_at_sun.com> wrote:
>>
>>>
>>>
>>> Hubert Iwaniuk wrote:
>>>
>>>> Thanks for you reply.
>>>> See comments inline.
>>>>
>>>> On Mon, Sep 21, 2009 at 5:31 PM, Jeanfrancois Arcand <
>>>> Jeanfrancois.Arcand_at_sun.com <mailto:Jeanfrancois.Arcand_at_sun.com>>
>>>> wrote:
>>>>
>>>> Salut,
>>>>
>>>> Index:
>>>>
>>>> modules/http/src/main/java/com/sun/grizzly/http/deployer/FromURIDeployer.java
>>>> +public abstract class FromURIDeployer<V> extends Deployer<V> {
>>>> +
>>>> + /**
>>>> + * Deploy deployable to gws.
>>>> + *
>>>> + * @param gws Grizzly to deploy to.
>>>> + * @param deployFrom URI ofr deployable to be deployed.
>>>> + *
>>>> + * @return Deployment identification.
>>>> + *
>>>> + * @throws DeployException Error in deployment.
>>>> + */
>>>> + public final Integer deploy(GrizzlyWebServer gws, URI
>>>> deployFrom) throws DeployException {
>>>> + return super.deploy(gws, fromURI(deployFrom));
>>>> + }
>>>> +
>>>> + /**
>>>> + * Create object to deploy from uri.
>>>> + *
>>>> + * @param uri of deployable object.
>>>> + *
>>>> + * @return Deployable object.
>>>> + */
>>>> + public abstract V fromURI(URI uri);
>>>>
>>>>
>>>> Do we needs that method to be abstract? I would think all URI should
>>>> be deployed the same way. Can you elaborate?
>>>>
>>>> URI is just location of we have no idea what. It might be WAR file
>>>> location it might be some other Deployable type.
>>>> What do you mean by all URI should be deployed the same way?
>>>>
>>>>
>>>
>>> OK then I agree, but we need to improve the documentation explaining what
>>> it does exactly, e.g will resolve the URI and deploy a war, directory or a
>>> remote was file. This is great!
>>>
>>>
>>>
>>>
>>>
>>>>
>>>>
>>>> +}
>>>> Index:
>>>>
>>>> modules/http/src/main/java/com/sun/grizzly/http/deployer/Deployer.java
>>>>
>>>> ===================================================================
>>>> ---
>>>>
>>>> modules/http/src/main/java/com/sun/grizzly/http/deployer/Deployer.java
>>>> Fri Sep 18 16:52:22 CEST 2009
>>>> +++
>>>>
>>>> modules/http/src/main/java/com/sun/grizzly/http/deployer/Deployer.java
>>>> Fri Sep 18 16:52:22 CEST 2009
>>>> @@ -0,0 +1,93 @@
>>>> +/*
>>>> + * The contents of this file are subject to the terms
>>>> + * of the Common Development and Distribution License
>>>> + * (the License). You may not use this file except in
>>>> + * compliance with the License.
>>>> + *
>>>> + * You can obtain a copy of the license at
>>>> + * https://glassfish.dev.java.net/public/CDDLv1.0.html or
>>>> + * glassfish/bootstrap/legal/CDDLv1.0.txt.
>>>> + * See the License for the specific language governing
>>>> + * permissions and limitations under the License.
>>>> + *
>>>> + * When distributing Covered Code, include this CDDL
>>>> + * Header Notice in each file and include the License file
>>>> + * at glassfish/bootstrap/legal/CDDLv1.0.txt.
>>>> + * If applicable, add the following below the CDDL Header,
>>>> + * with the fields enclosed by brackets [] replaced by
>>>> + * you own identifying information:
>>>> + * "Portions Copyrighted [year] [name of copyright owner]"
>>>> + *
>>>> + * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
>>>> + */
>>>> +package com.sun.grizzly.http.deployer;
>>>> +
>>>> +import com.sun.grizzly.http.embed.GrizzlyWebServer;
>>>> +import com.sun.grizzly.tcp.http11.GrizzlyAdapter;
>>>> +
>>>> +import java.util.Map;
>>>> +import java.util.Set;
>>>> +import java.util.HashMap;
>>>> +
>>>> +/**
>>>> + * Deployer abstraction.
>>>> + *
>>>> + * @author Hubert Iwaniuk
>>>> + * @param <V> Type of object deployed by this deployer.
>>>> + * @since Sep 17, 2009
>>>> + */
>>>> +public abstract class Deployer<V> {
>>>> +
>>>> + private Map<Integer, Set<GrizzlyAdapter>> deployed
>>>> + = new HashMap<Integer, Set<GrizzlyAdapter>>();
>>>> +
>>>> + /**
>>>> + * Deploy deployable to gws.
>>>> + *
>>>> + * @param gws Grizzly to deploy to.
>>>> + * @param toDeploy Deployable to be deployed.
>>>> + *
>>>> + * @return Deployment identification.
>>>> + *
>>>> + * @throws DeployException Error in deployment.
>>>> + */
>>>> + public final Integer deploy(GrizzlyWebServer gws, V
>>>> toDeploy) throws DeployException {
>>>> + Map<GrizzlyAdapter, Set<String>> map =
>>>> convert(toDeploy);
>>>>
>>>>
>>>> Here the convert role will consist of doing something similar to
>>>> what the current GWSD does right now, e.g. populate
>>>> GrizzlyAdapter/ServletAdapter instances, right?
>>>>
>>>> Exactly. This convert method is abstract and produces mapping of GA to
>>>> strings to map it to.
>>>>
>>>
>>> Thanks!
>>>
>>> -- Jeanfrancois
>>>
>>>
>>>
>>>> A+
>>>>
>>>> --Jeanfrancois
>>>>
>>>>
>>>> Thanks,
>>>> Hubert.
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> 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
>