Skip to content

Commit

Permalink
WELDSE-26: Renamed ClassHandler to URLHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
peteroyle committed May 17, 2010
1 parent e91ce1c commit 3fd6601
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
Expand Up @@ -26,8 +26,8 @@
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import org.jboss.weld.environment.se.discovery.handlers.ClassHandler;
import org.jboss.weld.environment.se.discovery.handlers.FileSystemClassHandler;
import org.jboss.weld.environment.se.discovery.handlers.URLHandler;
import org.jboss.weld.environment.se.discovery.handlers.FileSystemURLHandler;
import org.jboss.weld.environment.se.exceptions.ClasspathScanningException;
import org.jboss.weld.resources.spi.ResourceLoader;

Expand All @@ -49,18 +49,18 @@ public class URLScanner extends AbstractScanner

private static final String FILE = "file";
private static final String JAR = "jar";
private final Map<String, ClassHandler> classHandlers = new HashMap<String, ClassHandler>();
private final Map<String, URLHandler> classHandlers = new HashMap<String, URLHandler>();
private static final Logger log = LoggerFactory.getLogger(URLScanner.class);

public URLScanner(ResourceLoader resourceLoader, SEWeldDiscovery weldDiscovery)
{
super(resourceLoader, weldDiscovery);
ClassHandler fileSysHandler = new FileSystemClassHandler(resourceLoader, weldDiscovery);
URLHandler fileSysHandler = new FileSystemURLHandler(resourceLoader, weldDiscovery);
classHandlers.put(FILE, fileSysHandler);
classHandlers.put(JAR, fileSysHandler);
}

public void setClassHandler(String type, ClassHandler handler)
public void setClassHandler(String type, URLHandler handler)
{
classHandlers.put(type, handler);
}
Expand Down Expand Up @@ -118,7 +118,7 @@ public void scanResources(String[] resources)
for (String urlType : paths.keySet())
{
Collection<String> urlPaths = paths.get(urlType);
ClassHandler handler = classHandlers.get(urlType);
URLHandler handler = classHandlers.get(urlType);
if (handler == null)
{
throw new ClasspathScanningException("No handler defined for URL type: " + urlType);
Expand Down
Expand Up @@ -23,13 +23,13 @@
*
* @author Peter Royle
*/
public abstract class AbstractClassHandler implements ClassHandler
public abstract class AbstractURLHandler implements URLHandler
{

private final ResourceLoader resourceLoader;
private final SEWeldDiscovery weldDiscovery;

public AbstractClassHandler(ResourceLoader resourceLoader, SEWeldDiscovery webBeanDiscovery)
public AbstractURLHandler(ResourceLoader resourceLoader, SEWeldDiscovery webBeanDiscovery)
{
this.resourceLoader = resourceLoader;
this.weldDiscovery = webBeanDiscovery;
Expand Down
Expand Up @@ -39,12 +39,12 @@
* @author Pete Muir
*
*/
public class FileSystemClassHandler extends AbstractClassHandler
public class FileSystemURLHandler extends AbstractURLHandler
{

private static final Logger log = LoggerFactory.getLogger(FileSystemClassHandler.class);
private static final Logger log = LoggerFactory.getLogger(FileSystemURLHandler.class);

public FileSystemClassHandler(ResourceLoader resourceLoader, SEWeldDiscovery webBeanDiscovery)
public FileSystemURLHandler(ResourceLoader resourceLoader, SEWeldDiscovery webBeanDiscovery)
{
super(resourceLoader, webBeanDiscovery);
}
Expand All @@ -55,7 +55,7 @@ public void handle(Collection<String> paths)
{
try
{
FileSystemClassHandler.log.trace("scanning: " + urlPath);
FileSystemURLHandler.log.trace("scanning: " + urlPath);

if (urlPath.startsWith("file:"))
{
Expand All @@ -76,7 +76,7 @@ public void handle(Collection<String> paths)
}
} catch (IOException ioe)
{
FileSystemClassHandler.log.warn("could not read entries", ioe);
FileSystemURLHandler.log.warn("could not read entries", ioe);
}
}
}
Expand Down
Expand Up @@ -20,10 +20,10 @@
import java.util.Collection;

/**
* Interface for handling class resolving.
* Interface for handling URL resolving.
* @author Peter Royle
*/
public interface ClassHandler {
public interface URLHandler {

void handle(Collection<String> paths);

Expand Down

0 comments on commit 3fd6601

Please sign in to comment.