component2PathPrefixMap.put(component, bundlePathPrefix);
}
protected void registerComponent(Object component, String pathPrefix) {
final Class<?> clazz = component.getClass();
final Path path = clazz.getAnnotation(Path.class);
if (path == null) {
// Warn about and ignore classes that do not conform to the
// requirements of root resource or provider classes.
if (clazz.getAnnotation(Provider.class) != null) {
logger.info("Register provider {} to path {}", component.getClass().getName(), pathPrefix);
componentSpecifiedProviders.addInstance(component, pathPrefix);
} else {
logger.warn("Ignoring component: {} (Not a root resource or provider)",
component);
}
} else {
logger.info("Register resource {} to path {}{}",
new Object[]{component.getClass().getName(), pathPrefix, path.value()});
collectHttpMethods(component.getClass());
final RootResourceDescriptor descriptor = new RootResourceDescriptor(
clazz, component, pathPrefix + path.value(), providers);
rootResources.add(descriptor);
// FIXME An unbind will potentially remove the wrong
// descriptor from the set. Solution: Use a list or a
// lookup table.
}