@GHMCOnline@CommissionrGHMC Construction Debris Dump which is unattended by the GHMC or concerned municipality from months, that caused havoc during rainfall.
Condition of the road near ASBL SPIRE, KOKAPET. I can't imagine the state of elderly and pregnant women driving through this stretch. This road has construction debris dump, half completed pipeline works etc., leading to this state.
@GHMCOnline@CommissionrGHMC
@hydcitypolice@HYDTP@CYBTRAFFIC this situation is happening almost every day, can you please take some immediate action on this. This is impacting daily commute of public
This is the current state of Nanakramguda - Gachibowli ORR entry. During Peak hours, people are carelessly reversing their cars and driving back in the wrong direction causing congestion and traffic jams. Please look into this and impose a penalty for the same. @CYBTRAFFIC
Have you ever asked yourself how Spring uses annotations?
Annotations in Spring serve to mark classes, methods, and fields with metadata that Spring's container can process, reducing the need for extensive XML configuration.
Annotations in Spring work technically through a combination of reflection and runtime processing. When you annotate a class, method, or field with a Spring-specific annotation, you're essentially adding metadata to those elements. Spring's container, during initialization, scans your application's classpath to discover classes with these annotations. Here's how it works:
1. Classpath Scanning: Spring uses classpath scanning to search for classes in your project that are marked with Spring annotations. It looks for classes within specified packages, directories, or jar files.
2. Metadata Extraction: When Spring identifies a class with a relevant annotation (e.g., @Component or @Controller), it extracts the metadata associated with that annotation. This metadata may include information such as the class name, the annotation type, and any attribute values specified within the annotation.
3. Bean Definition Creation: Spring, after extracting the metadata from annotated classes, creates a bean definition for each of these classes. A bean definition contains information about the class to instantiate and how to configure it.
4. Bean Initialization: When your Spring application context is initialized, it reads the bean definitions and, as needed, creates instances of these beans. For example, if you have a class marked with @Component, Spring will create an instance of that class and manage its lifecycle.
5. Dependency Injection: If you use @Autowired or similar annotations, Spring will analyze the dependencies between your beans. It will then inject the required dependencies by examining the type and name of fields or methods annotated with @Autowired. This injection process occurs during bean initialization.
6. AOP Processing: If you use AOP-related annotations like @Aspect and @Before, Spring's AOP framework processes these annotations and weaves advice into your application at runtime, as specified in the aspect definition.
7. Request Mapping (for Web Applications): In Spring MVC, annotations like @RequestMapping specify URL mappings to controller methods. These annotations map HTTP requests to the appropriate controller methods for handling.
8. Validation (for Data Validation): Annotations like @Valid and @Validated trigger data validation checks when applied to methods or method parameters.
9. Property Value Injection: The @Value annotation allows you to inject property values from property files or environment variables into your beans.
During application context initialization, Spring processes these annotations, extracts the associated metadata, creates bean definitions, manages bean lifecycles, and provides dependency injection.
The class responsible for searching for annotations in the classpath in Spring is ClassPathScanningCandidateComponentProvider and is subclass ClassPathBeanDefinitionScanner. This class is part of the Spring Framework and is used by Spring's component scanning mechanism to identify classes with specific annotations.
Here's how it works:
1. ClassPathBeanDefinitionScanner scans the classpath for classes that match certain criteria, typically classes marked with annotations like @Component, @Service, @Repository, and others.
2. It uses Java's reflection capabilities to inspect the classes and identify those with the specified annotations.
3. The classes that meet the criteria are then registered as Spring beans, and their instances are managed by the Spring container.
This is a starting point to demystify some of the Spring Boot magic. Next time sou start sour Spring Boot project place a breakpoint in the ClassPathBeanDefinitionScanner to follow the sequence of event that goes from your classes annotation to the configuration of the ApplicationContext.
Bookmark and like this post if you are interest in going under the surface of things.
Follow me for more similar content and for real life IT Stories.
Join me at P99 CONF (free + virtual) for 50+ tech talks on building low-latency, data-intensive applications. 🎫 Register for free https://t.co/42ofuxoM0Z #P99CONF hosted by #ScyllaDB