private Map getActivationSpecInfoMap(MessagelistenerType[] messagelistenerArray, ClassLoader cl) throws DeploymentException { Map<String, GBeanData> activationSpecInfos = new HashMap<String, GBeanData>(); for (MessagelistenerType messagelistenerType : messagelistenerArray) { String messageListenerInterface = messagelistenerType.getMessagelistenerType().getStringValue().trim(); ActivationspecType activationspec = messagelistenerType.getActivationspec(); String activationSpecClassName = activationspec.getActivationspecClass().getStringValue().trim(); GBeanInfoBuilder infoBuilder = new GBeanInfoBuilder(ActivationSpecWrapperGBean.class, ActivationSpecWrapperGBean.GBEAN_INFO); Set<String> ignore = Collections.singleton("resourceAdapter"); setUpDynamicGBean(activationSpecClassName, infoBuilder, ignore, cl, true); GBeanInfo gbeanInfo = infoBuilder.getBeanInfo(); GBeanData activationSpecInfo = new GBeanData(gbeanInfo); activationSpecInfo.setAttribute("activationSpecClass", activationSpecClassName); activationSpecInfos.put(messageListenerInterface, activationSpecInfo); } return activationSpecInfos; }
private Map<String, GBeanData> getActivationSpecInfoMap(AbstractName validatorName, List<MessageListener> messageListeners, Bundle bundle) throws DeploymentException { Map<String, GBeanData> activationSpecInfos = new HashMap<String, GBeanData>(); for (MessageListener messageListener : messageListeners) { String messageListenerInterface = messageListener.getMessageListenerType(); ActivationSpec activationSpec = messageListener.getActivationSpec(); String activationSpecClassName = activationSpec.getActivationSpecClass(); GBeanInfoBuilder infoBuilder = new GBeanInfoBuilder(ActivationSpecWrapperGBean.class, new AnnotationGBeanInfoBuilder(ActivationSpecWrapperGBean.class).buildGBeanInfo()); Set<String> ignore = Collections.singleton("resourceAdapter"); setUpDynamicGBean(activationSpecClassName, infoBuilder, ignore, bundle, true); GBeanInfo gbeanInfo = infoBuilder.getBeanInfo(); GBeanData activationSpecInfo = new GBeanData(gbeanInfo); activationSpecInfo.setAttribute("activationSpecClass", activationSpecClassName); activationSpecInfo.setReferencePattern("ValidatorFactory", validatorName); activationSpecInfos.put(messageListenerInterface, activationSpecInfo); } return activationSpecInfos; }
private GBeanData setUpDynamicGBeanWithProperties(String className, GBeanInfoBuilder infoBuilder, List<ConfigProperty> configProperties, Bundle bundle, Set<String> ignore) throws DeploymentException { setUpDynamicGBean(className, infoBuilder, ignore, bundle, false); GBeanInfo gbeanInfo = infoBuilder.getBeanInfo(); GBeanData gbeanData = new GBeanData(gbeanInfo); for (ConfigProperty configProperty : configProperties) { if (configProperty.getConfigPropertyValue() != null) { String name = configProperty.getConfigPropertyName(); if (gbeanInfo.getAttribute(name) == null) { String originalName = name; name = switchCase(name); if (gbeanInfo.getAttribute(name) == null) { log.warn("Unsupported config-property: " + originalName); continue; } } String type = configProperty.getConfigPropertyType(); String value = configProperty.getConfigPropertyValue(); gbeanData.setAttribute(name, getValue(type, value, bundle)); } } return gbeanData; }
private GBeanData setUpDynamicGBeanWithProperties(String className, GBeanInfoBuilder infoBuilder, ConfigPropertyType[] configProperties, ClassLoader cl, Set<String> ignore) throws DeploymentException { setUpDynamicGBean(className, infoBuilder, ignore, cl, false); GBeanInfo gbeanInfo = infoBuilder.getBeanInfo(); GBeanData gbeanData = new GBeanData(gbeanInfo); for (ConfigPropertyType configProperty : configProperties) { if (configProperty.isSetConfigPropertyValue()) { String name = configProperty.getConfigPropertyName().getStringValue(); if (gbeanInfo.getAttribute(name) == null) { String originalName = name; name = switchCase(name); if (gbeanInfo.getAttribute(name) == null) { log.warn("Unsupported config-property: " + originalName); continue; } } String type = configProperty.getConfigPropertyType().getStringValue(); String value = configProperty.getConfigPropertyValue().getStringValue(); gbeanData.setAttribute(name, getValue(type, value, cl)); } } return gbeanData; }