1 15 package org.apache.hivemind.impl; 16 17 import org.apache.commons.logging.Log; 18 import org.apache.commons.logging.LogFactory; 19 import org.apache.hivemind.ClassResolver; 20 import org.apache.hivemind.ErrorHandler; 21 import org.apache.hivemind.definition.RegistryDefinition; 22 23 27 public class HivemoduleProvider implements RegistryProvider 28 { 29 private static final Log LOG = LogFactory.getLog(HivemoduleProvider.class); 30 31 36 public static final String HIVE_MODULE_XML = "META-INF/hivemodule.xml"; 37 38 private ClassResolver _classResolver; 39 40 private String _resourcePath; 41 42 public HivemoduleProvider() 43 { 44 this(new DefaultClassResolver(), HIVE_MODULE_XML); 45 } 46 47 public HivemoduleProvider(ClassResolver classResolver, String resourcePath) 48 { 49 _classResolver = classResolver; 50 _resourcePath = resourcePath; 51 } 52 53 public void process(RegistryDefinition registryDefinition, ErrorHandler errorHandler) 54 { 55 XmlModuleReader xmlModuleReader = new XmlModuleReader(registryDefinition, _classResolver, 56 errorHandler); 57 if (LOG.isDebugEnabled()) 58 LOG.debug("Processing xml modules visible to " + _classResolver); 59 60 xmlModuleReader.readClassPathModules(_resourcePath); 61 } 62 63 } 64 | Popular Tags |