public class OutputPort extends Port implements Serializable { public void send(Object str) { os= new ObjectOutputStream(getSocket().getOutputStream()); os.writeObject(str); } } |
public class InputPort extends Port implements Serializable { public Object receive() { is= new ObjectInputStream(getSocket().getInputStream()); str = (String) is.readObject(); return(str); } } |
Hence in the initialize method the statement |
sp = new OutputPort() creates a new OutputPort object, the super class does the registering with the Connection Manager |
mm.putPortID(sp.getPortID()) registering a port which the module uses it |