public final class SharedObject extends AbstractSharedObject implements ISharedObject
SharedObject - remote ISharedObject implementation.ISharedObject.Change, ISharedObject.IListener, ISharedObject.ListenerAdapterdefaultObjectEncoding| Constructor and Description |
|---|
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, waitaddEventListener, clear, client, client, fps, fps, getName, isPersistent, objectEncoding, objectEncoding, removeEventListenerpublic SharedObject(java.lang.String name,
boolean persistent)
name - local shared object namepersistent - persistent flagpublic SharedObject(java.lang.String name)
name - namepublic void connect(INetConnection connection, java.lang.String params)
ISharedObjectconnect in interface ISharedObjectconnection - connectionparams - connection parameterspublic void send(java.lang.String action,
java.lang.Object... args)
ISharedObjectsend in interface ISharedObjectaction - actionargs - arguments (0 or more)public java.util.Map<java.lang.String,java.lang.Object> data()
ISharedObjectdata in interface ISharedObjectdata
property of the objectpublic void setProperty(java.lang.String propertyName,
java.lang.Object value)
ISharedObjectsetProperty in interface ISharedObjectpropertyName - property namevalue - valuepublic int size()
ISharedObjectsize in interface ISharedObjectpublic void close()
ISharedObjectclose in interface ISharedObjectpublic void setDirty(java.lang.String propertyName)
ISharedObjectsetDirty in interface ISharedObjectpropertyName - property namepublic void flush(int minDiskSpace)
ISharedObjectflush in interface ISharedObject