dev@glassfish.java.net

Re: [embedded] EmbeddedDeployer

From: Jerome Dochez <Jerome.Dochez_at_Sun.COM>
Date: Mon, 18 May 2009 09:34:20 -0700

On May 18, 2009, at 9:28 AM, Paul Sandoz wrote:

>
> On May 18, 2009, at 6:12 PM, Jerome Dochez wrote:
>>>>> Looked at the new APIs and couple of questions ...
>>>>>
>>>>> 1). I think creating a Server from ServerInfo is not intuitive.
>>>>> Do you know of any precedents ?
>>
>> not sure what you mean here... Server server = serverInfo.create();
>> is the API, is this the non intuitive part ?
>>
>
> Intuitively I would have expected the Server building functionality
> to be part of the Server itself. I suppose the name "Info" does not
> really click with the concept of creation, perhaps Builder or
> Factory ?
yes builder is definitely what I had in mind, not sure why I called it
Info... I will try to remember or change it !
>
> Maybe it would make sense for the ServerInfo to be an inner static
> class of Server? or can Server be an abstract class ? (i am not sure
> on the restrictions of the provider annotated classes).
what advantages do you see by making it an inner static ?
>
>
>>>>>
>>>>> 2). How do I deploy the archive now ? Server.getDeployer() is
>>>>> not available.
>>
>> yeah the API is far from complete but it should look like this :
>>
>> // default server configuration
>> ServerInfo info = ServerInfo.getServerInfo("MyEmbeddedGF");
>>
>> // configure and add the web container, with port 8080
>> WebContainer web =
>> server.addContainer(server.createConfig(WebContainerInfo.class));
>> web.setHttpPort(server.createPort("8080"));
>>
>> // deploy the app to any configured embedded container...
>> server.getDeployer().deploy("foo.war");
>>
>
> Seems a fair bit of work for a very common case i.e. embedded Web
> deployment.
>
> How about:
>
> WebServer s = WebServerInfo.port(8080);
> s.getDeployer().("foo.war");
>
> where WebServer extends Server.
>
> ?
>
> Paul.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>