-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* WINDUPRULE-886 Spring Boot DI rules updated to reflect new project structure * WINDUPRULE-886 rebased and updated springboot-di-to-quarkus-00002-test iterable-filter to size=5
- Loading branch information
1 parent
4be57c6
commit 88f3544
Showing
7 changed files
with
137 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...-reviewed/quarkus/springboot/tests/data/springboot-di/CustomBeanFactoryPostProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import org.springframework.beans.BeansException; | ||
import org.springframework.beans.factory.config.BeanFactoryPostProcessor; | ||
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; | ||
|
||
public class CustomBeanFactoryPostProcessor implements BeanFactoryPostProcessor { | ||
@Override | ||
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) | ||
throws BeansException { | ||
System.out.println("Inside postProcessBeanFactory method."); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...s/rules-reviewed/quarkus/springboot/tests/data/springboot-di/CustomBeanPostProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
CustomBeanPostProcessor.java | ||
import org.springframework.beans.BeansException; | ||
import org.springframework.beans.factory.config.BeanPostProcessor; | ||
|
||
public class CustomBeanPostProcessor implements BeanPostProcessor | ||
{ | ||
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException | ||
{ | ||
System.out.println("Called postProcessBeforeInitialization() for :" + beanName); | ||
return bean; | ||
} | ||
|
||
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException | ||
{ | ||
System.out.println("Called postProcessAfterInitialization() for :" + beanName); | ||
return bean; | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...ules-reviewed/quarkus/springboot/tests/data/springboot-di/CustomDestructionProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import org.springframework.beans.factory.config.DestructionAwareBeanPostProcessor; | ||
|
||
public class CustomDestructionProcessor implements DestructionAwareBeanPostProcessor { | ||
|
||
public CustomDestructionProcessor() { | ||
log.info("DestructionAwareBeanPostProcessor In other bean Create before create"); | ||
} | ||
|
||
/** The other bean is destroyed before it is destroyed. */ | ||
@Override | ||
public void postProcessBeforeDestruction(Object bean, String beanName) throws BeansException { | ||
if (bean instanceof SimpleBean) { | ||
log.info("{} About to be destroyed", beanName); | ||
} | ||
} | ||
|
||
} |
29 changes: 29 additions & 0 deletions
29
...es-reviewed/quarkus/springboot/tests/data/springboot-di/CustomInstantiationProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor; | ||
|
||
public class CustomInstantiationProcessor implements InstantiationAwareBeanPostProcessor { | ||
|
||
public CustomInstantiationProcessor() { | ||
log.info("InstantiationAwareBeanPostProcessor In other bean Create before create"); | ||
} | ||
|
||
/** Call before other bean instantiation */ | ||
@Override | ||
public Object postProcessBeforeInstantiation(Class | ||
|
||
beanClass, String beanName) throws BeansException { | ||
if (beanClass.equals(SimpleBean.class)) { | ||
log.info("{} About to instantiate", beanName); | ||
} | ||
return null; | ||
} | ||
|
||
/** After the other bean instantiation is called */ | ||
@Override | ||
public boolean postProcessAfterInstantiation(Object bean, String beanName) throws BeansException { | ||
if (bean instanceof SimpleBean) { | ||
log.info("{} Instantiation complete", beanName); | ||
} | ||
return true; | ||
} | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
...s/springboot/tests/data/springboot-di/CustomSmartInstantiationAwareBeanPostProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import org.springframework.beans.BeansException; | ||
import org.springframework.beans.factory.config.SmartInstantiationAwareBeanPostProcessor; | ||
import org.springframework.stereotype.Component; | ||
import java.lang.reflect.Constructor; | ||
|
||
public class CustomSmartInstantiationAwareBeanPostProcessor implements SmartInstantiationAwareBeanPostProcessor { | ||
@Override | ||
public Class<?> predictBeanType(Class<?> beanClass, String beanName) throws BeansException { | ||
System.out.println("CustomSmartInstantiationAwareBeanPostProcessor.predictBeanType,beanName:"+beanName); | ||
return null; } | ||
|
||
@Override | ||
public Constructor<?>[] determineCandidateConstructors(Class<?> beanClass, String beanName) throws BeansException { | ||
System.out.println("CustomSmartInstantiationAwareBeanPostProcessor.determineCandidateConstructors,beanName:"+beanName); | ||
return null; } | ||
|
||
|
||
@Override | ||
public Object getEarlyBeanReference(Object bean, String beanName) throws BeansException { | ||
System.out.println("CustomSmartInstantiationAwareBeanPostProcessor.getEarlyBeanReference,beanName:"+beanName); | ||
return null; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters