Class NatsServer
- java.lang.Object
-
- berlin.yuna.natsserver.logic.Nats
-
- berlin.yuna.natsserver.embedded.logic.NatsServer
-
- All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean
public class NatsServer extends berlin.yuna.natsserver.logic.Nats implements org.springframework.beans.factory.DisposableBean
-
-
Constructor Summary
Constructors Constructor Description NatsServer(long timeoutMs)CreateNatsServerwith simplest start able configurationNatsServer(long timeoutMs, String... natsServerConfig)Create customNatsServerwith simplest configurationNats.config(String...)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()Simply stops theNatsServerprotected PathgetDefaultPath()protected PathgetNatsServerPath(berlin.yuna.clu.model.OsType os, berlin.yuna.clu.model.OsArch arch, berlin.yuna.clu.model.OsArchType archType)NatsServerport(int port)Sets the port out of the configurationNatsServersource(String natsServerUrl)Url to find nats server source
-
-
-
Field Detail
-
BEAN_NAME
public static final String BEAN_NAME
-
-
Constructor Detail
-
NatsServer
public NatsServer(long timeoutMs, String... natsServerConfig)Create customNatsServerwith simplest configurationNats.config(String...)- Parameters:
timeoutMs- tear down timeoutnatsServerConfig- passes the original parameters to the server. example: port:4222, user:admin, password:admin
-
NatsServer
public NatsServer(long timeoutMs)
CreateNatsServerwith simplest start able configuration- Parameters:
timeoutMs- tear down timeout
-
-
Method Detail
-
port
public NatsServer port(int port)
Sets the port out of the configuration- Overrides:
portin classberlin.yuna.natsserver.logic.Nats- Parameters:
port--1for random port- Returns:
NatsServer- Throws:
RuntimeException- withConnectExceptionwhen there is no port configured
-
source
public NatsServer source(String natsServerUrl)
Url to find nats server source- Overrides:
sourcein classberlin.yuna.natsserver.logic.Nats- Parameters:
natsServerUrl- url of the sourceNatsSourceConfig- Returns:
NatsServer
-
getDefaultPath
protected Path getDefaultPath()
- Overrides:
getDefaultPathin classberlin.yuna.natsserver.logic.Nats
-
getNatsServerPath
protected Path getNatsServerPath(berlin.yuna.clu.model.OsType os, berlin.yuna.clu.model.OsArch arch, berlin.yuna.clu.model.OsArchType archType)
- Overrides:
getNatsServerPathin classberlin.yuna.natsserver.logic.Nats
-
destroy
public void destroy()
Simply stops theNatsServer- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean- See Also:
Nats.stop()
-
-