embedded@glassfish.java.net

Re: [embedded] Embedded Server without a domain.xml file possible?

From: Siraj Ghaffar <Siraj.Ghaffar_at_Sun.COM>
Date: Thu, 07 Jan 2010 09:24:47 -0500

For code example look at org.glassfish.maven.AdminMojo, which is part of
maven plugin. It is at
svn.dev.java.net/svn/glassfish-svn/trunk/v3-maven-plugin

For javadoc, CCing Rajiv.


Joey Jarosz wrote:
> I cannot find the documentation or examples for the CommandRunner class, so I do not know the syntax of the "command" and "paramtermap" arguments. Any pointers?
>
> joey
>
> -----Original Message-----
> From: Siraj.Ghaffar_at_Sun.COM [mailto:Siraj.Ghaffar_at_Sun.COM]
> Sent: Monday, January 04, 2010 10:31 AM
> To: embedded_at_glassfish.dev.java.net
> Subject: Re: [embedded] Embedded Server without a domain.xml file possible?
>
>
> Hi Joey,
>
> A bundled domain.xml is used by the embedded server by default. You can
> use the CommandRunner API to run admin commands in embedded -
>
> For example, look at this code snippet :
> ...
> CommandRunner runner =
> server.getHabitat().getComponent(CommandRunner.class);
> ActionReport report = server.getHabitat().getComponent(ActionReport.class);
> runner.getCommandInvocation(command, report).
> parameters(parametermap).execute();
>
> You can call EmbeddedFileSystem.Builder.configurationFile to set a new
> domain.xml.
>
>
> Joey Jarosz wrote:
>
>> I've been reading the "Sun GlassFish Enterprise Server v3 Embedded
>> Server Guide" and the embedded source code - I cannot find a way to
>> run the embedded server without a domain.xml file except for the most
>> trivial cases. I have a feeling it's possible and I just need a gentle
>> shove in the right direction.
>>
>> Here is a snippet from the domain.xml file that I am currently using
>> with the old v3-prelude (incomplete) embedded API. Among details such
>> as the access log information other required configuration information
>> includes things like a single virtual server listening on two ports.
>>
>> <configs>
>>
>> <config name="server-config">
>>
>> <http-service>
>>
>> <http-listener address="0.0.0.0"
>> default-virtual-server="vserver-secure" id="http-listener-1"
>> port="8080" server-name=""/>
>>
>> <http-listener address="0.0.0.0"
>> default-virtual-server="vserver-secure" id="http-listener-2"
>> port="8282" security-enabled="true" server-name="">
>>
>> <ssl cert-nickname="cadence" ssl3-enabled="true"/>
>>
>> </http-listener>
>>
>> <virtual-server http-listeners="http-listener-1,http-listener-2"
>> id="vserver-secure">
>>
>> <property name="docroot" value="${com.sun.aas.instanceRoot}/docroot"/>
>>
>> <property name="accesslog"
>> value="${com.sun.aas.instanceRoot}/../logs/access"/>
>>
>> <property name="sso-enabled" value="false"/>
>>
>> </virtual-server>
>>
>> <request-processing initial-thread-count="5" thread-count="40"
>> thread-increment="5"/>
>>
>> <keep-alive max-connections="0"/>
>>
>> <http-protocol default-response-type="text/plain; charset=iso-8859-1"
>> forced-response-type="text/plain; charset=iso-8859-1"/>
>>
>> <http-file-cache file-caching-enabled="true" globally-enabled="true"/>
>>
>> <property name="use-nio-direct-buffer" value="false"/>
>>
>> <property name="accessLoggingEnabled" value="true"/>
>>
>> <access-log rotation-interval-in-minutes="1440"
>> rotation-suffix="yyyy-MM-dd"/>
>>
>> </http-service>
>>
>> . . .
>>
>> --------------------------------------------
>> Joey Jarosz
>>
>> Senior Architect
>>
>> //Chip Planning Solutions//
>>
>> **/Cadence Design Systems, Inc./***/
>> /*(408) 914-6269
>>
>>
>> /*/Need some IP? Check out /*//*/www.chipestimate.com/*/
>> <http://www.chipestimate.com>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embedded-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: embedded-help_at_glassfish.dev.java.net
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embedded-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: embedded-help_at_glassfish.dev.java.net
>
>