Search in sources :

Example 1 with IClientSharedObject

use of org.red5.server.api.so.IClientSharedObject in project red5-client by Red5.

the class BaseRTMPClientHandler method getSharedObject.

/**
 * Connect to client shared object.
 *
 * @param name
 *            Client shared object name
 * @param persistent
 *            SO persistence flag
 * @return Client shared object instance
 */
@Override
public IClientSharedObject getSharedObject(String name, boolean persistent) {
    log.debug("getSharedObject name: {} persistent {}", new Object[] { name, persistent });
    ClientSharedObject result = sharedObjects.get(name);
    if (result != null) {
        if (result.isPersistent() != persistent) {
            throw new RuntimeException("Already connected to a shared object with this name, but with different persistence.");
        }
        return result;
    }
    result = new ClientSharedObject(name, persistent);
    sharedObjects.put(name, result);
    return result;
}
Also used : IClientSharedObject(org.red5.server.api.so.IClientSharedObject) ClientSharedObject(org.red5.server.so.ClientSharedObject)

Aggregations

IClientSharedObject (org.red5.server.api.so.IClientSharedObject)1 ClientSharedObject (org.red5.server.so.ClientSharedObject)1