com.smaxe.uv.client
Class SharedObject

java.lang.Object
  extended by AbstractSharedObject
      extended by com.smaxe.uv.client.SharedObject
All Implemented Interfaces:
ISharedObject

public final class SharedObject
extends AbstractSharedObject
implements ISharedObject

SharedObject - remote ISharedObject implementation.

Version:
1.5.12
Author:
Andrei Sochirca
See Also:
JUV RTMP Client

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.smaxe.uv.client.ISharedObject
ISharedObject.Change, ISharedObject.IListener, ISharedObject.ListenerAdapter
 
Field Summary
 
Fields inherited from interface com.smaxe.uv.client.ISharedObject
defaultObjectEncoding
 
Constructor Summary
SharedObject(java.lang.String name)
          Constructor.
SharedObject(java.lang.String name, boolean persistent)
          Constructor.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.smaxe.uv.client.ISharedObject
addEventListener, clear, client, client, fps, fps, getName, isPersistent, objectEncoding, objectEncoding, removeEventListener
 

Constructor Detail

SharedObject

public SharedObject(java.lang.String name,
                    boolean persistent)
Constructor.

Parameters:
name - local shared object name
persistent - persistent flag

SharedObject

public SharedObject(java.lang.String name)
Constructor.

Parameters:
name - name
Method Detail

connect

public void connect(INetConnection connection,
                    java.lang.String params)
Description copied from interface: ISharedObject
Connects to a remote shared object on the server through the specified connection.

Specified by:
connect in interface ISharedObject
Parameters:
connection - connection
params - connection parameters

send

public void send(java.lang.String action,
                 java.lang.Object... args)
Description copied from interface: ISharedObject
Broadcasts a message to all clients connected to the specified remote shared object, including the client that sent the message.

Specified by:
send in interface ISharedObject
Parameters:
action - action
args - arguments (0 or more)

data

public java.util.Map<java.lang.String,java.lang.Object> data()
Description copied from interface: ISharedObject
Returns shared object data.

Specified by:
data in interface ISharedObject
Returns:
collection of attributes assigned to the data property of the object

setProperty

public void setProperty(java.lang.String propertyName,
                        java.lang.Object value)
Description copied from interface: ISharedObject
Updates the value of a property in a shared object and indicates to the server that the value of the property has changed.

Specified by:
setProperty in interface ISharedObject
Parameters:
propertyName - property name
value - value

size

public int size()
Description copied from interface: ISharedObject
Returns current size of the shared object, in bytes.

Specified by:
size in interface ISharedObject
Returns:
current size of the shared object, in bytes

close

public void close()
Description copied from interface: ISharedObject
Closes the connection between a remote shared object and the server.

Specified by:
close in interface ISharedObject

setDirty

public void setDirty(java.lang.String propertyName)
Description copied from interface: ISharedObject
Indicates to the server that the value of a property in the shared object has changed.

Specified by:
setDirty in interface ISharedObject
Parameters:
propertyName - property name

flush

public void flush(int minDiskSpace)
Description copied from interface: ISharedObject
Immediately writes a locally persistent shared object to a local file.

Specified by:
flush in interface ISharedObject