Add child scope to this scope

@param scope Child scope
@return true on success (if scope has handler and it accepts child scope addition), false otherwise
979778
public boolean addChildScope(IBasicScope scope) {
        log.debug("Add child: {}", scope);
        boolean added = false;
        if (scope.isValid()) {
            try {
                if (!children.containsKey(scope)) {
                    log.debug("Adding child scope: {} to {}", scope, this);
                    added = children.add(scope);
                } else {
                    log.warn("Child scope already exists");
                }
            } catch (Exception e) {
                log.warn("Exception on add subscope", e);
            }
        } else {
            log.warn("Invalid scope rejected: {}", scope);
        }
        if (added && scope.getStore() == null) {
            // if child scope has no persistence store, use same class as parent
            try {
                if (scope instanceof Scope) {
                    ((Scope) scope).setPersistenceClass(persistenceClass);
                }
            } catch (Exception error) {
                log.error("Could not set persistence class", error);
            }
        }
        return added;
    }
1151240
public void addScope(CmsGallerySearchScope scope) {

        m_searchObject.setScope(scope);
        m_searchObjectChanged = true;
        ValueChangeEvent.fire(this, m_searchObject);
    }
1214673
public void processEndOfScope(Scope scopeEnding, Iterable<Object> handlerInstances) throws Exception {
        for (Object handler : handlerInstances) {
            Handler handlerAnnotation = handler.getClass().getAnnotation(Handler.class);
            Scope scope = handlerAnnotation.scope();

            runLifecycleMethods(handler, scope, scopeEnding, true);

            //dispose handler instances with a scope which matches the scopeEnding
            if (scope == scopeEnding) {
                disposeSpringResources(handler, scopeEnding);
            }
        }
    }
1151076
def register_scope(self, scope):
        
        if not isinstance(scope, Scope):
            raise TypeError("Invalid scope type.")
        assert scope.id not in self.scopes
        self.scopes[scope.id] = scope
105647
@Override
    public boolean includes(Scope scope) {
        if (scope == null) {
            return true;
        }
        if (scope instanceof SimpleScope) {
            SimpleScope simpleScope = (SimpleScope) scope;
            return this.value.equals(simpleScope.value);
        }
        return false;
    }
1251604
public CompletableFuture<DeleteScopeStatus> deleteScope(final String scope) {
        Exceptions.checkNotNullOrEmpty(scope, "scope");
        return streamStore.deleteScope(scope);
    }
1009901
public Void visitScope(Scope scope) {
    messages.add(new Message(PrettyPrinter.format("Explicit scope unsupported: key=%s scope=%s",
        targetKey, scope)));
    return null;
  }
530225
public void init() {
        log.debug("Init scope: {} parent: {}", name, parent);
        if (hasParent()) {
            if (!parent.hasChildScope(name)) {
                if (parent.addChildScope(this)) {
                    log.debug("Scope added to parent");
                } else {
                    log.warn("Scope not added to parent");
                    //throw new ScopeException("Scope not added to parent");
                    return;
                }
            } else {
                throw new ScopeException("Scope already exists in parent");
            }
        } else {
            log.debug("Scope has no parent");
        }
        if (autoStart) {
            start();
        }
    }
1307201
public static <T extends Model> ScopeBuilder<T> scope(String  scope) {
        return new ScopeBuilder<T>(modelClass(), new String[]{scope});
    }
360594
@Override
	public void addChildAt(final int index, final ITreeNode<T> child)
		throws IndexOutOfBoundsException
	{
		if (children != null && children.size() < index)
		{
			children.add(index, child);
		}
		else
		{
			addChild(child);
		}
	}
190539
public void setScope(String scope) {
        if (scope.equalsIgnoreCase("page")) {
            this.scope = PageContext.PAGE_SCOPE;
        } else if (scope.equalsIgnoreCase("request")) {
            this.scope = PageContext.REQUEST_SCOPE;
        } else if (scope.equalsIgnoreCase("session")) {
            this.scope = PageContext.SESSION_SCOPE;
        } else if (scope.equalsIgnoreCase("application")) {
            this.scope = PageContext.APPLICATION_SCOPE;
        }
        // TODO: Add error handling?  Needs direction from spec.
    }
902336
public void addScope(String scope, int maxItemsInMemory) throws Exception {
        // Ignore maxItemsInMemory, since we don't run an eviction algorithm.
        scopeCaches.put(scope, new ConcurrentHashMap<Object, CacheItem>());
    }
1133221
public boolean hasChildScope(ScopeType type, String name) {
        log.debug("Has child scope? {} in {}", name, this);
        return children.getBasicScope(type, name) != null;
    }
1037224
public void addScope(IScope scope) {
        String app = scope.getName();
        // add the name to the collection (no '/' prefix)
        activeRooms.add(app);
        // check the context for a predefined websocket scope
        IContext ctx = scope.getContext();
        if (ctx != null && ctx.hasBean("webSocketScopeDefault")) {
            log.debug("WebSocket scope found in context");
            WebSocketScope wsScope = (WebSocketScope) scope.getContext().getBean("webSocketScopeDefault");
            if (wsScope != null) {
                log.trace("Default WebSocketScope has {} listeners", wsScope.getListeners().size());
            }
            // add to scopes
            scopes.put(String.format("/%s", app), wsScope);
        } else {
            log.debug("Creating a new scope");
            // add a default scope and listener if none are defined
            WebSocketScope wsScope = new WebSocketScope();
            wsScope.setScope(scope);
            wsScope.setPath(String.format("/%s", app));
            if (wsScope.getListeners().isEmpty()) {
                log.debug("adding default listener");
                wsScope.addListener(new DefaultWebSocketDataListener());
            }
            notifyListeners(WebSocketEvent.SCOPE_CREATED, wsScope);
            // add to scopes
            addWebSocketScope(wsScope);
        }
    }
1279341
public static void addToScope(Scriptable scope, Object object, String... names) {
		Object jsObject = Context.javaToJS(object, scope);
		for (String name : names) {
			name = name.replaceAll(" ", "_");
			ScriptableObject.putProperty(scope, name, jsObject);
		}
	}
474499
public function addScope($scope)
    {
        $this->validateScopeValue($scope);

        if (false !== $this->getScopeKey($scope)) {
            return $this;
        }

        $this->descriptor['scopes'][] = $scope;
        return $this;
    }
1044363
public void makeScope(IScope scope) {
        log.debug("makeScope: {}", scope);
        String path = scope.getContextPath();
        WebSocketScope wsScope = null;
        if (!scopes.containsKey(path)) {
            // add the name to the collection (no '/' prefix)
            activeRooms.add(scope.getName());
            // new websocket scope for the server scope
            wsScope = new WebSocketScope();
            wsScope.setPath(path);
            wsScope.setScope(scope);
            notifyListeners(WebSocketEvent.SCOPE_CREATED, wsScope);
            addWebSocketScope(wsScope);
            log.debug("Use the IWebSocketScopeListener interface to be notified of new scopes");
        } else {
            log.debug("Scope already exists: {}", path);
        }
    }