private void parseElement(Element elt, ComponentMetadata cm, ParserContext pc)
{
if (LOGGER.isDebugEnabled())
LOGGER.debug("parser asked to parse .. " + elt);
ComponentDefinitionRegistry cdr = pc.getComponentDefinitionRegistry();
if ("transaction".equals(elt.getLocalName())) {
if (LOGGER.isDebugEnabled())
LOGGER.debug("parser adding interceptor for " + elt);
ComponentMetadata meta = cdr.getComponentDefinition("blueprintBundle");
Bundle blueprintBundle = null;
if (meta instanceof PassThroughMetadata) {
blueprintBundle = (Bundle) ((PassThroughMetadata) meta).getObject();
}
// don't register components if we have no bundle (= dry parse)
if (blueprintBundle != null) {
registered.put(cdr, blueprintBundle);
if (cm == null) {
// if the enclosing component is null, then we assume this is the top element
String bean = elt.getAttribute(Constants.BEAN);
registerComponentsWithInterceptor(cdr, bean);
metaDataHelper.populateBundleWideTransactionData(pc.getComponentDefinitionRegistry(),
elt.getAttribute(Constants.VALUE), elt.getAttribute(Constants.METHOD), bean);
} else {
cdr.registerInterceptorWithComponent(cm, interceptor);
if (LOGGER.isDebugEnabled())
LOGGER.debug("parser setting comp trans data for " + elt.getAttribute(Constants.VALUE) + " "
+ elt.getAttribute(Constants.METHOD));
metaDataHelper.setComponentTransactionData(cdr, cm, elt.getAttribute(Constants.VALUE), elt
.getAttribute(Constants.METHOD));
}
}
} else if ("enable-annotations".equals(elt.getLocalName())) {
Node n = elt.getChildNodes().item(0);
if(n == null || Boolean.parseBoolean(n.getNodeValue())) {
//We need to register a bean processor to add annotation-based config
if(!!!cdr.containsComponentDefinition(Constants.ANNOTATION_PARSER_BEAN_NAME)) {
MutablePassThroughMetadata mptmd = pc.createMetadata(MutablePassThroughMetadata.class);
mptmd.setId(Constants.ANNOTATION_PARSER_BEAN_NAME);
mptmd.setObject(new AnnotationParser(cdr, interceptor, metaDataHelper));
cdr.registerComponentDefinition(mptmd);
}
}
}
if (LOGGER.isDebugEnabled())