Package fr.dyade.aaa.jndi2.server
Class TcpServer
- java.lang.Object
-
- fr.dyade.aaa.jndi2.server.TcpServer
-
- All Implemented Interfaces:
TcpServerMBean
public class TcpServer extends Object implements TcpServerMBean
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTcpServer.Monitor
-
Field Summary
Fields Modifier and Type Field Description private ServerSocketlistenprivate TcpServer.Monitor[]monitorsprivate AgentIdserverId
-
Constructor Summary
Constructors Constructor Description TcpServer(ServerSocket listen, int poolSize, AgentId serverId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ServerSocketgetListen()intgetListenPort()Gets the listen port of the server.intgetPoolSize()Gets the number of threads of the pool.AgentIdgetServerId()voidstart()voidstop()
-
-
-
Field Detail
-
listen
private volatile ServerSocket listen
-
monitors
private TcpServer.Monitor[] monitors
-
serverId
private AgentId serverId
-
-
Constructor Detail
-
TcpServer
public TcpServer(ServerSocket listen, int poolSize, AgentId serverId)
-
-
Method Detail
-
getPoolSize
public int getPoolSize()
Gets the number of threads of the pool.- Specified by:
getPoolSizein interfaceTcpServerMBean- Returns:
- the number of threads of the pool.
-
getListenPort
public int getListenPort()
Gets the listen port of the server.- Specified by:
getListenPortin interfaceTcpServerMBean- Returns:
- the listen port of the server.
-
start
public final void start()
-
stop
public final void stop()
-
getListen
public final ServerSocket getListen()
-
getServerId
public final AgentId getServerId()
-
-