public class ClientServer
extends java.lang.Object
This class creates the JavaServer and the PythonClient necessary to communicate with a Python virtual machine with the new threading model.
Modifier and Type | Field and Description |
---|---|
protected java.util.logging.Logger |
logger |
Constructor and Description |
---|
ClientServer(int javaPort,
java.net.InetAddress javaAddress,
int pythonPort,
java.net.InetAddress pythonAddress,
int connectTimeout,
int readTimeout,
javax.net.ServerSocketFactory sSocketFactory,
javax.net.SocketFactory socketFactory,
java.lang.Object entryPoint) |
ClientServer(java.lang.Object entryPoint) |
Modifier and Type | Method and Description |
---|---|
Py4JJavaServer |
getJavaServer() |
Py4JPythonClient |
getPythonClient() |
java.lang.Object |
getPythonServerEntryPoint(java.lang.Class[] interfacesToImplement)
Gets a reference to the entry point on the Python side.
|
void |
shutdown()
Shuts down the Java Server so that it stops accepting requests and it
closes existing connections.
|
void |
startServer(boolean fork)
Starts the JavaServer, which will handle requests from the Python side.
|
public ClientServer(java.lang.Object entryPoint)
entryPoint
- public ClientServer(int javaPort, java.net.InetAddress javaAddress, int pythonPort, java.net.InetAddress pythonAddress, int connectTimeout, int readTimeout, javax.net.ServerSocketFactory sSocketFactory, javax.net.SocketFactory socketFactory, java.lang.Object entryPoint)
javaPort
- javaAddress
- pythonPort
- pythonAddress
- connectTimeout
- readTimeout
- sSocketFactory
- socketFactory
- entryPoint
- public Py4JJavaServer getJavaServer()
public Py4JPythonClient getPythonClient()
public void startServer(boolean fork)
Starts the JavaServer, which will handle requests from the Python side.
fork
- If the JavaServer is started in this thread or in its own
thread.public void shutdown()
public java.lang.Object getPythonServerEntryPoint(java.lang.Class[] interfacesToImplement)
Gets a reference to the entry point on the Python side. This is often necessary if Java is driving the communication because Java cannot call static methods, initialize Python objects or load Python modules yet.
interfacesToImplement
-