Class GlassFishImpl
- java.lang.Object
-
- com.sun.enterprise.glassfish.bootstrap.GlassFishImpl
-
- All Implemented Interfaces:
GlassFish
public class GlassFishImpl extends Object implements GlassFish
- Author:
- [email protected]
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.glassfish.embeddable.GlassFish
GlassFish.Status
-
-
Field Summary
Fields Modifier and Type Field Description static String
PAYARA_SHUTDOWNGRACE_PROPERTY
-
Constructor Summary
Constructors Constructor Description GlassFishImpl(com.sun.enterprise.module.bootstrap.ModuleStartup gfKernel, org.glassfish.hk2.api.ServiceLocator habitat, Properties gfProps)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
Call this method if you don't need this GlassFish instance any more.CommandRunner
getCommandRunner()
Gets a CommandRunner instance, using which the user can run asadmin commands.Deployer
getDeployer()
Gets a Deployer instance to deploy an application.<T> T
getService(Class<T> serviceType)
A service has a service interface and optionally a name.<T> T
getService(Class<T> serviceType, String serviceName)
A service has a service interface and optionally a name.GlassFish.Status
getStatus()
Get the current status of GlassFish.static void
sleepShutdownGracePeriod()
void
start()
Start GlassFish.void
stop()
Stop GlassFish.
-
-
-
Field Detail
-
PAYARA_SHUTDOWNGRACE_PROPERTY
public static final String PAYARA_SHUTDOWNGRACE_PROPERTY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GlassFishImpl
public GlassFishImpl(com.sun.enterprise.module.bootstrap.ModuleStartup gfKernel, org.glassfish.hk2.api.ServiceLocator habitat, Properties gfProps) throws GlassFishException
- Throws:
GlassFishException
-
-
Method Detail
-
start
public void start() throws GlassFishException
Description copied from interface:GlassFish
Start GlassFish. When this method is called, all the lifecycle (aka startup) services are started. Calling this method while the server is inGlassFish.Status.STARTED
state is a no-op.- Specified by:
start
in interfaceGlassFish
- Throws:
GlassFishException
- if server can't be started for some unknown reason.
-
stop
public void stop() throws GlassFishException
Description copied from interface:GlassFish
Stop 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.STARTED
state is a no-op.- Specified by:
stop
in interfaceGlassFish
- Throws:
GlassFishException
- if server can't be started for some unknown reason.
-
sleepShutdownGracePeriod
public static void sleepShutdownGracePeriod()
-
dispose
public void dispose() throws GlassFishException
Description copied from interface:GlassFish
Call 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:
dispose
in interfaceGlassFish
- Throws:
GlassFishException
-
getStatus
public GlassFish.Status getStatus()
Description copied from interface:GlassFish
Get the current status of GlassFish.
-
getService
public <T> T getService(Class<T> serviceType) throws GlassFishException
Description copied from interface:GlassFish
A 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:
getService
in 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:GlassFish
A 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:
getService
in 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:GlassFish
Gets 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:
getDeployer
in interfaceGlassFish
- Returns:
- A new Deployer instance
- Throws:
GlassFishException
-
getCommandRunner
public CommandRunner getCommandRunner() throws GlassFishException
Description copied from interface:GlassFish
Gets 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:
getCommandRunner
in interfaceGlassFish
- Returns:
- a new CommandRunner instance
- Throws:
GlassFishException
-
-