Spring

Connecting Drools 5.6 with Spring 3.x

This post is concerned predominantly with linking Spring3.x and Drools5.6. We will configure Spring, Drools and create a simple rule to test that we are up and running. Add the Drools Plug-in to Spring STS Start Eclipse Help -> Install New Software Work With: http://download.jboss.org/drools/release/5.5.0.Final/org.drools.updatesite/ click the “Add” button Name: Drools Check the Drools and …

Connecting Drools 5.6 with Spring 3.x Read More »

Spring , @Resource, @PostConstruct and @PreDestroy

Spring supports JSR-250 which provides @Resource, @PostConstruct and @PreDestroy annotations. @Resource The @Resource annotation is used in the bean class and is attached to the setter methods of the properties.  It is used to inject a specific bean resource. – will look for a bean with the same name as the property XXX – will …

Spring , @Resource, @PostConstruct and @PreDestroy Read More »

@Autowired and @Qualifier Annotations for Spring

We use @Autowired to automatically wire our bean dependencies. Example In the following example, we have autowired the home address for our student from the previous example. Spring will look for a single bean with a type that matches the type for home. If it finds this bean then it will automatically inject that bean …

@Autowired and @Qualifier Annotations for Spring Read More »

Using a Bean PostProcessor for Spring Annotations

I will cover the easy way to do this in a later post, but in this post we will look at how Spring processes annotations. Available JSR-250 Spring Annotations The spring-beans-3.x.jar contains the package org.springframework.beans.factory.annotation. In this package you will find the following BeanPostProcessors: AutowiredAnnotationBeanPostProcessor InitDestroyAnnotationBeanPostProcessor QualifierAnnotationBeanPostProcessor RequiredAnnotationBeanPostProcesor These PostProcessors facilitate the following annotations which …

Using a Bean PostProcessor for Spring Annotations Read More »

BeanFactoryPostProcessor

The BeanFactoryPostProcessor is useful for custom config files targeted at system administrators that override bean properties configured in the application context. Use this to execute code once the BeanFactory itself has been initialised. Example MyBeanFactoryPostProcessor Create the class MyBeanFactoryPostProcessor that implements BeanFactoryPostProcessor override the method postProcessBeanFactory print a message in the method Configure the PostProcessor …

BeanFactoryPostProcessor Read More »