Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
The existing code of the Apache Aries Blueprint Web (org.apache.aries.blueprint.web.BlueprintContextListener) scans to find @Namespaces annotated class for namespace handler passed as parameter
like that within the web.xml file
<context-param> <param-name>blueprintNamespaceHandlers</param-name> <param-value>org.apache.camel.blueprint.handler.CamelNamespaceHandler</param-value> </context-param>
So I propose to improve existing code to discover also class (like Apache Camel Blueprint - CamelNamespaceHandler) implementing - org.apache.aries.blueprint.NamespaceHandler
Namespaces namespaces = nsHandler.getClass().getAnnotation(Namespaces.class); if (namespaces != null) { for (String ns : namespaces.value()) { servletContext.log("Namespace handler retrieved for @Namespaces : " + ns); nsSet.addNamespace(URI.create(ns), nsHandler.getSchemaLocation(ns), nsHandler); } } else { Class<?>[] interfaces = nsHandler.getClass().getInterfaces(); for(Class<?> clazz : interfaces) { String ns = clazz.getName(); if (ns.equals("org.apache.aries.blueprint.NamespaceHandler")) { servletContext.log("Class implementing Blueprint NamespaceHandler : " + nsHandler.getClass().getName()); nsSet.addNamespace(URI.create(nsHandler.getClass().getName()), nsHandler.getSchemaLocation(nsHandler.getClass().getName()), nsHandler); } }