dev@glassfish.java.net

Re: [embedded] EmbeddedDeployer

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Mon, 18 May 2009 21:53:18 +0200

On May 18, 2009, at 6:34 PM, Jerome Dochez wrote:
>>
>> 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 ?

A closer relationship between the two classes e.g. so when a developer
looks at the JavaDoc for Server it connects to how to build it. For
example:

http://74.125.77.132/search?q=cache:3H-Bb8E4sDEJ:developers.sun.com/learning/javaoneonline/2007/pdf/TS-2689.pdf+Josh+Bloch+builder+pattern&cd=1&hl=en&ct=clnk&gl=de&client=firefox-a

Paul.


>
>>
>>
>>>>>>
>>>>>> 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
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>