code: protected static Object getScopeService(IScope scope, String name, Class<?> defaultClass) {
          if (scope != null) {
              final IContext context = scope.getContext();
              ApplicationContext appCtx = context.getApplicationContext();
              Object result;
              if (!appCtx.containsBean(name)) {
                  if (defaultClass == null) {
                      return null;
                  }
                  try {
                      result = defaultClass.newInstance();
                  } catch (Exception e) {
                      log.error("{}", e);
                      return null;
                  }
              } else {
                  result = appCtx.getBean(name);
              }
              return result;
          }
          return null;
      }
docs: Returns scope services (e.g. SharedObject, etc) for the scope. Method uses either bean name passes as a string or class object.
  
  @param scope
  The scope service belongs to
  @param name
  Bean name
  @param defaultClass
  Class of service
  @return Service object