Package fish.payara.micro.boot.runtime
Class MicroGlassFish
- java.lang.Object
-
- fish.payara.micro.boot.runtime.MicroGlassFish
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.glassfish.embeddable.GlassFish
GlassFish.Status
-
-
Method Summary
All 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.void
start()
Start GlassFish.void
stop()
Stop GlassFish.
-
-
-
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.
-
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() throws GlassFishException
Description copied from interface:GlassFish
Get the current status of GlassFish.- Specified by:
getStatus
in interfaceGlassFish
- Returns:
- Status of GlassFish
- Throws:
GlassFishException
-
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
-
-