Package org.glassfish.embeddable
Class GlassFishRuntime
java.lang.Object
org.glassfish.embeddable.GlassFishRuntime
This is the entry point API to bootstrap GlassFish.
A GlassFishRuntime represents just the runtime environment,
i.e., no active services yet. e.g., there won't be any web container
started just by creating a GlassFishRuntime object.
The services will be activated when GlassFish instance is
started by doing omething like:
GlassFishRuntime runtime = GlassFishRuntime.bootstrap(); // no active services
GlassFish glassfish = runtime.newGlassFish();
glassfish.start(); // active services.
- Author:
- Sanjeeb.Sahoo@Sun.COM, bhavanishankar@dev.java.net
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefault constructor, doesn't do anything -
Method Summary
Modifier and TypeMethodDescriptionstatic GlassFishRuntimeBootstrap a GlassFishRuntime with defaultBootstrapProperties.static GlassFishRuntimebootstrap(BootstrapProperties bootstrapProperties) Bootstrap GlassFish runtime based on runtime configuration passed in the bootstrapProperties object.static GlassFishRuntimebootstrap(BootstrapProperties bootstrapProperties, ClassLoader cl) Bootstrap GlassFish runtime based on runtime configuration passed in the bootstrapProperties object.Create a new instance of GlassFish with defaultGlassFishPropertiesabstract GlassFishnewGlassFish(GlassFishProperties glassfishProperties) Creates a new instance of GlassFish.abstract voidshutdown()Shuts down the Runtime and dispose off all the GlassFish objects created via this Runtimeprotected static void
-
Constructor Details
-
GlassFishRuntime
protected GlassFishRuntime()Default constructor, doesn't do anything
-
-
Method Details
-
bootstrap
Bootstrap a GlassFishRuntime with defaultBootstrapProperties.- Returns:
- Bootstrapped GlassFishRuntime
- Throws:
GlassFishException- if the GlassFishRuntime is already bootstrapped.
-
bootstrap
public static GlassFishRuntime bootstrap(BootstrapProperties bootstrapProperties) throws GlassFishException Bootstrap GlassFish runtime based on runtime configuration passed in the bootstrapProperties object. This is a convenience method. Calling this method is same as callingbootstrap(BootstrapProperties, ClassLoader)with null as second argument.- Parameters:
bootstrapProperties- BootstrapProperties used to setup the runtime- Throws:
GlassFishException
-
bootstrap
public static GlassFishRuntime bootstrap(BootstrapProperties bootstrapProperties, ClassLoader cl) throws GlassFishException Bootstrap GlassFish runtime based on runtime configuration passed in the bootstrapProperties object. Calling this method twice will throw a GlassFishException- Parameters:
bootstrapProperties- BootstrapProperties used to setup the runtimecl- ClassLoader used as parent loader by GlassFish modules. If null is passed, the class loader of this class is used.- Returns:
- a bootstrapped runtime that can now be used to create new GlassFish instances
- Throws:
GlassFishException
-
shutdown
Shuts down the Runtime and dispose off all the GlassFish objects created via this Runtime- Throws:
GlassFishException
-
newGlassFish
Create a new instance of GlassFish with defaultGlassFishProperties- Returns:
- New GlassFish instance.
- Throws:
GlassFishException- If at all fails to create a new GlassFish instance.
-
newGlassFish
public abstract GlassFish newGlassFish(GlassFishProperties glassfishProperties) throws GlassFishException Creates a new instance of GlassFish.- Parameters:
glassfishProperties- GlassFishProperties used to setup the GlassFish instance- Returns:
- newly instantiated GlassFish object. It will be in
GlassFish.Status.INITstate. - Throws:
GlassFishException
-
shutdownInternal
- Throws:
GlassFishException
-