Examples of ISharedObject


Examples of org.eclipse.ecf.core.sharedobject.ISharedObject

    if (adapterType.equals(IPresenceContainerAdapter.class)) {
      TCPClientSOContainer container = (TCPClientSOContainer) adaptableObject;
      ISharedObjectManager manager = container.getSharedObjectManager();
      ID[] ids = manager.getSharedObjectIDs();
      for (int i = 0; i < ids.length; i++) {
        ISharedObject object = manager.getSharedObject(ids[i]);
        if (object instanceof EclipseCollabSharedObject) {
          EclipseCollabSharedObject ecso = (EclipseCollabSharedObject) object;
          return ecso.getPresenceContainer();
        }
      }
View Full Code Here

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

          log.debug("Shared object create failed");
          sendSOCreationFailed(conn, message);
          return;
        }
      }
      ISharedObject so = sharedObjectService.getSharedObject(scope, name);
      if (so != null) {
        if (so.isPersistent() == persistent) {
          log.debug("Dispatch persistent shared object");
          so.dispatchEvent(message);
        } else {
          log.warn("Shared object persistence mismatch - current: {} incoming: {}", so.isPersistent(), persistent);
          // reset the object so we can re-use it
          message.reset();
          // add the error event
          message.addEvent(new SharedObjectEvent(ISharedObjectEvent.Type.CLIENT_STATUS, "error", SO_PERSISTENCE_MISMATCH));
          conn.getChannel(3).write(message);
View Full Code Here

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

      assertTrue(app.createChildScope("mt"));
      room = ScopeUtils.resolveScope(appScope, "/junit/mt");
    }
    // create the SO
    assertTrue(app.createSharedObject(room, "mtSO", persistent));
    ISharedObject so = app.getSharedObject(room, "mtSO");
    // acquire only works with non-persistent so's
    if (!persistent) {
      so.acquire();
      assertTrue(so.isAcquired());
    }
    // test runnables represent clients
    trs = new TestRunnable[21];
    for (int t = 0; t < trs.length; t++) {
      trs[t] = new ScopeClientWorker(t, app, room);
    }
    MultiThreadedTestRunner mttr = new MultiThreadedTestRunner(trs);
    // fires off threads
    long start = System.nanoTime();
    mttr.runTestRunnables();
    System.out.println("Runtime: " + (System.nanoTime() - start) + "ns");
    // go to sleep
    try {
      Thread.sleep(3000);
    } catch (Exception e) {
    }
    for (TestRunnable r : trs) {
      ScopeClientWorker cl = (ScopeClientWorker) r;
      log.debug("Worker: {} shared object: {}", cl.getId(), cl.getSharedObject().getAttributes());
    }
    if (!persistent) {
      assertTrue(so.isAcquired());
      so.release();
      assertFalse(so.isAcquired());
    }
    app.stop(appScope);

    //    IScope room1 = ScopeUtils.resolveScope(appScope, "/junit/room1");
    //    IScope room4 = ScopeUtils.resolveScope(appScope, "/junit/room1/room4");
View Full Code Here

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

  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.ISharedObject

    return result;
  }

  public void updateScopeStatistics(String path) throws ScopeNotFoundException {
    IScope scope = getScope(path);
    ISharedObject so = getScopeStatisticsSO(Red5.getConnectionLocal().getScope());
    so.setAttribute(path, scope.getAttributes());
  }
View Full Code Here

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

  }

  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.ISharedObject

    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.ISharedObject

    // save ref
    appScope = app;
    // create persistent SO
    createSharedObject(app, persistentSO, true);
    // get the SO
    ISharedObject sharedObject = getSharedObject(app, persistentSO, true);
    //
    return super.appStart(app);
  }
View Full Code Here

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

    if (!hasSharedObject(appScope, "issue323")) {
      if (!createSharedObject(appScope, "issue323", false)) {
        log.warn("Shared object creation failed");
      }
    }
    ISharedObject so = getSharedObject(appScope, "issue323");
    log.debug("#1 {}", so);
    // close it
    if (!so.clear()) {
      log.debug("Shared object clear failed");
    }
    so.close();
  }
View Full Code Here

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

    IScope room1 = appScope.getScope("room1");
    log.debug("Room 1: {}", room1);
    assertTrue(room1.getDepth() == 2);

    // get the SO
    ISharedObject sharedObject = app.getSharedObject(room1, soName, true);
    log.debug("SO: {}", sharedObject);
    assertNotNull(sharedObject);

    log.debug("testSharedObject-end");
  }
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.