Class GlassFishDecorator
- java.lang.Object
-
- com.sun.enterprise.glassfish.bootstrap.GlassFishDecorator
-
- All Implemented Interfaces:
GlassFish
- Direct Known Subclasses:
EmbeddedOSGiGlassFishImpl
public class GlassFishDecorator extends Object implements GlassFish
A decorator for GlassFish- Author:
- Sanjeeb.Sahoo@Sun.COM
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.glassfish.embeddable.GlassFish
GlassFish.Status
-
-
Constructor Summary
Constructors Constructor Description GlassFishDecorator(GlassFish decoratedGf)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose()Call this method if you don't need this GlassFish instance any more.CommandRunnergetCommandRunner()Gets a CommandRunner instance, using which the user can run asadmin commands.DeployergetDeployer()Gets a Deployer instance to deploy an application.<T> TgetService(Class<T> serviceType)A service has a service interface and optionally a name.<T> TgetService(Class<T> serviceType, String serviceName)A service has a service interface and optionally a name.GlassFish.StatusgetStatus()Get the current status of GlassFish.voidstart()Start GlassFish.voidstop()Stop GlassFish.
-
-
-
Constructor Detail
-
GlassFishDecorator
public GlassFishDecorator(GlassFish decoratedGf)
-
-
Method Detail
-
start
public void start() throws GlassFishExceptionDescription copied from interface:GlassFishStart GlassFish. When this method is called, all the lifecycle (aka startup) services are started. Calling this method while the server is inGlassFish.Status.STARTEDstate is a no-op.- Specified by:
startin interfaceGlassFish- Throws:
GlassFishException- if server can't be started for some unknown reason.
-
stop
public void stop() throws GlassFishExceptionDescription copied from interface:GlassFishStop GlassFish. When this method is called, all the lifecycle (aka startup) services are stopped. GlassFish can be started again by calling the start method. Calling this method while the server is inGlassFish.Status.STARTEDstate is a no-op.- Specified by:
stopin interfaceGlassFish- Throws:
GlassFishException- if server can't be started for some unknown reason.
-
dispose
public void dispose() throws GlassFishExceptionDescription copied from interface:GlassFishCall this method if you don't need this GlassFish instance any more. This method will stop GlassFish if not already stopped. After this method is called, calling any method exceptGlassFish.getStatus()on the GlassFish object will cause an IllegalStateException to be thrown. When this method is called, any resource (like temporary files, threads, etc.) is also released.- Specified by:
disposein interfaceGlassFish- Throws:
GlassFishException
-
getStatus
public GlassFish.Status getStatus() throws GlassFishException
Description copied from interface:GlassFishGet the current status of GlassFish.- Specified by:
getStatusin interfaceGlassFish- Returns:
- Status of GlassFish
- Throws:
GlassFishException
-
getService
public <T> T getService(Class<T> serviceType) throws GlassFishException
Description copied from interface:GlassFishA service has a service interface and optionally a name. For a service which is just a class with no interface, then the service class is the service interface. This method is used to look up a service.- Specified by:
getServicein interfaceGlassFish- Parameters:
serviceType- type of component required.- Returns:
- Return a service matching the requirement, null if no service found.
- Throws:
GlassFishException
-
getService
public <T> T getService(Class<T> serviceType, String serviceName) throws GlassFishException
Description copied from interface:GlassFishA service has a service interface and optionally a name. For a service which is just a class with no interface, then the service class is the service interface. This method is used to look up a service.- Specified by:
getServicein interfaceGlassFish- Parameters:
serviceType- type of component required.serviceName- name of the component.- Returns:
- Return a service matching the requirement, null if no service found.
- Throws:
GlassFishException
-
getDeployer
public Deployer getDeployer() throws GlassFishException
Description copied from interface:GlassFishGets a Deployer instance to deploy an application. Each invocation of this method returns a new Deployer object. Calling this method is equivalent to callinggetService(Deployer.class, null)- Specified by:
getDeployerin interfaceGlassFish- Returns:
- A new Deployer instance
- Throws:
GlassFishException
-
getCommandRunner
public CommandRunner getCommandRunner() throws GlassFishException
Description copied from interface:GlassFishGets a CommandRunner instance, using which the user can run asadmin commands. Calling this method is equivalent to callinggetService(CommandRunner.class, null)Each invocation of this method returns a new CommandRunner object.- Specified by:
getCommandRunnerin interfaceGlassFish- Returns:
- a new CommandRunner instance
- Throws:
GlassFishException
-
-