Package org.glassfish.embeddable
Class GlassFishRuntime
- java.lang.Object
-
- org.glassfish.embeddable.GlassFishRuntime
-
- Direct Known Subclasses:
EmbeddedOSGiGlassFishRuntime
,GlassFishRuntimeDecorator
,MicroGlassFishRuntime
,StaticGlassFishRuntime
public abstract class GlassFishRuntime extends Object
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:
- [email protected], [email protected]
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
GlassFishRuntime()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static GlassFishRuntime
bootstrap()
Bootstrap a GlassFishRuntime with defaultBootstrapProperties
.static GlassFishRuntime
bootstrap(BootstrapProperties bootstrapProperties)
Bootstrap GlassFish runtime based on runtime configuration passed in the bootstrapProperties object.static GlassFishRuntime
bootstrap(BootstrapProperties bootstrapProperties, ClassLoader cl)
Bootstrap GlassFish runtime based on runtime configuration passed in the bootstrapProperties object.GlassFish
newGlassFish()
Create a new instance of GlassFish with defaultGlassFishProperties
abstract GlassFish
newGlassFish(GlassFishProperties glassfishProperties)
Creates a new instance of GlassFish.abstract void
shutdown()
Shuts down the Runtime and dispose off all the GlassFish objects created via this Runtimeprotected static void
shutdownInternal()
-
-
-
Method Detail
-
bootstrap
public static GlassFishRuntime bootstrap() throws GlassFishException
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
public abstract void shutdown() throws GlassFishException
Shuts down the Runtime and dispose off all the GlassFish objects created via this Runtime- Throws:
GlassFishException
-
newGlassFish
public GlassFish newGlassFish() throws GlassFishException
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.INIT
state. - Throws:
GlassFishException
-
shutdownInternal
protected static void shutdownInternal() throws GlassFishException
- Throws:
GlassFishException
-
-