Iterate thru all beans and fetch the StatefulControllers

@param reg
@return
@throws ClassNotFoundException
764615
private void mapControllerAndEntityClasses(
			BeanDefinitionRegistry reg,
			Map<String, Class<?>> controllerToEntityMapping,
			Map<Class<?>, String> entityToRepositoryMapping,
			Map<Class<?>, Set<String>> entityToControllerMappings) throws ClassNotFoundException {

		// Loop thru the bean registry
		//
		for(String bfName : reg.getBeanDefinitionNames()) {

			BeanDefinition bf = reg.getBeanDefinition(bfName);

			if (bf.isAbstract()) {
				logger.debug("Skipping abstract bean " + bfName);
				continue;
			}

			Class<?> clazz = getClassFromBeanDefinition(bf, reg);

			if (clazz == null) {
				logger.debug("Unable to resolve class for bean " + bfName);
				continue;
			}

			// If it's a StatefulController, map controller to the entity and the entity to the controller
			//
			if (ReflectionUtils.isAnnotationPresent(clazz, StatefulController.class)) {
				mapEntityWithController(controllerToEntityMapping, entityToControllerMappings, bfName, clazz);
			}

			// Else, if the Bean is a Repository, then map the
			// Entity associated with the Repo to the PersistenceSupport object
			//
			else if (RepositoryFactoryBeanSupport.class.isAssignableFrom(clazz)) {
				mapEntityToRepository(entityToRepositoryMapping, bfName, bf);
			}
		}
	}
432589
public RouteMatcher getWithRegEx(String regex, Handler<HttpServerRequest> handler) {
		addRegEx(regex, handler, getBindings);
		return this;
	}
131506
public Router get(@NotNull final Pattern regex, @NotNull final IMiddleware... handlers) {
        addRegEx("GET", regex, handlers, getBindings);
        return this;
    }
863054
public void register(String... packageNames) {
        Collection<Class<? extends Controller>> classes = getControllerClasses(packageNames);
        if (classes.isEmpty()) {
            log.warn("No annotated controllers found in package(s) '{}'", Arrays.toString(packageNames));
            return;
        }

        log.debug("Found {} controller classes in {} package(s)", classes.size(), packageNames.length);

        for (Class<? extends Controller> controllerClass : classes) {
            register(controllerClass);
        }
    }
1168480
public static boolean isMatched(String pattern, String reg) {
        Pattern compile = Pattern.compile(reg);
        return compile.matcher(pattern).matches();
    }
230300
public synchronized ClassList getClassList() throws NotAllowedException
	{
		ClassList classes = new ClassList();
		for (Object definition : getRootElementList())
		{
			if (definition instanceof SClassDefinition)
				classes.add((SClassDefinition) definition);
			else
				throw new NotAllowedException("Other definition than ClassDefinition is found: "
						+ definition.getClass().getName());
		}
		return classes;
	}
555356
@Override
  protected Class<?> findClass(final String name) throws ClassNotFoundException {

    ByteBuffer def = AccessController.doPrivileged(new PrivilegedAction<ByteBuffer>() {
      public ByteBuffer run() {
        return strategy.getClassDefinition(name);
      }
    });

    if (def != null) {

      Class<?> result = super.defineClass(name, def, null);

      if (result != null) {
        super.resolveClass(result);
        return result;
      }

    }

    throw new ClassNotFoundException(name);

  }
957768
public static BeanDefinitionHolder registerBean(String beanId, BeanDefinition beanDefinition, ParserContext parserContext, boolean shouldFireEvents) {
        if (parserContext.getRegistry().containsBeanDefinition(beanId)) {
            return new BeanDefinitionHolder(parserContext.getRegistry().getBeanDefinition(beanId), beanId);
        }

        BeanDefinitionHolder configurationHolder = new BeanDefinitionHolder(beanDefinition, beanId);
        BeanDefinitionReaderUtils.registerBeanDefinition(configurationHolder, parserContext.getRegistry());

        if (shouldFireEvents) {
            BeanComponentDefinition componentDefinition = new BeanComponentDefinition(configurationHolder);
            parserContext.registerComponent(componentDefinition);
        }

        return configurationHolder;
    }
151158
private void registerTypeMappings(
      TypeMapping registryTypeMapping, List<TypeMapping> typeMappings) {
    Preconditions.checkNotNull(registryTypeMapping, "Null registry type mapping");
    Preconditions.checkNotNull(typeMappings, "Null type mappings");
    Preconditions.checkArgument(!typeMappings.isEmpty(), "Empty type mappings");
    for (TypeMapping typeMapping : typeMappings) {
      for (Class<?> mappingClass : typeMapping.getAllClasses()) {
        QName classQName = typeMapping.getTypeQName(mappingClass);
        DeserializerFactory deserializer = typeMapping.getDeserializer(mappingClass, classQName);
        if (deserializer != null && !registryTypeMapping.isRegistered(mappingClass, classQName)) {
          registryTypeMapping.register(
              mappingClass, classQName, (SerializerFactory) null, deserializer);
        }
      }
    }
  }
873904
@Override
    public Collection<Class<? extends LifecycleComponent>> getGuiceServiceClasses() {

        if (client || tribeNodeClient || disabled || sslOnly) {
            return Collections.emptyList();
        }

        final List<Class<? extends LifecycleComponent>> services = new ArrayList<>(1);
        services.add(GuiceHolder.class);
        return services;
    }
575186
public final Set<RegData> load(String dirName, String className, String methodName) {
        String fullName = className + '.' + methodName;
        return load(openFileRead(dirName, fullName, className, methodName));
    }
559659
private void getEJBWithPathClasses(Set<String> classeNames, EJBEndpoint ejb, String ejbInterfaceName, ClassLoader appClassloader) {
        final String methodName = "getEJBWithPathClasses";
        if (tc.isEntryEnabled())
            Tr.entry(tc, methodName, classeNames, ejb, ejbInterfaceName);
        if (classeNames == null) {
            if (tc.isEntryEnabled())
                Tr.exit(tc, methodName, Collections.emptySet());
        }

        Class<Path> pathClass = Path.class;
        final String ejbClassName = (ejbInterfaceName == null) ? ejb.getClassName() : ejbInterfaceName;
        Class<?> c = null;
        try {
            c = appClassloader.loadClass(ejbClassName);
        } catch (ClassNotFoundException e) {

            if (tc.isDebugEnabled()) {
                Tr.debug(tc, "getEJBWithPathClasses() exit - due to Class Not Found for " + ejbClassName + ": " + e);
            }
        }

        if (c != null && c.getAnnotation(pathClass) != null) {
            classeNames.add(ejbClassName);
        }

        if (tc.isEntryEnabled())
            Tr.exit(tc, methodName, classeNames);
    }
1282875
public RegistryCenter load(final RegistryCenterConfiguration regCenterConfig) {
        Preconditions.checkNotNull(regCenterConfig, "Registry center configuration cannot be null.");
        RegistryCenter result = newService(regCenterConfig.getType(), regCenterConfig.getProperties());
        result.init(regCenterConfig);
        return result;
    }
101442
public <E> E get(Class<E> clss) {
	testControllerClass(clss);
	synchronized (controllers) {
	  for (Controller controller : controllers) {
		if (clss.isAssignableFrom(controller.getClass())) {
		  return clss.cast(controller);
		}
	  }
	}
	return null;
  }
625346
public BaseController getController(JsonPath jsonPath, String requestType) {
        for (BaseController controller : controllers) {
            if (controller.isAcceptable(jsonPath, requestType)) {
                return controller;
            }
        }
        throw new MethodNotFoundException(PathBuilder.buildPath(jsonPath), requestType);
    }
1351623
public void printScreen(PrintWriter out, ResourceBundle reg)
    {
        ClassInfoModel classInfo = ((HelpScreen)this.getScreenField()).getClassInfo();
        if (classInfo != null)
            if (classInfo.isValidRecord())
            	classInfo.printScreen(out, reg);
    }
97234
public void printScreen(PrintWriter out, ResourceBundle reg)
    {
        String strClassXML = null;
        
        ClassInfoModel classInfo = ((HelpScreen)this.getScreenField()).getClassInfo();
        if (classInfo != null)
        {
            if (!classInfo.isValidRecord())	// Not found = Main help screen
            	classInfo = classInfo.readClassInfo((HelpScreen)this.getScreenField(), HelpScreen.class.getName());
            if (classInfo.isValidRecord())
	            strClassXML = XmlUtilities.createXMLStringRecord((Record)classInfo);
        }
        
        if ((strClassXML == null)
            || (strClassXML.length() == 0))
        strClassXML =
            "<ClassInfo>" +
            " <ClassName>ClassName</ClassName>" +
            " <BaseClassName>BaseClassName</BaseClassName>" +
            " <ClassDesc>Class not found.</ClassDesc>" +
            " <ClassPackage>ClassPackage</ClassPackage>" +
            " <ClassSourceFile>ClassSourceFile</ClassSourceFile>" +
            " <ClassType>ClassType</ClassType>" +
            " <ClassExplain>ClassExplain</ClassExplain>" +
            " <ClassHelp>ClassHelp</ClassHelp>" +
            " <ClassImplements>ClassImplements</ClassImplements>" +
            " <SeeAlso>SeeAlso</SeeAlso>" +
            " <TechnicalInfo>TechnicalInfo</TechnicalInfo>" +
            "</ClassInfo>";

        String strContentArea = strClassXML;
        out.println(strContentArea);
    }