|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.internal.embedded.Server
@Contract public class Server
Instances of server are embedded application servers, capable of attaching various containers (entities running users applications).
| Nested Class Summary | |
|---|---|
static class |
Server.Builder
Builder for creating embedded server instance. |
| Method Summary | ||
|---|---|---|
void |
addContainer(ContainerBuilder.Type type)
Adds a container of a particular type using the default operating configuration for the container. |
|
|
addContainer(ContainerBuilder<T> info)
Adds a container to this server. |
|
|
createConfig(Class<T> configType)
Get an embedded container configuration. |
|
ContainerBuilder<EmbeddedContainer> |
createConfig(ContainerBuilder.Type type)
Get the embedded container configuration for a container type. |
|
ContainerBuilder<EmbeddedContainer> |
createConfig(String name)
Get the embedded container builder for a container type identified by its name. |
|
Port |
createPort(int portNumber)
Creates a port to attach to embedded containers. |
|
Collection<EmbeddedContainer> |
getContainers()
Returns a list of the currently managed containers |
|
EmbeddedDeployer |
getDeployer()
Returns the embedded deployer implementation, can be used to generically deploy applications to the embedded server. |
|
EmbeddedFileSystem |
getFileSystem()
Returns the embedded file system used to run this embedded instance. |
|
org.jvnet.hk2.component.Habitat |
getHabitat()
Returns the configured habitat for this server. |
|
String |
getName()
Returns the server name, as specified in Server.Builder#Builder(String) |
|
static Server |
getServer(String name)
Returns the embedded server instance of a particular name |
|
static List<String> |
getServerNames()
Returns the list of existing embedded instances |
|
void |
start()
Starts the embedded server, opening ports, and running the startup services. |
|
void |
stop()
stops the embedded server instance, any deployed application will be stopped ports will be closed and shutdown services will be ran. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static List<String> getServerNames()
public static Server getServer(String name)
name - requested server name
public ContainerBuilder<EmbeddedContainer> createConfig(ContainerBuilder.Type type)
type - the container type (e.g. Type.ejb)
public ContainerBuilder<EmbeddedContainer> createConfig(String name)
name - the container name, which is the name used on the @Service annotation
public <T extends ContainerBuilder<?>> T createConfig(Class<T> configType)
T - type of the embedded containerconfigType - the type of the embedded container configuration
public void addContainer(ContainerBuilder.Type type)
type - type of the container to be added (like web, ejb).
IllegalStateException - if the container is already started.public <T extends EmbeddedContainer> T addContainer(ContainerBuilder<T> info)
T - type of the containerinfo - the configuration for the container
IllegalStateException - if the container is already started.public Collection<EmbeddedContainer> getContainers()
public Port createPort(int portNumber)
throws IOException
portNumber - port number for this port
IOException - if the port cannot be opened.public org.jvnet.hk2.component.Habitat getHabitat()
public String getName()
Server.Builder#Builder(String)
public EmbeddedFileSystem getFileSystem()
public void start()
throws LifecycleException
LifecycleException - if the server cannot be started propertly
public void stop()
throws LifecycleException
LifecycleException - if the server cannot shuts down properlypublic EmbeddedDeployer getDeployer()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||