public final class SharedObject extends AbstractSharedObject implements ISharedObject
SharedObject
- remote ISharedObject
implementation.ISharedObject.Change, ISharedObject.IListener, ISharedObject.ListenerAdapter
defaultObjectEncoding
Constructor and Description |
---|
SharedObject(IRtmpConnection connection,
java.lang.String name,
boolean persistent)
Constructor.
|
SharedObject(java.lang.String name)
Constructor.
|
SharedObject(java.lang.String name,
boolean persistent)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the connection between a remote shared object and the server.
|
void |
connect(INetConnection connection,
java.lang.String params)
Connects to a remote shared object on the server through the specified connection.
|
java.util.Map<java.lang.String,java.lang.Object> |
data()
Returns shared object data.
|
void |
flush(int minDiskSpace)
Immediately writes a locally persistent shared object to a local file.
|
void |
send(java.lang.String action,
java.lang.Object... args)
Broadcasts a message to all clients connected to the specified remote
shared object, including the client that sent the message.
|
void |
setDirty(java.lang.String propertyName)
Indicates to the server that the value of a property in the shared object has changed.
|
void |
setProperty(java.lang.String propertyName,
java.lang.Object value)
Updates the value of a property in a shared object and indicates
to the server that the value of the property has changed.
|
int |
size()
Returns current size of the shared object, in bytes.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addEventListener, clear, client, client, fps, fps, getName, isPersistent, objectEncoding, objectEncoding, removeEventListener
public SharedObject(java.lang.String name)
name
- namepublic SharedObject(java.lang.String name, boolean persistent)
name
- shared object namepersistent
- persistent flagpublic SharedObject(IRtmpConnection connection, java.lang.String name, boolean persistent)
connection
- name
- shared object namepersistent
- persistent flagpublic void connect(INetConnection connection, java.lang.String params)
ISharedObject
connect
in interface ISharedObject
connection
- connectionparams
- connection parameterspublic void send(java.lang.String action, java.lang.Object... args)
ISharedObject
send
in interface ISharedObject
action
- actionargs
- arguments (0 or more)public java.util.Map<java.lang.String,java.lang.Object> data()
ISharedObject
data
in interface ISharedObject
data
property of the objectpublic void setProperty(java.lang.String propertyName, java.lang.Object value)
ISharedObject
setProperty
in interface ISharedObject
propertyName
- property namevalue
- valuepublic int size()
ISharedObject
size
in interface ISharedObject
public void close()
ISharedObject
close
in interface ISharedObject
public void setDirty(java.lang.String propertyName)
ISharedObject
setDirty
in interface ISharedObject
propertyName
- property namepublic void flush(int minDiskSpace)
ISharedObject
flush
in interface ISharedObject