|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.red5.server.AttributeStore
org.red5.server.so.SharedObject
org.red5.server.so.ClientSharedObject
public class ClientSharedObject
Works with client-side shared object
| Field Summary | |
|---|---|
protected static Logger |
log
Logger |
| Fields inherited from class org.red5.server.so.SharedObject |
|---|
acquireCount, changeStats, deleteStats, lastModified, listenerStats, modified, name, ownerMessage, path, persistent, persistentSO, sendStats, source, storage, syncEvents, updateCounter, version |
| Fields inherited from class org.red5.server.AttributeStore |
|---|
attributes |
| Fields inherited from interface org.red5.server.api.persistence.IPersistable |
|---|
TRANSIENT_PREFIX |
| Constructor Summary | |
|---|---|
ClientSharedObject(String name,
boolean persistent)
Create new client SO with |
|
| Method Summary | |
|---|---|
void |
addSharedObjectListener(ISharedObjectListener listener)
Register object that will be notified about update events. |
void |
beginUpdate()
Begin update of this Shared Object. |
void |
beginUpdate(IEventListener listener)
Begin update of this Shared Object and setting listener |
boolean |
clear()
Deletes all the attributes and sends a clear event to all listeners. |
void |
close()
Detaches a reference from this shared object, reset it's state, this will destroy the reference immediately. |
void |
connect(IConnection conn)
Connect the shared object using the passed connection. |
void |
disconnect()
Disconnect the shared object. |
void |
dispatchEvent(IEvent e)
Dispatches event |
void |
endUpdate()
End update of this Shared Object. |
Object |
getAttribute(String name,
Object defaultValue)
Return attribute by name and set if it doesn't exist yet. |
Object |
getServiceHandler(String name)
Return a previously registered service handler. |
Set<String> |
getServiceHandlerNames()
Get list of registered service handler names. |
boolean |
isConnected()
Check if the shared object is connected to the server. |
boolean |
isLocked()
Returns the locked state of this SharedObject. |
void |
lock()
Locks the shared object instance. |
protected void |
notifyClear()
Notify listeners on clear |
protected void |
notifyConnect()
Notify listeners on event |
protected void |
notifyDelete(String key)
Notify listeners on attribute delete |
protected void |
notifyDisconnect()
Notify listeners on disconnect |
protected void |
notifySendMessage(String method,
List<?> params)
Broadcast send event to listeners |
protected void |
notifyUpdate(String key,
Map<String,Object> value)
Notify listeners on map attribute update |
protected void |
notifyUpdate(String key,
Object value)
Notify listeners on update |
void |
registerServiceHandler(Object handler)
Register an object that provides methods which handle calls without a service name to a shared object. |
void |
registerServiceHandler(String name,
Object handler)
Register an object that provides methods which can be called from a client. |
boolean |
removeAttribute(String name)
Removes attribute with given name |
void |
removeAttributes()
Remove all attributes (clear Shared Object) |
void |
removeSharedObjectListener(ISharedObjectListener listener)
Unregister object to not longer receive update events. |
void |
sendMessage(String handler,
List<?> arguments)
Broadcast event to event handler |
boolean |
setAttribute(String name,
Object value)
Set value of attribute with given name |
void |
setAttributes(IAttributeStore values)
Set attributes as attributes store. |
void |
setAttributes(Map<String,Object> values)
Set attributes as map. |
void |
unlock()
Unlocks a shared object instance that was locked with SharedObject.lock(). |
void |
unregisterServiceHandler(String name)
Unregister the shared object handler for calls without a service name. |
| Methods inherited from class org.red5.server.so.SharedObject |
|---|
acquire, checkRelease, deserialize, getActiveListeners, getCreationTime, getData, getLastModified, getListeners, getMaxListeners, getName, getPath, getStore, getTotalChanges, getTotalDeletes, getTotalListeners, getTotalSends, getType, getVersion, isAcquired, isPersistent, isPersistentObject, notifyModified, register, release, returnAttributeValue, returnError, sendUpdates, serialize, setName, setPath, setPersistent, setStore, unregister |
| Methods inherited from class org.red5.server.AttributeStore |
|---|
filterNull, getAttribute, getAttributeNames, getAttributes, getBoolAttribute, getByteAttribute, getDoubleAttribute, getIntAttribute, getListAttribute, getLongAttribute, getMapAttribute, getSetAttribute, getShortAttribute, getStringAttribute, hasAttribute |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.red5.server.api.so.ISharedObjectBase |
|---|
getData, getVersion, isPersistentObject |
| 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, getAttributeNames, getAttributes, hasAttribute |
| Field Detail |
|---|
protected static Logger log
| Constructor Detail |
|---|
public ClientSharedObject(String name,
boolean persistent)
name - Shared Object namepersistent - Persistence flag| Method Detail |
|---|
public void connect(IConnection conn)
connect in interface IClientSharedObjectconn - Attach SO to given connectionpublic void disconnect()
disconnect in interface IClientSharedObjectpublic boolean isConnected()
isConnected in interface IClientSharedObjectpublic void addSharedObjectListener(ISharedObjectListener listener)
addSharedObjectListener in interface ISharedObjectBaselistener - the object to notifypublic void removeSharedObjectListener(ISharedObjectListener listener)
removeSharedObjectListener in interface ISharedObjectBaselistener - the object to unregisterpublic void dispatchEvent(IEvent e)
dispatchEvent in interface IEventDispatchere - Event objectprotected void notifyConnect()
protected void notifyDisconnect()
protected void notifyUpdate(String key,
Object value)
key - Updated attribute keyvalue - Updated attribute value
protected void notifyUpdate(String key,
Map<String,Object> value)
key - Updated attribute keyvalue - Updated attribute valueprotected void notifyDelete(String key)
key - Attribute nameprotected void notifyClear()
protected void notifySendMessage(String method,
List<?> params)
method - Method nameparams - Params
public boolean setAttribute(String name,
Object value)
setAttribute in interface AttributeStoreMBeansetAttribute in interface IAttributeStoresetAttribute in class SharedObjectname - Attribute namevalue - Attribute value
true if there's such attribute and value was set, false otherwisepublic void setAttributes(IAttributeStore values)
setAttributes in interface IAttributeStoresetAttributes in class SharedObjectvalues - Attributes.public void setAttributes(Map<String,Object> values)
setAttributes in interface IAttributeStoresetAttributes in class SharedObjectvalues - Attributes.public boolean removeAttribute(String name)
removeAttribute in interface AttributeStoreMBeanremoveAttribute in interface IAttributeStoreremoveAttribute in class SharedObjectname - Attribute
true if there's such an attribute and it was removed, false otherwise
public void sendMessage(String handler,
List<?> arguments)
sendMessage in interface ISharedObjectBasesendMessage in class SharedObjecthandler - Event handlerarguments - Argumentspublic void removeAttributes()
removeAttributes in interface AttributeStoreMBeanremoveAttributes in interface IAttributeStoreremoveAttributes in class SharedObjectpublic boolean clear()
clear in interface ISharedObjectBaseclear in class SharedObjecttrue on success, false otherwisepublic void close()
close in interface ISharedObjectBaseclose in class SharedObjectpublic void beginUpdate()
beginUpdate in interface ISharedObjectBasebeginUpdate in class SharedObjectpublic void beginUpdate(IEventListener listener)
beginUpdate in interface ISharedObjectBasebeginUpdate in class SharedObjectlistener - Update with listenerpublic void endUpdate()
endUpdate in interface ISharedObjectBaseendUpdate in class SharedObjectpublic void lock()
lock in interface ISharedObjectBasepublic void unlock()
unlock in interface ISharedObjectBasepublic boolean isLocked()
isLocked in interface ISharedObjectBasepublic void registerServiceHandler(Object handler)
registerServiceHandler in interface ISharedObjectHandlerProviderhandler - the handler objectpublic void unregisterServiceHandler(String name)
unregisterServiceHandler in interface IServiceHandlerProviderunregisterServiceHandler in interface ISharedObjectHandlerProvidername - the name of the handler
public void registerServiceHandler(String name,
Object handler)
Example:
If you registered a handler with the name "one.two" that
provides a method "callMe", you can call a method
"one.two.callMe" from the client.
registerServiceHandler in interface IServiceHandlerProvidername - the name of the handlerhandler - the handler objectpublic Object getServiceHandler(String name)
getServiceHandler in interface IServiceHandlerProvidername - the name of the handler to return
public Set<String> getServiceHandlerNames()
getServiceHandlerNames in interface IServiceHandlerProvider
public Object getAttribute(String name,
Object defaultValue)
getAttribute in interface AttributeStoreMBeangetAttribute in interface IAttributeStoregetAttribute in class SharedObjectname - Attribute namedefaultValue - Value to set if attribute doesn't exist
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||