py4j
Class DefaultCommunicationChannel

java.lang.Object
  extended by py4j.DefaultCommunicationChannel
All Implemented Interfaces:
CommunicationChannel

public class DefaultCommunicationChannel
extends Object
implements CommunicationChannel

Default implementation of the CommunicationChannel interface using TCP sockets.

Author:
Barthelemy Dagenais

Constructor Summary
DefaultCommunicationChannel(int port, InetAddress address)
           
 
Method Summary
 String sendCommand(String command)
           
 void setUsed(boolean used)
           
 void shutdown()
           Note: shutdown() should NOT throw any exception
 void start()
           
 boolean wasUsed()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCommunicationChannel

public DefaultCommunicationChannel(int port,
                                   InetAddress address)
Method Detail

start

public void start()
           throws IOException
Specified by:
start in interface CommunicationChannel
Throws:
IOException

sendCommand

public String sendCommand(String command)
Specified by:
sendCommand in interface CommunicationChannel

setUsed

public void setUsed(boolean used)
Specified by:
setUsed in interface CommunicationChannel

shutdown

public void shutdown()
Description copied from interface: CommunicationChannel

Note: shutdown() should NOT throw any exception

Specified by:
shutdown in interface CommunicationChannel

wasUsed

public boolean wasUsed()
Specified by:
wasUsed in interface CommunicationChannel