Hi,
When calling the method getAttributes within the application scope, I was
unable to get back a Map<String, Object> as expected.
However, by adding a method definition for getAttributes inside
src/org/red5/server/so/SharedObjectScope.java, I was succesfully able to
call the related method in src/org/red5/server/so/SharedObject.java
so.getAttributes is now working as expected. Please find the patch here
attached.
--
C is forever.
--- SharedObjectScope.java 2007-02-04 18:45:33.000000000 +0300
+++ /home/sysadmin/red5/red5_server/src/org/red5/server/so/SharedObjectScope.java 2007-02-04 16:56:41.000000000 +0300
@@ -19,15 +19,6 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-import java.lang.reflect.Method;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.locks.ReentrantLock;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.red5.server.BaseConnection;
@@ -42,6 +33,10 @@
import org.red5.server.api.so.ISharedObjectListener;
import org.red5.server.service.ServiceUtils;
+import java.lang.reflect.Method;
+import java.util.*;
+import java.util.concurrent.locks.ReentrantLock;
+
/**
* Special scope for shared objects
*/
@@ -97,6 +92,15 @@
}
}
+ /**
+ * Setter for persistence class.
+ *
+ * @param persistenceClass Persistence class.
+ */
+ public void setPersistenceClass(String persistenceClass) {
+ // Nothing to do here, the shared object will take care of persistence.
+ }
+
/** [EMAIL PROTECTED] */
@Override
public IPersistenceStore getStore() {
@@ -309,7 +313,13 @@
public Object getAttribute(String name) {
return so.getAttribute(name);
}
-
+
+ /** [EMAIL PROTECTED] */
+ @Override
+ public Map<String, Object> getAttributes() {
+ return so.getAttributes();
+ }
+
/** [EMAIL PROTECTED] */
@Override
public Set<String> getAttributeNames() {
@@ -394,7 +404,7 @@
/** [EMAIL PROTECTED] */
@Override
public synchronized void setAttributes(IAttributeStore values) {
- beginUpdate();
+ beginUpdate();
so.setAttributes(values);
endUpdate();
_______________________________________________
Red5 mailing list
[email protected]
http://osflash.org/mailman/listinfo/red5_osflash.org