1 | Example: This is an example of a module spawns an applet at the user side to input a text file and passes the file name to the next module which gets the image. |
2 | public MetaModule initialize() { mm = new MetaModule("Input Module "); //create an MetaModule instance |
3 | sp = new OutputPort(); // port for transmitting data to another module |
4 | mm.putPortID(sp.getPortID()); // registering a port which the module uses InetAddress local = java.net.InetAddress.getLocalHost(); //gets the host on //which the module reside hostName = local.getHostName(); //gets the host name of which the module //resides listener = new ServerSocket(0); //creates a new server socket for the module portNumber = listener.getLocalPort(); //port number on which the socket is //listening |
5 | contd.. |