Class IpcServerTcpEndpoint
- java.lang.Object
-
- org.apache.ignite.internal.util.ipc.loopback.IpcServerTcpEndpoint
-
- All Implemented Interfaces:
Closeable,AutoCloseable,IpcServerEndpoint
public class IpcServerTcpEndpoint extends Object implements IpcServerEndpoint
Server loopback IPC endpoint.
-
-
Field Summary
Fields Modifier and Type Field Description static intDFLT_IPC_PORTDefault endpoint port number.
-
Constructor Summary
Constructors Constructor Description IpcServerTcpEndpoint()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IpcEndpointaccept()Accepts client IPC connection.voidclose()Closes server IPC.StringgetHost()Gets host endpoint is bound to.intgetPort()Gets port endpoint is bound to.booleanisManagement()Indicates if this endpoint is a management endpoint.voidsetHost(String host)Sets host endpoint will be bound to.voidsetManagement(boolean mgmt)Sets management property.voidsetPort(int port)Sets port endpoint will be bound to.voidsetupConfiguration(Map<String,String> endpointCfg)Sets configuration properties from the map.voidstart()Starts configured endpoint implementation.StringtoString()
-
-
-
Field Detail
-
DFLT_IPC_PORT
public static final int DFLT_IPC_PORT
Default endpoint port number.- See Also:
- Constant Field Values
-
-
Method Detail
-
start
public void start() throws IgniteCheckedExceptionStarts configured endpoint implementation.- Specified by:
startin interfaceIpcServerEndpoint- Throws:
IgniteCheckedException- If failed to start server endpoint.
-
accept
public IpcEndpoint accept() throws IgniteCheckedException
Accepts client IPC connection. After client connection is accepted, it can be used for IPC. This method will block until client connects to IPC server endpoint.- Specified by:
acceptin interfaceIpcServerEndpoint- Returns:
- Accepted client connection.
- Throws:
IgniteCheckedException- If accept failed and the endpoint is not usable anymore.
-
close
public void close()
Closes server IPC. After IPC is closed, no further operations can be performed on this object.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceIpcServerEndpoint
-
getPort
public int getPort()
Gets port endpoint is bound to. Endpoints who does not bind to any port should return -1.- Specified by:
getPortin interfaceIpcServerEndpoint- Returns:
- Port number.
-
setPort
public void setPort(int port)
Sets port endpoint will be bound to.- Parameters:
port- Port number.
-
getHost
public String getHost()
Gets host endpoint is bound to. Endpoints who does not bind to any port should returnnull.- Specified by:
getHostin interfaceIpcServerEndpoint- Returns:
- Host.
-
setHost
public void setHost(String host)
Sets host endpoint will be bound to.- Parameters:
host- Host.
-
isManagement
public boolean isManagement()
Indicates if this endpoint is a management endpoint.- Specified by:
isManagementin interfaceIpcServerEndpoint- Returns:
trueif it's a management endpoint.
-
setManagement
public void setManagement(boolean mgmt)
Sets management property.- Parameters:
mgmt- flag.
-
setupConfiguration
public void setupConfiguration(Map<String,String> endpointCfg) throws IgniteCheckedException
Sets configuration properties from the map.- Parameters:
endpointCfg- Map of properties.- Throws:
IgniteCheckedException- If invalid property name or value.
-
-