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:

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

Posted by Dion Almaer at 5:25 am
2 Comments

+++--
3.8 rating from 26 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.