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 Detail

      • getListeners

        java.util.List<GatewayServerListener> getListeners()
        Returns:
        An unmodifiable list of listeners
      • getAddress

        java.net.InetAddress getAddress()
      • getListeningPort

        int getListeningPort()
      • getPort

        int getPort()
      • getPythonAddress

        java.net.InetAddress getPythonAddress()
      • getPythonPort

        int getPythonPort()
      • 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.
      • 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.