Package py4j
Interface Py4JJavaServer
-
- All Known Implementing Classes:
GatewayServer
,JavaServer
public interface Py4JJavaServer
Interface 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 void
addListener(GatewayServerListener listener)
java.net.InetAddress
getAddress()
Gateway
getGateway()
java.util.List<GatewayServerListener>
getListeners()
int
getListeningPort()
int
getPort()
java.net.InetAddress
getPythonAddress()
int
getPythonPort()
void
removeListener(GatewayServerListener listener)
void
shutdown()
Stops accepting connections, closes all current connections, and callsGateway.shutdown()
void
shutdown(boolean shutdownCallbackClient)
Stops accepting connections, closes all current connections, and callsGateway.shutdown()
void
start()
Starts to accept connections in a second thread (non-blocking call).void
start(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.
-
-