So it is possible to use <context:component-scan ...> or @ComponentScan("org.rythmengine.spring.web") to allow spring to scan beans under certain package. The question is how can I inject my logic during the scanning process? Say I want to leverage spring's scanning to find all classes implemented a certain interface, or annotated with a certain annotation.
Inject logic into spring component scanning process
338 Views Asked by Gelin Luo At
1
There are 1 best solutions below
Related Questions in JAVA
- Add image to JCheckBoxMenuItem
- How to access invisible Unordered List element with Selenium WebDriver using Java
- Inheritance in Java, apparent type vs actual type
- Java catch the ball Game
- Access objects variable & method by name
- GridBagLayout is displaying JTextField and JTextArea as short, vertical lines
- Perform a task each interval
- Compound classes stored in an array are not accessible in selenium java
- How to avoid concurrent access to a resource?
- Why does processing goes slower on implementing try catch block in java?
- Redirect inside java interceptor
- Push toolbar content below statusbar
- Animation in Java on top of JPanel
- JPA - How to query with a LIKE operator in combination with an AttributeConverter
- Java Assign a Value to an array cell
Related Questions in SPRING
- Redirect inside java interceptor
- Spring RestTemplate passing the type of the response
- spring-integration-dsl-groovy-http return null when i use httpGet method
- Custom Spring annotation for request parameters
- Spring - configure Jboss Intros for xml with java config?
- HTTP Status 404 - Not Found in Spring 3.2.7
- AndroidAnnotations how to use setBearerAuth
- android I/O error: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found
- Show login dialog when not authenticated yet
- Spring Data Rest supporting json and xml
- @Value annotation not resolved in a class that belongs to dependency jar
- Remove nested _embedded fields while using projections
- How to send Rest GET request that contains "#" value in url parameters?
- How to inject spring bean into Validator(hibernate)
- How to keep a variable in the URL when using Spring LocaleChangeInterceptor
Related Questions in SPRING-MVC
- Redirect inside java interceptor
- Custom Spring annotation for request parameters
- Spring - configure Jboss Intros for xml with java config?
- No mapping found for HTTP request with URI [/test/WEB-INF/jsp/hello.jsp] in DispatcherServlet with name 'HelloWeb'
- Show login dialog when not authenticated yet
- How to keep a variable in the URL when using Spring LocaleChangeInterceptor
- LightAdmin - Customise parsing DateTime with app timezone
- Spring + TestNG Autowiring failure - NOT due to "new"
- Spring Boot MVC non-role based security
- Pretty print JSON with Spring 4
- How to initialize @DateTimeFormat Parameter on Get?
- Spring security /j_spring_security_login 404 error
- Use thymeleaf template for some pages and rest for some for building gradle project
- java.lang.StackOverflowError in spring controller
- submit dropdown angularjs spring MVC
Related Questions in REFLECTION
- Serializing TypeInfo / Type across .Net Platforms
- C# check if there is an overload method with the specific type
- instantiating a generic class data type known at runtime
- Instantiate a class which implements a generic interface
- C# Activator.GetInstance instances don't retain state when created as Interfaces
- How to force others to obey a specific layout for a child class?
- How should I be using LambdaMetaFactory in my use case?
- Get full path of a package situated in source folder from junit
- instantiating a generic referance class with data types known at runtime
- How to create a Dynamic IEnumerable
- Swift reflection - How to check if a reflected value is a kind of type
- GetTypeInfo Performance in Windows Store Apps
- What's the difference or relationship between Type and TypeInfo?
- Deserializing Generic Types from a ClassLouder class with GSON
- Need to print function's actual parameter name used while calling
Related Questions in COMPONENT-SCAN
- Spring Boot: NoUniqueBeanDefinitionException between test and main
- loading beans from XML (programmatic way) does not work
- @ComponentScan and @Autowired fail to inject from a specific package
- Inject logic into spring component scanning process
- Spring component scan does not work for a packages with similar names within a jar
- Spring Filter components in auto scanning
- Using @ComponentScan or <context:component-scan /> with only one class
- Is there a naming convention for @ComponentScan basePackageClasses?
- how spring component scan feature can assure your web site security is not compromised?
- Grails: How to specify Spring component scan exclusions using the bean build DSL
- Does @SpringBootTest scan bean configuration test package if has same name?
- Does Spring implement its own packages scan
- My component scan on Spring 5.3.18 does not work
- Excluding @bean from ComponentScan
- Spring @ComponentScan doesn't work on @Repository
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
For scanning/detecting components I suggest taking a look at how
<context:component-scan />andLocalSessionFactoryBeanscan for components or entities. Both use the same underlying mechanism for detecting classes.As for the
@CacheForannotation I would suggest leveraging Spring AOP just the same as spring uses for@Transactionaland@Cacheable(to name just 2 appliances).Ofcourse you can place everything nicely behind a namespace just like
<tx:annotation-driven />or<cache:annotation-driven />. That is all explained in this section of the reference guide.Links