py4j
Class GatewayConnection

java.lang.Object
  extended by py4j.GatewayConnection
All Implemented Interfaces:
Runnable

public class GatewayConnection
extends Object
implements Runnable

Manage the connection between a Python program and a Gateway. A GatewayConnection lives in its own thread and is created on demand (e.g., one per concurrent thread).

The request to connect to the JVM goes through the GatewayServer first and is then passed to a GatewayConnection.

This class is not intended to be directly accessed by users.

Author:
Barthelemy Dagenais

Constructor Summary
GatewayConnection(Gateway gateway, Socket socket)
           
GatewayConnection(Gateway gateway, Socket socket, List<Class<? extends py4j.commands.Command>> customCommands)
           
 
Method Summary
static List<Class<? extends py4j.commands.Command>> getBaseCommands()
           
protected  void initCommands(Gateway gateway, List<Class<? extends py4j.commands.Command>> commandsClazz)
           Override this method to initialize custom commands.
 void run()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GatewayConnection

public GatewayConnection(Gateway gateway,
                         Socket socket,
                         List<Class<? extends py4j.commands.Command>> customCommands)
                  throws IOException
Throws:
IOException

GatewayConnection

public GatewayConnection(Gateway gateway,
                         Socket socket)
                  throws IOException
Throws:
IOException
Method Detail

getBaseCommands

public static List<Class<? extends py4j.commands.Command>> getBaseCommands()
Returns:
The list of base commands that are provided by default. Can be hidden by custom commands with the same command id by passing a list of custom commands to the GatewayServer.

initCommands

protected void initCommands(Gateway gateway,
                            List<Class<? extends py4j.commands.Command>> commandsClazz)

Override this method to initialize custom commands.

Parameters:
gateway -

run

public void run()
Specified by:
run in interface Runnable