org.glassfish.embeddable
Class GlassFishRuntime

java.lang.Object
  extended by org.glassfish.embeddable.GlassFishRuntime

public abstract class GlassFishRuntime
extends java.lang.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.
 


Method Summary
static GlassFishRuntime bootstrap()
          Bootstrap a GlassFishRuntime with default BootstrapProperties.
static GlassFishRuntime bootstrap(BootstrapProperties bootstrapProperties)
          Bootstrap GlassFish runtime based on runtime configuration passed in the bootstrapProperties object.
static GlassFishRuntime bootstrap(BootstrapProperties bootstrapProperties, java.lang.ClassLoader cl)
          Bootstrap GlassFish runtime based on runtime configuration passed in the bootstrapProperties object.
 GlassFish newGlassFish()
          Create a new instance of GlassFish with default GlassFishProperties
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 Runtime
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

bootstrap

public static GlassFishRuntime bootstrap()
                                  throws GlassFishException
Bootstrap a GlassFishRuntime with default BootstrapProperties.

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 calling bootstrap(BootstrapProperties , ClassLoader) with null as second argument.

Parameters:
bootstrapProperties - BootstrapProperties used to setup the runtime
Throws:
GlassFishException

bootstrap

public static GlassFishRuntime bootstrap(BootstrapProperties bootstrapProperties,
                                         java.lang.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 runtime
cl - 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 default GlassFishProperties

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