Activate your free membership today | Log-in

Monday, February 18th, 2008

Liberator Comet Platform: Free Edition

Category: Comet, Java, JavaScript, Library

Caplin Systems, creator of the Liberator Comet platform have announced a free version which can be used for non-commercial applications and for evaluation.

Liberator includes a high-performance Comet server, a JavaScript client library, and a Java server integration library.

There are many examples such as the subscriptions sample which shows a page with realtime updating information for a variety of equities and foreign exchange data.

Liberator Subscriptions

This is how a subscriber looks in JavaScript:

HTML:
  1.  
  2. <script type="text/javascript" id="sl4b" src="/sl4b" rttpprovider="javascript"></script>
  3. <script type="text/javascript">
  4. // class definition for SimpleSubscriber
  5. function SimpleSubscriber(sObjectName)
  6. {
  7.    // Store the object name as a member variable so it can be used later on; no subscription can
  8.    // take place until this object's ready() method has been called.
  9.    this.m_sObjectName = sObjectName;
  10.  
  11.    // Invokes the initialise method on the base class (i.e. SL4B_AbstractSubscriber), this
  12.    // must be called within the constructor of all SL4B_AbstractSubscriber subclasses.
  13.    this.initialise();
  14. }
  15.  
  16. // Defines SimpleSubscriber as a subclass of SL4B_AbstractSubscriber.
  17. SimpleSubscriber.prototype = new SL4B_AbstractSubscriber;
  18.  
  19. // Overrides the ready() method from SL4B_AbstractSubscriber; once this method has been invoked
  20. // it becomes safe to make object subscriptions.
  21. SimpleSubscriber.prototype.ready = function() {
  22.    // Use the RTTP provider to setup the subscription; a reference to this object is passed in
  23.    // since it will be acting as the subscriber, and will receive the notification updates.
  24.    SL4B_Accessor.getRttpProvider().getObject(this, this.m_sObjectName);
  25. };
  26.  
  27. // Overrides the recordUpdated() callback method from SL4B_AbstractSubscriber; this method will
  28. // be invoked whenever new object data becomes available.
  29. SimpleSubscriber.prototype.recordUpdated = function (sObjectName, sFieldName, sValue) {
  30.    // add code to process the record update here
  31. }
  32.  
  33. // Creates a new SimpleSubscriber to receive streaming updates for /DEMO/YHOO.
  34. new SimpleSubscriber("/DEMO/YHOO");
  35. </script>
  36.  

Posted by Dion Almaer at 5:25 am

++++-
4 rating from 21 votes

2 Comments »

Comments feed TrackBack URI

Tell me that their framework doesn’t spell ‘initialize’ wrong.

Comment by leftist — February 19, 2008

They’re British, so I think us Americans actually spell it wrong. I think that’s why so many developers spell it init :)

Comment by Dylan Schiemann — February 19, 2008

Leave a comment

You must be logged in to post a comment.