public ComponentRegistration registerManagedComponent(Class<?> component)
{
boolean debug = log.isDebugEnabled();
if (debug) log.debug("Processing managed annotations for class " + component);
Managed managed = component.getAnnotation(Managed.class);
if (managed == null) throw new RuntimeException(Managed.class + " annotation not present on " + component);
String componentName = managed.value();
if ("".equals(componentName)) throw new RuntimeException(Managed.class + " annotation must have a value (path) for component class " + component);
if (debug) log.debug("Registering managed component " + componentName);
ComponentRegistration registration = registerManagedComponent(componentName);
registration.registerManagedResource(description(managed.description()));
// Register resources & operations
AnnotatedResource annotatedResource = new AnnotatedResource(component);
annotatedResource.register(rootResource);