120 likes | 261 Views
Lecture 15 Jini Technology. Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University email: cheng@cse.ttu.edu.tw http://www.cse.ttu.edu.tw/~cheng. Installation. Install jini1.1 to c:jini1_1 doc examples lib policy source
E N D
Lecture 15 Jini Technology Instructors: Fu-Chiung Cheng (鄭福炯) Associate Professor Computer Science & Engineering Tatung University email: cheng@cse.ttu.edu.tw http://www.cse.ttu.edu.tw/~cheng
Installation • Install jini1.1 to c:\jini1_1\ • doc\ • examples\ • lib\ • policy\ • source\ • index.html • Install nuggets to c:\nuggets • about\ • images\ • pages\ • index.html
Installation • Install jini setup script to c:\jiniSetup\ • addJiniClientLibs.bat • addJiniServerLibs.bat • startHTTPServer.bat • startRMID.bat • startReggie.bat • Set path=%path%;c:\jiniSetup\ • Also make sure JDK 1.2.2 or 1.3 are installed
Start lookup service • Start the first dos terminal • Remove previous reggie data if necessary • >rmdir /s c:\temp\reggie_log • >rmdir /s c:\temp\reggie • Check if jdk is setup ok (must 1.2.2 and up) • >java –version • Set up jini libs for both client and server • >addJiniServerLibs • >addJiniClientLibs
Start lookup service • Start http server • startHTTPServer.bat • Start RMI daemon • startRMID.bat • Start lookup service(reggie) • startReggie.bat
Run HelloServer • Start a dos terminal • Add server setting • >addJiniServerLibs.bat • cd c:\nuggets\pages\examples\jiniexample1 • Make sure the settings of setInstallPoint.bat are correct. • recompile HelloServer and HelloClient • >c.bat • Run Hello Server (register service to LU service) • >cd server-side • >newRun.bat
Run HelloServer • You should see the following output: server: JoinManager = com.sun.jini.lookup.JoinManager@67e89 server: LookupLocator = jini://localhost/ server: LookupLocator.host = localhost server: LookupLocator.port = 4160 server: ServiceRegistrar = com.sun.jini.reggie.RegistrarProxy@9c2853 server: ServiceID = 7e23b037-4349-458b-8c13-a6e0b1e57b0f server: received ServiceID = 32831a51-5200-460a-9298-a5ca617b6d40 server: ServiceMatches = net.jini.core.lookup.ServiceMatches@6fa474 server: num matches = 3 server: svc item 0: net.jini.core.lookup.ServiceItem@15c083 server: svc object 0: MyServer_Stub[RemoteStub [ref: [endpoint:[140.129.20.234:1945](remote),objID:[d107f:e6c86ceb27:-8000, 0]]]] server: svc item 1: net.jini.core.lookup.ServiceItem@11d8c1 server: svc object 1: MyServer_Stub[RemoteStub [ref: [endpoint:[140.129.20.234:2017](remote),objID:[0]]]] server: svc item 2: net.jini.core.lookup.ServiceItem@2d9c06 server: svc object 2: com.sun.jini.reggie.RegistrarProxy@9c2853 *-----------------------------------------*
Run Hello Client • Start a dos terminal • Add client setting • >addJiniClientLibs.bat • cd c:\nuggets\pages\examples\jiniexample1 • Make sure the settings of setInstallPoint.bat are correct. • Run Hello Client • >cd client-side • >newRun.bat
Run Hello Client • You should see the following output: client: LookupLocator = jini://localhost/ client: LookupLocator.host = localhost client: LookupLocator.port = 4160 client: ServiceRegistrar = com.sun.jini.reggie.RegistrarProxy@9c2853 client: ServiceID = 7e23b037-4349-458b-8c13-a6e0b1e57b0f client: ServiceTemplate = net.jini.core.lookup.ServiceTemplate@37c60d client: Service object = MyServer_Stub[RemoteStub [ref: [endpoint:[140.129.20.234:2017](remote),objID:[d107f:e6c877b55e:-8000, 0]]]] client: Calling sayHello() --->Hello World from MyServer!<---
Jini Example 2 • Recompile if necessary and add Jini libs • >cd JiniExample2/ • >c.bat • Start lookup service (as jini example 1) • Start already • Run HelloServer • >cd JiniExample2/server-side • >r.bat • Run HelloClient • >cd JiniExample2/client-side • >r.bat
Jini Example 3 • Recompile if necessary and add Jini libs • >cd JiniExample3/ • >c.bat • Start lookup service (as jini example 1) • Start already • Run HelloServer • >cd JiniExample3/server-side • >r.bat • Run HelloClient • >cd JiniExample3/client-side • >r.bat
Jini Example 4 • Recompile if necessary and add Jini libs • >cd JiniExample4/ • >c.bat • Start lookup service (as jini example 1) • Start already • Run HelloServer • >cd JiniExample4/server-side • >r.bat • Run HelloClient • >cd JiniExample4/client-side • >r.bat