Lecture 15 Jini Technology Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University
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 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 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 = server: LookupLocator = jini://localhost/ server: LookupLocator.host = localhost server: LookupLocator.port = 4160 server: ServiceRegistrar = server: ServiceID = 7e23b b-8c13-a6e0b1e57b0f server: received ServiceID = 32831a a-9298-a5ca617b6d40 server: ServiceMatches = server: num matches = 3 server: svc item 0: server: svc object 0: MyServer_Stub[RemoteStub [ref: [endpoint:[ :1945](remote),objID:[d107f:e6c86ceb27:-8000, 0]]]] server: svc item 1: server: svc object 1: MyServer_Stub[RemoteStub [ref: [endpoint:[ :2017](remote),objID:[0]]]] server: svc item 2: server: svc object 2: * *
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 = client: ServiceID = 7e23b b-8c13-a6e0b1e57b0f client: ServiceTemplate = client: Service object = MyServer_Stub[RemoteStub [ref: [endpoint:[ :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