private static URL[] getUrls(String... patterns) {
		PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
		List<URL> jars = new ArrayList<URL>();
		for (String pattern : patterns) {
			try {
				Resource[] resources = resolver.getResources(pattern);
				for (Resource resource : resources) {
					URL url = resource.getURL();
					if (!jars.contains(url)) {
						jars.add(url);
					}
				}
			}
			catch (IOException e) {
				throw new RuntimeException(e);
			}

		}
		return jars.toArray(new URL[jars.size()]);
	}
An ApplicationListener which tracks which MessageBus implementation ought to be used so that it exposes a ClassLoader
that knows about the correct jar files for that bus.
<p>Make sure that this listener is triggered before the created ClassLoader is used.</p>

@author Eric Bottard
@author David Turanski
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/server/MessageBusClassLoaderFactory.java