Hi,

Based on Joachim's tutorial
(http://www.joachim-bauch.de/tutorials/red5/MigrationGuide.txt#serverside-ch
ange-listeners) I've tried to implement a SharedObjectListener.

I'am trying the same as Edmond did on 29/05/06 but without any success.

I think it's a small issue somewhere. Any ideas?

Regards,
Ruben

P.s. I will publish all working code snippets on my weblog.
(http://weblogs.amtex.nl)





package sampleSharedObjectListener;

import org.red5.server.adapter.*;
import org.red5.server.api.so.*;
import org.red5.server.api.IScope;
import java.util.List;

public class Application extends ApplicationAdapter  {

        public class SampleSharedObjectListener implements
ISharedObjectListener {
                public void onSharedObjectUpdate(ISharedObject so, String
key, Object value) {
                        // The attribute <key> of the shared object <so>
                        // was changed to <value>.
                        System.out.println("SO changes detected!");
                }
        
                public void onSharedObjectDelete(ISharedObject so, String
key) {
                        // The attribute <key> of the shared object <so> was
deleted.
                }
        
                public void onSharedObjectSend(ISharedObject so, String
method, List params) {
                        // The handler <method> of the shared object <so>
was called
                        // with the parameters <params>.
                }
        
                public void onSharedObjectConnect(ISharedObject so) {
                        // TODO Auto-generated method stub

                }
        
                public void onSharedObjectSend(ISharedObject arg0, String
arg1, Object[] arg2) {
                        // TODO Auto-generated method stub      
                }
        
        }

        public boolean appStart(IScope scope) {
                // Original code:
                ISharedObject so = getSharedObject(scope, "sampleSO");
                so.addSharedObjectListener(new
SampleSharedObjectListener());
                /*
                Eclipse says:
                -The method getSharedObject(String) in the type
ApplicationAdapter is not applicable for the arguments (IScope, String)
Application.java
                -The method
addSharedObjectListener(Application.SampleSharedObjectListener) is undefined
for the type ISharedObject      Application.java                
                */
                

                // My code (doesn't work either):
                // ISharedObject so = getSharedObject("sampleSO");
                // so.addEventListener(new SampleSharedObjectListener());

                return true;
        }

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.2/370 - Release Date: 20-06-2006
 
  

Attachment: sampleSharedObjectListener.java
Description: Binary data

_______________________________________________
Red5 mailing list
[email protected]
http://osflash.org/mailman/listinfo/red5_osflash.org

Reply via email to