{"id":127223,"date":"2014-04-26T04:52:08","date_gmt":"2014-04-26T08:52:08","guid":{"rendered":"http:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/uncategorized\/the-architecture-of-open-source-applications-jitsi.php"},"modified":"2014-04-26T04:52:08","modified_gmt":"2014-04-26T08:52:08","slug":"the-architecture-of-open-source-applications-jitsi","status":"publish","type":"post","link":"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/jitsi\/the-architecture-of-open-source-applications-jitsi.php","title":{"rendered":"The Architecture of Open Source Applications: Jitsi"},"content":{"rendered":"<p><p>    Jitsi is an application that allows people to make video and    voice calls, share their desktops, and exchange files and    messages. More importantly it allows people to do this over a    number of different protocols, ranging from the standardized    XMPP (Extensible Messaging and Presence Protocol) and SIP    (Session Initiation Protocol) to proprietary ones like Yahoo!    and Windows Live Messenger (MSN). It runs on Microsoft Windows,    Apple Mac OS X, Linux, and FreeBSD. It is written mostly in    Java but it also contains parts written in native code. In this    chapter, we'll look at Jitsi's OSGi-based architecture, see how    it implements and manages protocols, and look back on what    we've learned from building it.  <\/p>\n<p>      The three most important constraints that we had to keep in      mind when designing Jitsi (at the time called SIP      Communicator) were multi-protocol support, cross-platform      operation, and developer-friendliness.    <\/p>\n<p>      From a developer's perspective, being multi-protocol comes      down to having a common interface for all protocols. In other      words, when a user sends a message, our graphical user      interface needs to always call the same      sendMessage method regardless of whether the      currently selected protocol actually uses a method called      sendXmppMessage or sendSipMsg.    <\/p>\n<p>      The fact that most of our code is written in Java satisfies,      to a large degree, our second constraint: cross-platform      operation. Still, there are things that the Java Runtime      Environment (JRE) does not support or does not do the way      we'd like it to, such as capturing video from your webcam.      Therefore, we need to use DirectShow on Windows, QTKit on Mac      OS X, and Video for Linux 2 on Linux. Just as with protocols,      the parts of the code that control video calls cannot be      bothered with these details (they are complicated enough as      it is).    <\/p>\n<p>      Finally, being developer-friendly means that it should be      easy for people to add new features. There are millions of      people using VoIP today in thousands of different ways;      various service providers and server vendors come up with      different use cases and ideas about new features. We have to      make sure that it is easy for them to use Jitsi the way they      want. Someone who needs to add something new should have to      read and understand only those parts of the project they are      modifying or extending. Similarly, one person's changes      should have as little impact as possible on everyone else's      work.    <\/p>\n<p>      To sum up, we needed an environment where different parts of      the code are relatively independent from each other. It had      to be possible to easily replace some parts depending on the      operating system; have others, like protocols, run in      parallel and yet act the same; and it had to be possible to      completely rewrite any one of those parts and have the rest      of the code work without any changes. Finally, we wanted the      ability to easily switch parts on and off, as well as the      ability to download plugins over the Internet to our list.    <\/p>\n<p>      We briefly considered writing our own framework, but soon      dropped the idea. We were itching to start writing VoIP and      IM code as soon as possible, and spending a couple of months      on a plugin framework didn't seem that exciting. Someone      suggested OSGi, and it seemed to be the perfect fit.    <\/p>\n<p>      People have written entire books about OSGi, so we're not      going to go over everything the framework stands for. Instead      we will only explain what it gives us and the way we use it      in Jitsi.    <\/p>\n<p>      Above everything else, OSGi is about modules. Features in      OSGi applications are separated into bundles. An OSGi bundle      is little more than a regular JAR file like the ones used to      distribute Java libraries and applications. Jitsi is a      collection of such bundles. There is one responsible for      connecting to Windows Live Messenger, another one that does      XMPP, yet another one that handles the GUI, and so on. All      these bundles run together in an environment provided, in our      case, by Apache Felix, an open source OSGi implementation.    <\/p>\n<p>      All these modules need to work together. The GUI bundle needs      to send messages via the protocol bundles, which in turn need      to store them via the bundles handling message history. This      is what OSGi services are for: they represent the part of a      bundle that is visible to everyone else. An OSGi service is      most often a group of Java interfaces that allow use of a      specific functionality like logging, sending messages over      the network, or retrieving the list of recent calls. The      classes that actually implement the functionality are known      as a service implementation. Most of them carry the name of      the service interface they implement, with an \"Impl\" suffix      at the end (e.g., ConfigurationServiceImpl). The      OSGi framework allows developers to hide service      implementations and make sure that they are never visible      outside the bundle they are in. This way, other bundles can      only use them through the service interfaces.    <\/p>\n<p><!-- Auto Generated --><\/p>\n<p>Follow this link: <\/p>\n<p><a target=\"_blank\" rel=\"nofollow\" href=\"http:\/\/www.aosabook.org\/en\/jitsi.html\" title=\"The Architecture of Open Source Applications: Jitsi\">The Architecture of Open Source Applications: Jitsi<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p> Jitsi is an application that allows people to make video and voice calls, share their desktops, and exchange files and messages. More importantly it allows people to do this over a number of different protocols, ranging from the standardized XMPP (Extensible Messaging and Presence Protocol) and SIP (Session Initiation Protocol) to proprietary ones like Yahoo! and Windows Live Messenger (MSN). It runs on Microsoft Windows, Apple Mac OS X, Linux, and FreeBSD.  <a href=\"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/jitsi\/the-architecture-of-open-source-applications-jitsi.php\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"limit_modified_date":"","last_modified_date":"","_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[261458],"tags":[],"class_list":["post-127223","post","type-post","status-publish","format-standard","hentry","category-jitsi"],"modified_by":null,"_links":{"self":[{"href":"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/wp-json\/wp\/v2\/posts\/127223"}],"collection":[{"href":"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/wp-json\/wp\/v2\/comments?post=127223"}],"version-history":[{"count":0,"href":"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/wp-json\/wp\/v2\/posts\/127223\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/wp-json\/wp\/v2\/media?parent=127223"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/wp-json\/wp\/v2\/categories?post=127223"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/wp-json\/wp\/v2\/tags?post=127223"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}