dev@glassfish.java.net

Re: [embedded] EmbeddedDeployer

From: Arun Gupta <Arun.Gupta_at_Sun.COM>
Date: Wed, 20 May 2009 16:26:20 -0700

>> 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.
+1

>
> How about:
>
> WebServer s = WebServerInfo.port(8080);
> s.getDeployer().("foo.war");
>
> where WebServer extends Server.
What's the need for explicitly getting a Deployer ? How about:

WebContainer web = WebContainer.setPort(8080);
web.deploy("foo.war");

-Arun

-- 
Application Platform, Sun Microsystems, Inc.
Blog: http://blogs.sun.com/arungupta