Package org.red5.server.api.scope

Examples of org.red5.server.api.scope.IScope


  }

  @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);
View Full Code Here


    String soName = "foo";

    //Room 1
    // /default/junit/room1
    assertNotNull(appScope.getScope("room1"));
    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);
View Full Code Here

    if (appScope == null) {
      appScope = (WebScope) applicationContext.getBean("web.scope");
      log.debug("Application / web scope: {}", appScope);
      assertTrue(appScope.getDepth() == 1);
    }
    IScope room1 = ScopeUtils.resolveScope(appScope, "/junit/room1");
    log.debug("Room 1 scope: {}", room1);
    Set<String> names = room1.getScopeNames();
    log.debug("Names: {}", names);
    assertTrue(names.size() > 0);
    log.debug("testGetSONames-end");
  }
View Full Code Here

      appScope = (WebScope) applicationContext.getBean("web.scope");
      log.debug("Application / web scope: {}", appScope);
      assertTrue(appScope.getDepth() == 1);
    }
    String soName = "foo";
    IScope room1 = ScopeUtils.resolveScope(appScope, "/junit/room1");
    room1.removeChildren();
    log.debug("Child exists: {}", room1.hasChildScope(soName));

    log.debug("testRemoveSO-end");
  }
View Full Code Here

      assertTrue(appScope.getDepth() == 1);
    }
    SOApplication app = (SOApplication) applicationContext.getBean("web.handler");
    String soName = "foo";
    // get our room
    IScope room1 = ScopeUtils.resolveScope(appScope, "/junit/room1");
    // create the SO
    app.createSharedObject(room1, soName, true);
    // get the SO
    ISharedObject sharedObject = app.getSharedObject(room1, soName, true);
    assertTrue(sharedObject != null);
View Full Code Here

  public void testDeepDirty() throws Throwable {
    log.debug("testDeepDirty");
    SOApplication app = (SOApplication) applicationContext.getBean("web.handler");
    try {
      // get our room
      IScope room = ScopeUtils.resolveScope(appScope, "/junit/room99");
      if (room != null) {
        // create the SO
        app.createSharedObject(room, "dirtySO", true);
        // test runnables represent clients
        trs = new TestRunnable[2];
View Full Code Here

  public void testMissingHandler() throws Throwable {
    log.debug("testMissingHandler");
    String soName = "messager";
    SOApplication app = (SOApplication) applicationContext.getBean("web.handler");
    assertTrue(appScope.hasHandler());
    IScope top = ScopeUtils.resolveScope(appScope, "/junit");
    assertTrue(top.hasHandler());
    IScope room = ScopeUtils.resolveScope(appScope, "/junit/room13");
    if (room == null) {
      assertTrue(top.createChildScope("room13"));
      room = ScopeUtils.resolveScope(appScope, "/junit/room13");
      assertNotNull(room);
    }
    assertTrue(room.hasHandler());
    // get rooms
    IScope room1 = ScopeUtils.resolveScope(appScope, "/junit/room13/subroomA");
    if (room1 == null) {
      assertTrue(room.createChildScope("subroomA"));
      room1 = ScopeUtils.resolveScope(appScope, "/junit/room13/subroomA");
      assertNotNull(room1);
    }
    IScope room2 = ScopeUtils.resolveScope(appScope, "/junit/room13/subroomB");
    if (room2 == null) {
      assertTrue(room.createChildScope("subroomB"));
      room2 = ScopeUtils.resolveScope(appScope, "/junit/room13/subroomB");
      assertNotNull(room2);
    }
View Full Code Here

        try {
          Class wrapper = null;
          if ((wrapper = clazz.asSubclass(StatefulScopeWrappingAdapter.class)) != null) {
            Method getScope = wrapper.getMethod("getScope", new Class[0]);
            //NPE will occur here if the scope is not yet set on the application adapter
            IScope scope = (IScope) getScope.invoke(null, new Object[0]);
            contextName = scope.getName();
          }
        } catch (Exception cce) {
          //cclog.warn("Exception {}", e);
        }
      } else {
View Full Code Here

  private PresentationApplication presentationApplication;

  public void removePresentation(Map<String, Object> msg) {
    String presentationID = (String) msg.get("presentationID");
   
    IScope scope = Red5.getConnectionLocal().getScope();
    presentationApplication.removePresentation(scope.getName(), presentationID);
  }
View Full Code Here

      handleDisconnectAllClientsMessage((DisconnectAllClientsMessage) message);
    }
  } 

  private void handleDisconnectAllClientsMessage(DisconnectAllClientsMessage msg) {
    IScope meetingScope = getScope(msg.getMeetingId());
    if (meetingScope != null) {
      Set<IConnection> conns = meetingScope.getClientConnections();

      for (IConnection conn : conns) {
        if (conn.isConnected()) {
          String connId = (String) conn.getAttribute("INTERNAL_USER_ID");
          log.info("Disconnecting client=[{}] from meeting=[{}]", connId, msg.getMeetingId());
View Full Code Here

TOP

Related Classes of org.red5.server.api.scope.IScope

Copyright © 2018 www.massapicom. 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.