listener);
return bindingFactories.get(namespace);
}
private BindingFactory loadActivationNamespace(final String namespace) {
final ConfiguredBeanLocator locator = bus.getExtension(ConfiguredBeanLocator.class);
//Second attempt will be to examine the factory class
//for a DEFAULT_NAMESPACES field and if it doesn't exist, try
//using the older activation ns things. This will then load most
//of the "older" things
ConfiguredBeanLocator.BeanLoaderListener<BindingFactory> listener
= new ConfiguredBeanLocator.BeanLoaderListener<BindingFactory>() {
public boolean beanLoaded(String name, BindingFactory bean) {
loaded.add(name);
return bindingFactories.containsKey(namespace);
}
public boolean loadBean(String name, Class<? extends BindingFactory> type) {
if (loaded.contains(name)) {
return false;
}
try {
type.getField("DEFAULT_NAMESPACES");
return false;
} catch (Exception ex) {
//ignore
}
return locator.hasConfiguredPropertyValue(name, "activationNamespaces", namespace);
}
};
locator.loadBeansOfType(BindingFactory.class,
listener);
return bindingFactories.get(namespace);
}