/** * Scans the classpath for JAR Manifests that contain the Tapestry-Module-Classes attribute and adds each * corresponding class to the RegistryBuilder. In addition, looks for a system property named "tapestry.modules" and * adds all of those modules as well. The tapestry.modules approach is intended for development. * * @param builder * the builder to which modules will be added * @see org.apache.tapestry5.ioc.annotations.ImportModule * @see RegistryBuilder#add(String) */ public static void addDefaultModules(RegistryBuilder builder) { try { Enumeration<URL> urls = builder.getClassLoader().getResources("META-INF/MANIFEST.MF"); while (urls.hasMoreElements()) { URL url = urls.nextElement(); addModulesInManifest(builder, url); } addModulesInList(builder, System.getProperty("tapestry.modules")); } catch (IOException ex) { throw new RuntimeException(ex.getMessage(), ex); } }
/** * Scans the classpath for JAR Manifests that contain the Tapestry-Module-Classes attribute and adds each * corresponding class to the RegistryBuilder. In addition, looks for a system property named "tapestry.modules" and * adds all of those modules as well. The tapestry.modules approach is intended for development. * * @param builder * the builder to which modules will be added * @see org.apache.tapestry5.ioc.annotations.ImportModule * @see RegistryBuilder#add(String) */ public static void addDefaultModules(RegistryBuilder builder) { try { Enumeration<URL> urls = builder.getClassLoader().getResources("META-INF/MANIFEST.MF"); while (urls.hasMoreElements()) { URL url = urls.nextElement(); addModulesInManifest(builder, url); } addModulesInList(builder, System.getProperty("tapestry.modules")); } catch (IOException ex) { throw new RuntimeException(ex.getMessage(), ex); } }