|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ISharedObjectBase
Base interface for shared objects. Changes to the shared objects are propagated to all subscribed clients. If you want to modify multiple attributes and notify the clients about all changes at once, you can use code like this:
SharedObject.beginUpdate();
SharedObject.setAttribute("One", '1');
SharedObject.setAttribute("Two", '2');
SharedObject.removeAttribute("Three");
SharedObject.endUpdate();
Method Summary | |
---|---|
void |
addSharedObjectListener(ISharedObjectListener listener)
Register object that will be notified about update events. |
void |
beginUpdate()
Start performing multiple updates to the shared object from serverside code. |
void |
beginUpdate(IEventListener source)
Start performing multiple updates to the shared object from a connected client. |
boolean |
clear()
Deletes all the attributes and sends a clear event to all listeners. |
void |
close()
Detaches a reference from this shared object, this will destroy the reference immediately. |
void |
endUpdate()
The multiple updates are complete, notify clients about all changes at once. |
Map<String,Object> |
getData()
Return a map containing all attributes of the shared object. |
int |
getVersion()
Returns the version of the shared object. |
boolean |
isLocked()
Returns the locked state of this SharedObject. |
boolean |
isPersistent()
Check if the object has been created as persistent shared object by the client. |
void |
lock()
Locks the shared object instance. |
void |
removeSharedObjectListener(ISharedObjectListener listener)
Unregister object to not longer receive update events. |
void |
sendMessage(String handler,
List<?> arguments)
Send a message to a handler of the shared object. |
void |
unlock()
Unlocks a shared object instance that was locked with SharedObject.lock(). |
Methods inherited from interface org.red5.server.api.so.ISharedObjectHandlerProvider |
---|
registerServiceHandler, unregisterServiceHandler |
Methods inherited from interface org.red5.server.api.service.IServiceHandlerProvider |
---|
getServiceHandler, getServiceHandlerNames, registerServiceHandler |
Methods inherited from interface org.red5.server.api.ICastingAttributeStore |
---|
getBoolAttribute, getByteAttribute, getDoubleAttribute, getIntAttribute, getListAttribute, getLongAttribute, getMapAttribute, getSetAttribute, getShortAttribute, getStringAttribute |
Methods inherited from interface org.red5.server.api.IAttributeStore |
---|
getAttribute, getAttribute, getAttributeNames, getAttributes, hasAttribute, removeAttribute, removeAttributes, setAttribute, setAttributes, setAttributes, size |
Method Detail |
---|
int getVersion()
boolean isPersistent()
Map<String,Object> getData()
void sendMessage(String handler, List<?> arguments)
handler
- the name of the handler to callarguments
- a list of objects that should be passed as arguments to the
handlervoid beginUpdate()
void beginUpdate(IEventListener source)
source
- Update events listenervoid endUpdate()
void addSharedObjectListener(ISharedObjectListener listener)
listener
- the object to notifyvoid removeSharedObjectListener(ISharedObjectListener listener)
listener
- the object to unregistervoid lock()
void unlock()
boolean isLocked()
boolean clear()
void close()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |