class ScopeObserver implements ScopePublisher {

    public void enterScope(final Scope scope) {
        if (scope == null) {
            LOGGER.warn("ignoring entered null scope");
            return;
        }

        LOGGER.info("entering new scope '" + scope.getName() + "'...");

        final Scope previous = currentScope();
        scopes.push(scope);
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("current scope stack: " + scopes);
        }

        synchronized (scopeSubscriber) {
            for (ScopeSubscriber listener : scopeSubscriber) {
                listener.enterScope(previous, scope);
            }
        }
    }

    public  ScopeObserver();

}