dev@glassfish.java.net

Re: [embedded] EmbeddedDeployer

From: Nazrul Islam <Nazrul.Islam_at_Sun.COM>
Date: Wed, 20 May 2009 15:55:52 -0700

Jerome Dochez wrote:
>>>>
>>>> 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");
>
I did not understand this line. What does "MyEmbeddedGF" refer to here?
Is the id used for creating multiple embedded server?
> // configure and add the web container, with port 8080
> WebContainer web =
> server.addContainer(server.createConfig(WebContainerInfo.class));
Follow-up: How does one point to their own version of configuration
(domain.xml)?

Embedded Jetty does the following:
Server server = new Server();
XmlConfiguration configuration = new XmlConfiguration(new
File("myJetty.xml").toURL()); //or use new XmlConfiguration(new
FileInputStream("myJetty.xml"));
configuration.configure(server);
server.start();

Refer to http://docs.codehaus.org/display/JETTY/Embedding+Jetty

> web.setHttpPort(server.createPort("8080"));
>
> // deploy the app to any configured embedded container...
> server.getDeployer().deploy("foo.war");
>


-- 
Nazrul Islam  -  (408) 276-6468  - Sun Microsystems, Inc.