The py4j.java_callback module defines the classes that manage callbacks, i.e., Java objects calling Python objects. These classes should never be accessed directly by the users.
A PythonProxyPool manages proxies that are passed to the Java side. A proxy is a Python class that implements a Java interface.
A proxy has an internal class named Java with a member named implements which is a list of fully qualified names (string) of the implemented interfaces.
The PythonProxyPool implements a subset of the dict interface: pool[id], del(pool[id]), pool.put(proxy), pool.clear(), id in pool, len(pool).
The PythonProxyPool is thread-safe.
Adds a proxy to the pool.
Parameters: |
|
---|---|
Return type: | A unique identifier associated with the object. |
The CallbackServer is responsible for receiving call back connection requests from the JVM. Usually connections are reused on the Java side, but there is at least one connection per concurrent thread.
Parameters: |
|
---|
Starts listening and accepting connection requests.
This method is called when invoking CallbackServer.start(). A CallbackServer instance is created and started automatically when a JavaGateway instance is created.
Stops listening and accepting connection requests. All live connections are closed.
This method can safely be called by another thread.