Labs 1.1: Mensaje
Step 1: Get Started Login: – Username: nombre/cc5212 – Password on board – C:/Program Files (x86)/eclipse/ (in Spanish ) – File > Import > …
Step 2: Connect to Directory I start the directory! – vm116.dcc.uchile.cl ( ) – Port 1985 Connect … – org.mdp.dir.UserDirectoryClient – Get your IP ( cmd > ipconfig )
Step 3: Implement Message Server org.mdp.im.InstantMessagingServer – Implement InstantMessagingStub – Write message(.,.) method Print the message to the console and whom it’s from
Step 4: Implement Message App. org.mdp.cli.InstantMessagingApp Server (receive) Client (send)
Step 4a: Start Registry org.mdp.cli.InstantMessagingApp – Implement startRegistry(.) Server (receive) Registry (port) Client (send)
Step 4b: Register Skeleton org.mdp.cli.InstantMessagingApp – Implement bindSkeleton(.) – key = “ InstantMessagingServer ” Aka. InstantMessagingServer.class.getSimpleName(); – skeleton = new InstantMessagingServer() Server (receive) Registry (port) Client (send) keyskeleton
Step 4c: Find Peers w/ Directory org.mdp.cli.InstantMessagingApp – connectToDirectory() Server (receive) Registry (port) Client (send) keyskeleton localhost Directory
Step 4d: Implement Client org.mdp.cli.InstantMessagingApp – messageUser(.,.,.) – Connect to remote registry – Get the stub from the registry (same key) – Message user! Server (receive) Registry (port) Client (send) keyskeleton localhost Directory
Step 4e: Setup Command Line Right click build.xml – > Run As > Ant Build Open command line and go to dist directory of the project java –jar rmi.jar InstantMessagingApp Add yourself Message classmates!