public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { // System.out.println(" init " + beanName); if (bean instanceof AutoRegisterPlugin) { AutoRegisterPlugin plugin = (AutoRegisterPlugin) bean; if (plugin.getBundleList() == null) { // System.out.println( plugin.getName() + " bundlelist is null " // ); } else { plugin.register(); List<IPluginBundle> pluginBundelList = plugin.getBundleList(); for (IPluginBundle bundle : pluginBundelList) { bundle.registerPlugin(plugin); // System.out.println(plugin.getName() + "注册在" + // bundle.getClass().getName()+"桩中" ); } PluginContext.registerPlugin(plugin); } } return bean; }