Examples of ISharedObjectService


Examples of org.red5.server.api.so.ISharedObjectService

    so.setAttribute(path, scope.getAttributes());
  }

  public void updateSharedObjectStatistics(String path, String name) throws ScopeNotFoundException, SharedObjectException {
    IScope scope = getScope(path);
    ISharedObjectService soService = (ISharedObjectService) ScopeUtils.getScopeService(scope, ISharedObjectService.class, false);
    ISharedObject sourceSO = soService.getSharedObject(scope, name);
    if (sourceSO == null)
      throw new SharedObjectException();

    ISharedObject so = getSharedObjectStatisticsSO(Red5.getConnectionLocal().getScope());
    so.setAttribute(path + '|' + name, sourceSO.getData());
View Full Code Here

Examples of org.red5.server.api.so.ISharedObjectService

  @SuppressWarnings("deprecation")
  @Test
  public void sharedObjectService() {
    IScope scope = context.resolveScope(path_app);
    ISharedObjectService service = new SharedObjectService();
    assertTrue("should be empty", !service.hasSharedObject(scope, "blah"));
    assertTrue("create so", service.createSharedObject(scope, name, false));
    assertTrue("so exists?", service.hasSharedObject(scope, name));
    ISharedObject so = service.getSharedObject(scope, name);
    assertTrue("so not null", so != null);
    assertTrue("name same", so.getName().equals(name));
    //assertTrue("persistent",!so.isPersistent());
    so.addEventListener(this);
    so.setAttribute("this", "that");
View Full Code Here

Examples of org.red5.server.api.so.ISharedObjectService

   * @param scope
   *       the scope to return the shared object for
   * @return the shared object to use
   */
  private ISharedObject getSharedObject(IScope scope) {
    ISharedObjectService service = (ISharedObjectService) ScopeUtils
        .getScopeService(scope,
            ISharedObjectService.class,
            false);
    return service.getSharedObject(scope, name, persistent);
  }
View Full Code Here

Examples of org.red5.server.api.so.ISharedObjectService

   * @param path  Path of scope to return shared objects for
   * @return    A mapping containing the shared object name -> (persistent, data)
   */
  public Map<String, Object> getSharedObjects(String path) {
    IScope scope = getScope(path);
    ISharedObjectService service = (ISharedObjectService) ScopeUtils
        .getScopeService(scope,
            ISharedObjectService.class, false);
    if (service == null) {
      return new Hashtable<String, Object>();
    }

    Map<String, Object> result = new Hashtable<String, Object>();
    for (String name : service.getSharedObjectNames(scope)) {
      ISharedObject so = service.getSharedObject(scope, name);
      try {
        result.put(name, new Object[] { so.isPersistentObject(),
            getXMLRPCValue(so.getData()) });
      } catch (RuntimeException err) {
        // Could not convert attribute for XML-RPC serialization.
View Full Code Here

Examples of org.red5.server.api.so.ISharedObjectService

  public void setGlobalScope(IScope scope) {
    globalScope = scope;
  }
 
  public ISharedObject getScopeStatisticsSO(IScope scope) {
    ISharedObjectService soService = (ISharedObjectService) ScopeUtils.getScopeService(scope, ISharedObjectService.class, false);
    return soService.getSharedObject(scope, SCOPE_STATS_SO_NAME, false);
  }
View Full Code Here

Examples of org.red5.server.api.so.ISharedObjectService

    return result;
  }

  public ISharedObject getSharedObjectStatisticsSO(IScope scope) {
    ISharedObjectService soService = (ISharedObjectService) ScopeUtils.getScopeService(scope, ISharedObjectService.class, false);
    return soService.getSharedObject(scope, SO_STATS_SO_NAME, false);
  }
View Full Code Here

Examples of org.red5.server.api.so.ISharedObjectService

    return soService.getSharedObject(scope, SO_STATS_SO_NAME, false);
  }

  public Set<ISharedObjectStatistics> getSharedObjects(String path) {
    IScope scope = getScope(path);
    ISharedObjectService soService = (ISharedObjectService) ScopeUtils.getScopeService(scope, ISharedObjectService.class, false);
    Set<ISharedObjectStatistics> result = new HashSet<ISharedObjectStatistics>();
    for (String name: soService.getSharedObjectNames(scope)) {
      ISharedObject so = soService.getSharedObject(scope, name);
      result.add(so.getStatistics());
    }
    return result;
  }
View Full Code Here

Examples of org.red5.server.api.so.ISharedObjectService

  }

  public void updateSharedObjectStatistics(String path, String name)
      throws ScopeNotFoundException, SharedObjectException {
    IScope scope = getScope(path);
    ISharedObjectService soService = (ISharedObjectService) ScopeUtils.getScopeService(scope, ISharedObjectService.class, false);
    ISharedObject sourceSO = soService.getSharedObject(scope, name);
    if (sourceSO == null)
      throw new SharedObjectException();
   
    ISharedObject so = getSharedObjectStatisticsSO(Red5.getConnectionLocal().getScope());
    so.setAttribute(path+'|'+name, sourceSO.getData());
View Full Code Here

Examples of org.red5.server.api.so.ISharedObjectService

   *            Whether SharedObject instance should be persistent or not
   * @return          <code>true</code> if SO was created, <code>false</code> otherwise
   */
  public boolean createSharedObject(IScope scope, String name,
      boolean persistent) {
    ISharedObjectService service = (ISharedObjectService) getScopeService(
        scope, ISharedObjectService.class, SharedObjectService.class,
        false);
    return service.createSharedObject(scope, name, persistent);
    }
View Full Code Here

Examples of org.red5.server.api.so.ISharedObjectService

   * @param name
   *            Name of SharedObject
   * @return          Shared object instance with name given
   */
  public ISharedObject getSharedObject(IScope scope, String name) {
    ISharedObjectService service = (ISharedObjectService) getScopeService(
        scope, ISharedObjectService.class, SharedObjectService.class,
        false);
    return service.getSharedObject(scope, name);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.