Package py4j
Interface Py4JJavaServer
-
- All Known Implementing Classes:
GatewayServer,JavaServer
public interface Py4JJavaServerInterface that describes the operations a server must support to receive requests from the Python side.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddListener(GatewayServerListener listener)java.net.InetAddressgetAddress()GatewaygetGateway()java.util.List<GatewayServerListener>getListeners()intgetListeningPort()intgetPort()java.net.InetAddressgetPythonAddress()intgetPythonPort()voidremoveListener(GatewayServerListener listener)voidshutdown()Stops accepting connections, closes all current connections, and callsGateway.shutdown()voidshutdown(boolean shutdownCallbackClient)Stops accepting connections, closes all current connections, and callsGateway.shutdown()voidstart()Starts to accept connections in a second thread (non-blocking call).voidstart(boolean fork)Starts to accept connections.
-
-
-
Method Detail
-
getListeners
java.util.List<GatewayServerListener> getListeners()
- Returns:
- An unmodifiable list of listeners
-
getAddress
java.net.InetAddress getAddress()
-
getGateway
Gateway getGateway()
-
getListeningPort
int getListeningPort()
-
getPort
int getPort()
-
getPythonAddress
java.net.InetAddress getPythonAddress()
-
getPythonPort
int getPythonPort()
-
removeListener
void removeListener(GatewayServerListener listener)
-
shutdown
void shutdown()
Stops accepting connections, closes all current connections, and calls
Gateway.shutdown()
-
shutdown
void shutdown(boolean shutdownCallbackClient)
Stops accepting connections, closes all current connections, and calls
Gateway.shutdown()- Parameters:
shutdownCallbackClient- If True, shuts down the CallbackClient instance.
-
addListener
void addListener(GatewayServerListener listener)
-
start
void start()
Starts to accept connections in a second thread (non-blocking call).
-
start
void start(boolean fork)
Starts to accept connections.
- Parameters:
fork- If true, the GatewayServer accepts connection in another thread and this call is non-blocking. If False, the GatewayServer accepts connection in this thread and the call is blocking (until the Gateway is shutdown by another thread).- Throws:
Py4JNetworkException- If the server socket cannot start.
-
-