Package org.mockserver.lifecycle
Class LifeCycle
- java.lang.Object
-
- org.mockserver.lifecycle.LifeCycle
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Stoppable
- Direct Known Subclasses:
MockServer
public abstract class LifeCycle extends Object implements Stoppable
- Author:
- jamesdbloom
-
-
Field Summary
Fields Modifier and Type Field Description protected io.netty.channel.EventLoopGroupbossGroupprotected HttpStatehttpStateprotected MockServerLoggermockServerLoggerprotected io.netty.bootstrap.ServerBootstrapserverServerBootstrapprotected io.netty.channel.EventLoopGroupworkerGroup
-
Constructor Summary
Constructors Modifier Constructor Description protectedLifeCycle(Configuration configuration)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description List<Integer>bindServerPorts(List<Integer> requestedPortBindings)voidclose()protected io.netty.channel.EventLoopGroupgetEventLoopGroup()intgetLocalPort()List<Integer>getLocalPorts()IntegergetPort()Deprecated.use getLocalPort instead of getPortSchedulergetScheduler()booleanisRunning()LifeCycleregisterListener(ExpectationsListener expectationsListener)protected voidstartedServer(List<Integer> ports)voidstop()CompletableFuture<String>stopAsync()
-
-
-
Field Detail
-
mockServerLogger
protected final MockServerLogger mockServerLogger
-
bossGroup
protected final io.netty.channel.EventLoopGroup bossGroup
-
workerGroup
protected final io.netty.channel.EventLoopGroup workerGroup
-
httpState
protected final HttpState httpState
-
serverServerBootstrap
protected io.netty.bootstrap.ServerBootstrap serverServerBootstrap
-
-
Constructor Detail
-
LifeCycle
protected LifeCycle(Configuration configuration)
-
-
Method Detail
-
stopAsync
public CompletableFuture<String> stopAsync()
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
getEventLoopGroup
protected io.netty.channel.EventLoopGroup getEventLoopGroup()
-
getScheduler
public Scheduler getScheduler()
-
isRunning
public boolean isRunning()
-
getPort
@Deprecated public Integer getPort()
Deprecated.use getLocalPort instead of getPort
-
getLocalPort
public int getLocalPort()
-
registerListener
public LifeCycle registerListener(ExpectationsListener expectationsListener)
-
-