public class GlassFishImpl extends Object implements GlassFish
GlassFish.Status
Modifier and Type | Field and Description |
---|---|
static String |
PAYARA_SHUTDOWNGRACE_PROPERTY |
Constructor and Description |
---|
GlassFishImpl(com.sun.enterprise.module.bootstrap.ModuleStartup gfKernel,
org.glassfish.hk2.api.ServiceLocator habitat,
Properties gfProps) |
Modifier and Type | Method and 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.
|
public static final String PAYARA_SHUTDOWNGRACE_PROPERTY
public GlassFishImpl(com.sun.enterprise.module.bootstrap.ModuleStartup gfKernel, org.glassfish.hk2.api.ServiceLocator habitat, Properties gfProps) throws GlassFishException
GlassFishException
public void start() throws GlassFishException
GlassFish
GlassFish.Status.STARTED
state is a no-op.start
in interface GlassFish
GlassFishException
- if server can't be started for some unknown reason.public void stop() throws GlassFishException
GlassFish
GlassFish.Status.STARTED
state is a no-op.stop
in interface GlassFish
GlassFishException
- if server can't be started for some unknown reason.public static void sleepShutdownGracePeriod()
public void dispose() throws GlassFishException
GlassFish
GlassFish.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.dispose
in interface GlassFish
GlassFishException
public GlassFish.Status getStatus()
GlassFish
public <T> T getService(Class<T> serviceType) throws GlassFishException
GlassFish
getService
in interface GlassFish
serviceType
- type of component required.GlassFishException
public <T> T getService(Class<T> serviceType, String serviceName) throws GlassFishException
GlassFish
getService
in interface GlassFish
serviceType
- type of component required.serviceName
- name of the component.GlassFishException
public Deployer getDeployer() throws GlassFishException
GlassFish
getService(Deployer.class, null)
getDeployer
in interface GlassFish
GlassFishException
public CommandRunner getCommandRunner() throws GlassFishException
GlassFish
getService(CommandRunner.class, null)
Each invocation of this method returns a new CommandRunner object.getCommandRunner
in interface GlassFish
GlassFishException
Copyright © 2019. All rights reserved.