<?xml version="1.0"?>
<rss version="2.0">
<channel>
  <title>Weiqi Gao&#039;s Observations - jini tag</title>
  <link>http://www.weiqigao.com/blog/tags/jini/</link>
  <description>Sharing My Experience...</description>
  <language>en</language>
  <copyright>Weiqi Gao</copyright>
  <lastBuildDate>Fri, 11 May 2012 12:48:36 GMT</lastBuildDate>
  <generator>Pebble (http://pebble.sourceforge.net)</generator>
  <docs>http://backend.userland.com/rss</docs>
  
  <image>
    <url>http://pebble.sourceforge.net/common/images/powered-by-pebble.gif</url>
    <title>Weiqi Gao&#039;s Observations</title>
    <link>http://www.weiqigao.com/blog/</link>
  </image>
  
  
  <item>
    <title>Reintroducing Jini 2.1</title>
    <link>http://www.weiqigao.com/blog/2007/09/28/reintroducing_jini_2_1.html</link>
    
      
        <description>
          &lt;p&gt;This is a almost live blog of the OCI internal Java lunch.  Today our speaker is Ryan Withers.  He is talking about Jini.&lt;/p&gt;

&lt;p&gt;First person is Ryan now.&lt;/p&gt;

&lt;h4&gt;Why the reintroduction&lt;/h4&gt;

&lt;p&gt;Jini has been introduced seven years ago by Sun.  At the time it had focus on devices.  The product was mis-marketted and the device-orientation didn&#039;t work.&lt;/p&gt;

&lt;p&gt;Jini is now an Apache incubator project named River.&lt;/p&gt;

&lt;p&gt;I started investigating Jini from version 2.1, for an SOA initiative.&lt;/p&gt;

&lt;p&gt;Jini does have impressive features.  It&#039;s been in existence since 1999 and is very service oriented many years before SOA became a popular phrase.&lt;/p&gt;

&lt;h4&gt;Getting it&lt;/h4&gt;

&lt;p&gt;You can get the Jini 2.1 starter kit from jini.org under an Apache 2.0 license.&lt;/p&gt;

&lt;p&gt;he Jini name does not stand for anything, but is rumored to be an acronym of &#034;Jini is not initials&#034;.&lt;/p&gt;

&lt;h4&gt;Architectural goals of Jini&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Infrastructure for services, possibly federated&lt;/li&gt;
&lt;li&gt;Simplified sharing of services and resources&lt;/li&gt;
&lt;li&gt;Ease of access; location transparency&lt;/li&gt;
&lt;li&gt;Painless administration and maintenance&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These goals parallels those of SOA to some extent.&lt;/p&gt;

&lt;h4&gt;Known uses of Jini&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Rubean A.G&lt;/li&gt;
&lt;li&gt;Magneti Marelli&lt;/li&gt;
&lt;li&gt;Nedap N.V.&lt;/li&gt;
&lt;li&gt;Orbitz&lt;/li&gt;
&lt;li&gt;Orange&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;Books&lt;/h4&gt;

&lt;p&gt;Apress book &#034;Fundamentals of Jini 2&#034;.  Also available online.&lt;/p&gt;

&lt;h4&gt;What&#039;s in Jini Spec&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Architecture&lt;/li&gt;
&lt;li&gt;Core services: Discovery/Join, Entry, Leasing, Event, etc.&lt;/li&gt;
&lt;li&gt;Utilities&lt;/li&gt;
&lt;li&gt;JavaSpaces, etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;(Brian Coyner asked about the relation between Jini and ZeroConf and Apple&#039;s &lt;i&gt;Bon Jour&lt;/i&gt;.)&lt;/p&gt;

&lt;h4&gt;The Demo&lt;/h4&gt;

&lt;p&gt;Two windows were brought up.  One is the Service Browser.  The other is a Converter application that uses one of the services.&lt;/p&gt;

&lt;p&gt;The Service Browser now shows several services, all in a list box with names resembling full Java class names.  One of them is the Registrar.  Another one is a sample UppercaseConverter.  Double click on a service brings up a metadata inspector for that service.&lt;/p&gt;

&lt;p&gt;The Converter application has a data entry field and a convert button.  Typing something into the entry field and then click the button will cause the text of the entry field to be converted and printed on an area below the entry field.  There is also a menu that allows the user to choose the type of the conversion.  At this moment, there is only an &#034;Upper&#034; menu item that corresponds to the UppercaseConverter service.  The conversion does the obvious thing.&lt;/p&gt;

&lt;p&gt;Another service is started from NetBeans.  And the ServiceBrowser now shows one more service&amp;mdash;MorseService.  The Converter application&#039;s conversion type menu now has one more menu item &#034;Morse&#034;.  Select &#034;Morse&#034; and then click the button causes the text to be converted to Morse code and printed.&lt;/p&gt;

&lt;p&gt;The MorseConverter service is shutdown now.  It disappears from the Service Browser.  A moment later, the &#034;Morse&#034; conversion type also disappears from the Converter application.&lt;/p&gt;

&lt;p&gt;What is interesting is that all of these happens without restarting the application.&lt;/p&gt;

&lt;p&gt;When the MorseConverter starts up, it makes its implementation classes available to any application that wishes to use it.  The Converter application has registered with the Service Registrar its interest in services that implements the &lt;tt&gt;Converter&lt;/tt&gt; interface (which apparently both &lt;tt&gt;UppercaseConverter&lt;/tt&gt; and &lt;tt&gt;MorseConverter&lt;/tt&gt; do).  The Registrar notified the Converter application of the newly available service and the Converter application retrieved the classes of the MorseConverter.  When it did the conversion, it is running the Java classes from its own JVM.  There were no remote calls.&lt;/p&gt;

&lt;p&gt;Of course, the service implementer may choose to implement a service as a remote service and export only a stub to the service registrar.  In that case the service calls will be remote calls.&lt;/p&gt;

&lt;p&gt;(Brian Coyner asked about the relationship between Jini and OSGi.)&lt;/p&gt;

&lt;h4&gt;Code&lt;/h4&gt;

&lt;p&gt;The server and the client uses the same code to talk with the Discovery service and the Lookup service.&lt;/p&gt;
 
&lt;pre style=&#034;margin-left:3em&#034;&gt;public class Foo implements DiscoveryListener {

  public void doIt() {
    LookupDiscovery discover = new LookupDiscovery(LookupDiscovery.ALL_GROUPS);
    discover.addDiscoveryListener(this);
  }

  public void discovered(DiscoveryEvent e) {

  }

  public void discarded(DiscoveryEvent e) {

  }
}&lt;/pre&gt;

&lt;p&gt;Jini services are just interfaces:&lt;/p&gt;

&lt;pre style=&#034;margin-left:3em&#034;&gt;public interface Converter {
  public String convert(String input) throws RemoteException;
}&lt;/pre&gt;

&lt;pre style=&#034;margin-left:3em&#034;&gt;public interface MorseConverter extends Converter {
}&lt;/pre&gt;

&lt;pre style=&#034;margin-left:3em&#034;&gt;public interface UppercaseConverter extends Converter {
}&lt;/pre&gt;

&lt;h4&gt;Some other interesting classes&lt;/h4&gt;

&lt;p&gt;&lt;tt&gt;RemoteEventListener&lt;/tt&gt;, &lt;tt&gt;ServiceRegistrar&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;The events are fired because we specified a ServiceTemplate:&lt;/p&gt;

&lt;pre style=&#034;margin-left:3em&#034;&gt;lookup(template, MAX_MATCHES);&lt;/pre&gt;

&lt;p&gt;where the template was constructed with parameters that contains the &lt;tt&gt;Converter&lt;/tt&gt; interface.&lt;/p&gt;

&lt;h4&gt;Discussion&lt;/h4&gt;

&lt;p&gt;(First person is Weiqi now.)&lt;/p&gt;

&lt;p&gt;Dean Wette commented that what is presented today is significantly simpler then Jini 1.0.&lt;/p&gt;

&lt;p&gt;Eric Burke commented on the Swing code for the Converter applciation emphasizing the importance of wrapping the &lt;tt&gt;menu.addMenuItem()&lt;/tt&gt; call with &lt;tt&gt;SwingUtilities&lt;/tt&gt; to ensure its execution on the EDT.&lt;/p&gt;

&lt;p&gt;I asked a question about the order in which various Jini services should be started.  The answer is that it mostly doesn&#039;t matter.  It&#039;s more like a peer-to-peer thing in that reguard.&lt;/p&gt;

&lt;p&gt;I asked the question about the maturity of Jini.  The answer is that Jini is indeed a technology that can be put into production use right away by people who know how to use it.  Dean added that any infrastructure that can support telemetry transmission from a Formula One pit (Magneti Marelli) is mature.&lt;/p&gt;
        </description>
      
      
    
    
    
    <comments>http://www.weiqigao.com/blog/2007/09/28/reintroducing_jini_2_1.html#comments</comments>
    <guid isPermaLink="true">http://www.weiqigao.com/blog/2007/09/28/reintroducing_jini_2_1.html</guid>
    <pubDate>Fri, 28 Sep 2007 21:52:15 GMT</pubDate>
  </item>
  
  <item>
    <title>Go Listen To Jim Waldo!</title>
    <link>http://www.weiqigao.com/blog/2005/10/05/go_listen_to_jim_waldo.html</link>
    
      
        <description>
          &lt;p&gt;&lt;em&gt;(Via &lt;a href= &#034;http://cld.blog-city.com/jim_waldo_talks_mp3pdf_about_soa_and_jini.htm&#034; &gt;Charles Ditzel&lt;/a&gt;)&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Jim Waldo (&lt;a href= &#034;http://www.jini.org/events/0505NYSIG/WaldoNYCJUG.mp3&#034; &gt;audio&lt;/a&gt;, &lt;a href= &#034;http://www.jini.org/events/0505NYSIG/WaldoNYCJUG.pdf&#034; &gt;slides&lt;/a&gt;): If you don&#039;t have a failure model, what you do have is a failure model that says any failure will be catastrophic.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Jim Waldo is one of the authors of the classic paper: &lt;a href= &#034;http://research.sun.com/techrep/1994/abstract-29.html&#034; &gt;A Note on Distributed Computing&lt;/a&gt;.&lt;/p&gt;
        </description>
      
      
    
    
    
    <comments>http://www.weiqigao.com/blog/2005/10/05/go_listen_to_jim_waldo.html#comments</comments>
    <guid isPermaLink="true">http://www.weiqigao.com/blog/2005/10/05/go_listen_to_jim_waldo.html</guid>
    <pubDate>Thu, 06 Oct 2005 01:58:15 GMT</pubDate>
  </item>
  
  </channel>
</rss>

