assert Scope.MODULE != scope : "Cannot get MODULE scope from the registry";
ScopeContainer container = scopeCache.get(scope);
if (container == null) {
ObjectFactory<? extends ScopeContainer> factory = factoryCache.get(scope);
if (factory == null) {
ScopeNotFoundException e = new ScopeNotFoundException("Scope object factory not registered for scope");
e.setIdentifier(scope.getScope());
throw e;
}
container = factory.getInstance();
container.setWorkContext(workContext);