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