log.debug("Unregistering - name: {} stream: {} scope: {}", new Object[] { name, bs, scope });
((Scope) scope).dump();
IBroadcastScope broadcastScope = scope.getBroadcastScope(name);
if (bs != null) {
log.debug("Unsubscribing scope {} from provider {}", broadcastScope, bs.getProvider());
broadcastScope.unsubscribe(bs.getProvider());
}
// if the scope has no listeners try to remove it
if (!((BasicScope) broadcastScope).hasEventListeners()) {
log.debug("Scope has no event listeners attempting removal");
scope.removeChildScope(broadcastScope);