Archive for November, 2014

Write a simple jini application

November 20, 2014


In this tutorial, I plan to show how to write a very simple jini application. This tutorial uses code from Chapter 9 of Jan Newmarch‘s website. For this tutorial you will create 4 files. You can download the source code from this link. If you want a more comprehensive example, you can view the source code for this project¬†(medical_report_system-final).

  1. is an interface that has two very simple methods (to send hello message and to receive hello message).
  2. implements these methods, and are hosted on server side. Client interact with this class through the HelloIntf interface.
  3. HelloServer is our service provider. It registers itself with the lookup service, and sends the object of the interface to this lookup service, when it is requested (In other words Server knows about HelloImpl).
  4. HelloClient is our client. It uses the HelloIntf  interface methods to send and receive messages from the service provider (our server) using the lookup service. It knows nothing about the implementation. Client however needs a proxy object (which in our case is just a jar created using interface). This proxy object is provided during our implementation through a webserver which we host using a tool that comes with jini.

Whenever we transfer message using RMI it has to implement interface. Also the methods throw RemoteException. Therefore, during implementation in both HelloServer and HelloClient we need to catch RemoteException while implementing or calling these methods.



Running a simple jini example

November 10, 2014


Since JINI is an old technology and if your code does not work, help that you get from the web can be little confusing (including mine :). JINI has changed to Apache River. There can be lots of disparity in articles between the old and the new versions. I hope Jini gets further development and more focus, because it is an amazing technology. If you are unfamiliar with JINI read this article. For this tutorial, I will be using the clock example from Jan Newmarch’s Guide to Jini Technologies. I hope this will help you explore more about JINI.