@SuppressWarnings("unchecked") private void addInterceptorNameToList(String interceptorName, BeanDefinition beanDefinition) { List<String> list = (List<String>) beanDefinition.getPropertyValues().get("interceptorNames"); Assert.state(list != null, "Missing 'interceptorNames' property"); list.add(interceptorName); }
Boolean pubSubDomain = (Boolean) commonContainerProperties.get("replyPubSubDomain"); if (pubSubDomain == null) { pubSubDomain = false;
private String buildDescription(BeanReference adviceReference, BeanDefinition pointcutDefinition) { return "Advisor <advice(ref)='" + adviceReference.getBeanName() + "', pointcut(expression)=[" + pointcutDefinition.getPropertyValues().get("expression") + "]>"; }
/** * Find the {@code ContentNegotiationManager} bean created by or registered * with the {@code annotation-driven} element. * @return a bean definition, bean reference, or {@code null} if none defined */ @Nullable public static Object getContentNegotiationManager(ParserContext context) { String name = AnnotationDrivenBeanDefinitionParser.HANDLER_MAPPING_BEAN_NAME; if (context.getRegistry().containsBeanDefinition(name)) { BeanDefinition handlerMappingBeanDef = context.getRegistry().getBeanDefinition(name); return handlerMappingBeanDef.getPropertyValues().get("contentNegotiationManager"); } name = AnnotationDrivenBeanDefinitionParser.CONTENT_NEGOTIATION_MANAGER_BEAN_NAME; if (context.getRegistry().containsBeanDefinition(name)) { return new RuntimeBeanReference(name); } return null; }
public AdvisorComponentDefinition( String advisorBeanName, BeanDefinition advisorDefinition, @Nullable BeanDefinition pointcutDefinition) { Assert.notNull(advisorBeanName, "'advisorBeanName' must not be null"); Assert.notNull(advisorDefinition, "'advisorDefinition' must not be null"); this.advisorBeanName = advisorBeanName; this.advisorDefinition = advisorDefinition; MutablePropertyValues pvs = advisorDefinition.getPropertyValues(); BeanReference adviceReference = (BeanReference) pvs.get("adviceBeanName"); Assert.state(adviceReference != null, "Missing 'adviceBeanName' property"); if (pointcutDefinition != null) { this.beanReferences = new BeanReference[] {adviceReference}; this.beanDefinitions = new BeanDefinition[] {advisorDefinition, pointcutDefinition}; this.description = buildDescription(adviceReference, pointcutDefinition); } else { BeanReference pointcutReference = (BeanReference) pvs.get("pointcut"); Assert.state(pointcutReference != null, "Missing 'pointcut' property"); this.beanReferences = new BeanReference[] {adviceReference, pointcutReference}; this.beanDefinitions = new BeanDefinition[] {advisorDefinition}; this.description = buildDescription(adviceReference, pointcutReference); } }
/** * Find the {@code ContentNegotiationManager} bean created by or registered * with the {@code annotation-driven} element. * @return a bean definition, bean reference, or {@code null} if none defined */ @Nullable public static Object getContentNegotiationManager(ParserContext context) { String name = AnnotationDrivenBeanDefinitionParser.HANDLER_MAPPING_BEAN_NAME; if (context.getRegistry().containsBeanDefinition(name)) { BeanDefinition handlerMappingBeanDef = context.getRegistry().getBeanDefinition(name); return handlerMappingBeanDef.getPropertyValues().get("contentNegotiationManager"); } name = AnnotationDrivenBeanDefinitionParser.CONTENT_NEGOTIATION_MANAGER_BEAN_NAME; if (context.getRegistry().containsBeanDefinition(name)) { return new RuntimeBeanReference(name); } return null; }
public Object getProperty(String property) { if (property.equals("beanName")) { return getBeanName(); } else if (property.equals("source")) { return getSource(); } else if (this.beanDefinition != null) { return new GroovyPropertyValue( property, this.beanDefinition.getBeanDefinition().getPropertyValues().get(property)); } else { return this.metaClass.getProperty(this, property); } }
private void addCsrfTokenHandshakeInterceptor(BeanDefinition bd) { if (sameOriginDisabled) { return; } String interceptorPropertyName = "handshakeInterceptors"; ManagedList<? super Object> interceptors = new ManagedList<>(); interceptors.add(new RootBeanDefinition(CsrfTokenHandshakeInterceptor.class)); interceptors.addAll((ManagedList<Object>) bd.getPropertyValues().get( interceptorPropertyName)); bd.getPropertyValues().add(interceptorPropertyName, interceptors); }
/** * Registers an {@link EntityManagerFactoryBeanDefinition} for the bean with the given name. Drops * {@link JndiObjectFactoryBean} instances that don't point to an {@link EntityManagerFactory} bean as expected type. * * @param name * @param beanFactory * @param definitions */ private static void registerEntityManagerFactoryBeanDefinition(String name, ConfigurableListableBeanFactory beanFactory, List<EntityManagerFactoryBeanDefinition> definitions) { BeanDefinition definition = beanFactory.getBeanDefinition(name); if (JNDI_OBJECT_FACTORY_BEAN.equals(definition.getBeanClassName())) { if (!EntityManagerFactory.class.getName().equals(definition.getPropertyValues().get("expectedType"))) { return; } } Class<?> type = beanFactory.getType(name); if (type == null || !EntityManagerFactory.class.isAssignableFrom(type)) { return; } definitions.add(new EntityManagerFactoryBeanDefinition(name, beanFactory)); }
public Object getProperty(String property) { if (property.equals("beanName")) { return getBeanName(); } else if (property.equals("source")) { return getSource(); } else if (this.beanDefinition != null) { return new GroovyPropertyValue( property, this.beanDefinition.getBeanDefinition().getPropertyValues().get(property)); } else { return this.metaClass.getProperty(this, property); } }
Map<String, BeanDefinition> urlMap = (Map<String, BeanDefinition>) hm.getPropertyValues().get("urlMap"); if (urlMap == null) { urlMap = new ManagedMap<>();
RuntimeBeanReference reference = (RuntimeBeanReference) properties.get("ref");
@SuppressWarnings("unchecked") private Map<String, Map<String, Properties>> getStepArtifactProperties(BeanDefinition beanDefinition, Properties properties) { ManagedMap<String, Map<String, Properties>> stepArtifacts = new ManagedMap<>(); stepArtifacts.setMergeEnabled(true); Map<String, Map<String, Properties>> existingArtifacts = (Map<String, Map<String, Properties>>) beanDefinition.getPropertyValues().get(getPropertyName(batchArtifactType)); ManagedMap<String, Properties> artifactProperties = new ManagedMap<>(); artifactProperties.setMergeEnabled(true); if(existingArtifacts != null && existingArtifacts.containsKey(stepName)) { Map<String, Properties> existingArtifactsMap = existingArtifacts.get(stepName); for(Map.Entry<String, Properties> existingArtifactEntry : existingArtifactsMap.entrySet()) { artifactProperties.put(existingArtifactEntry.getKey(), existingArtifactEntry.getValue()); } } artifactProperties.put(beanName, properties); stepArtifacts.put(stepName, artifactProperties); return stepArtifacts; }
MutablePropertyValues pvs = this.currentBeanDefinition.getBeanDefinition().getPropertyValues(); if (pvs.contains(name)) { return pvs.get(name);
Map<String, BeanDefinition> urlMap = (Map<String, BeanDefinition>) hm.getPropertyValues().get("urlMap"); if (urlMap == null) { urlMap = new ManagedMap<>();
MutablePropertyValues pvs = this.currentBeanDefinition.getBeanDefinition().getPropertyValues(); if (pvs.contains(name)) { return pvs.get(name);
@Override public Object getPropertyValue(String propertyName) { return beanDefinition.getPropertyValues().get(propertyName); }
private void addCsrfTokenHandshakeInterceptor(BeanDefinition bd) { if (sameOriginDisabled) { return; } String interceptorPropertyName = "handshakeInterceptors"; ManagedList<? super Object> interceptors = new ManagedList<>(); interceptors.add(new RootBeanDefinition(CsrfTokenHandshakeInterceptor.class)); interceptors.addAll((ManagedList<Object>) bd.getPropertyValues().get( interceptorPropertyName)); bd.getPropertyValues().add(interceptorPropertyName, interceptors); }
private String buildDescription(BeanReference adviceReference, BeanDefinition pointcutDefinition) { return "Advisor <advice(ref)='" + adviceReference.getBeanName() + "', pointcut(expression)=[" + pointcutDefinition.getPropertyValues().get("expression") + "]>"; }