[Red5commits] [949] added section about SO handlers

jbauch luke at codegent.com
Tue Jun 20 04:18:28 EDT 2006


added section about SO handlers


Timestamp: 06/12/06 07:31:19 (1 week ago) 
Change: 949 
Author: jbauch

Files (see diff or trac for details): 
doc/trunk/MigrationGuide.txt


Trac: http://mirror1.cvsdude.com/trac/osflash/red5/changeset/949

Index: /doc/trunk/MigrationGuide.txt
===================================================================
--- /doc/trunk/MigrationGuide.txt (revision 945)
+++ /doc/trunk/MigrationGuide.txt (revision 949)
@@ -229,6 +229,8 @@
 
 
-To get notified about changes of the shared object, a handler must implement
-the interface ISharedObjectListener_::
+Serverside change listeners
+---------------------------
+To get notified about changes of the shared object similar to `onSync` in
+FCS / FMS, a listener must implement the interface ISharedObjectListener_::
 
   import org.red5.server.api.so.ISharedObject;
@@ -254,5 +256,5 @@
 
 
-Additionally, the handler must get registered at the shared object::
+Additionally, the listener must get registered at the shared object::
 
   ISharedObject so = getSharedObject(scope, "sampleSO");
@@ -260,4 +262,6 @@
 
 
+Changing from application code
+------------------------------
 A shared object can be changed by the server as well::
 
@@ -280,6 +284,34 @@
   so.endUpdate();
 
-The serverside handlers will receive their update notifications through
+The serverside listeners will receive their update notifications through
 separate method calls as without the `beginUpdate` and `endUpdate`.
+
+
+SharedObject event handlers
+----------------------------
+Calls to shared object handlers through `remote_so.send(<handler>, <args>)`
+from a Flash client or the corresponding serverside call can be mapped to
+methods in Red5.  Therefore a handler must get registered through a method
+of the ISharedObjectHandlerProvider_ interface similar to the application
+handlers::
+
+  class MySharedObjectHandler {
+  
+      public void myMethod(String arg1) {
+          // Now do something
+      }
+      
+  }
+
+  ...
+  ISharedObject so = getSharedObject(scope, "sampleSO");
+  so.registerServiceHandler(new MySharedObjectHandler());
+
+Handlers with a given name can be registered as well::
+
+  ISharedObject so = getSharedObject(scope, "sampleSO");
+  so.registerServiceHandler("one.two", new MySharedObjectHandler());
+
+Here, the method could be called through `one.to.myMethod`.
 
 
@@ -428,2 +460,3 @@
 .. _ISchedulingService: http://dl.fancycode.com/red5/api/org/red5/server/api/scheduling/ISchedulingService.html
 .. _IScheduledJob: http://dl.fancycode.com/red5/api/org/red5/server/api/scheduling/IScheduledJob.html
+.. _ISharedObjectHandlerProvider: http://dl.fancycode.com/red5/api/org/red5/server/api/so/ISharedObjectHandlerProvider.html


Note:
Diffs are chopped if more than 30k.
This is to get past the limit on the mailing list.



More information about the Red5commits mailing list