GlassFish Embedded Server: a blog, a screencast and a doc
By alexismp on Mar 07, 2011
GlassFish Embedded (i.e. drive GlassFish from an API) was enhanced as part of the 3.1 release to improve the fidelity with the non-embedded case. Popular use-cases include testing but also embedding the GlassFish runtime as part of an application for easier administration-less deployments.
If you're interested in the topic, Bhavanishankar has a quick introduction to Embeddability of GlassFish 3.1 discussing the setup (all-in-one JARs) and the main APIs. John "Java Evangelist" Yeary also posted a 5-minute screencast showing the the Embedded API in action. As a bonus you can also sprinkle some Scala into the mix.
The GlassFish 3.1 documentation includes an Embedded Server Guide with yet more details.