blyznytsiaorg / bring Goto Github PK
View Code? Open in Web Editor NEWBring Framework
License: Eclipse Public License 2.0
Bring Framework
License: Eclipse Public License 2.0
Step to reproduce:
java.lang.ClassNotFoundException: org.apache.jasper.servlet.JspServlet at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1437) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1245) at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:491) at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:473) at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:143) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:865) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:805) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4601) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4894) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1332) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1322) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:866) at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:846) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1332) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1322) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:866) at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:241) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171) at org.apache.catalina.core.StandardService.startInternal(StandardService.java:433) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171) at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:918) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171) at org.apache.catalina.startup.Tomcat.start(Tomcat.java:485) at com.bobocode.bring.web.embeddedTomcat.TomcatWebServer.initialize(TomcatWebServer.java:32) at com.bobocode.bring.web.embeddedTomcat.TomcatWebServer.<init>(TomcatWebServer.java:21) at com.bobocode.bring.web.embeddedTomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:40) at com.bobocode.bring.web.BringStarterApplication.run(BringStarterApplication.java:17) at com.bobocode.bringplayground.BringPlaygroundApplication.main(BringPlaygroundApplication.java:10)
Add logging (info, debug, trace)
add logging dependencies
added a few appenders:
/actuator/info (version, git info https://www.baeldung.com/spring-git-information)
/actuator/env (optional)
/actuator/health (OK)
create endpoint
create tests
create documentation
Get the T object and get all the classes that implement this interface
Think about how @order(1) annotation works and try to populate the list respectfully
Create BPP that implements BeanPostProcessor and add logic to handle PostConstract annotation.
Add java doc
Add MD file with feature
Add tests
If we have one interface and two dependencies and the inject param does not match any dependency. We should have an exception.
No qualifying bean of type 'interface com.levik.bringplayground.feature.di.Drink' available: expected single matching bean but found 2: [Latte, Espresso]
Use this site to generate a banner or any other similar https://devops.datenkollektiv.de/banner.txt/index.html
Add method bannerMode with parameter ON/OFF to BringApplicationContext
On will be the default.
create a service to print banner and the possibility to override via -Dbring.main.banner=off or -Dbring.main.banner.file=resource/banner.text
Add javadoc
Add tests
Add MD
Add the possibility to override Profile annotation via -Dbring.active.profile=dev
add tests to handle these cases BringValueInjectionTest & update Value.md with negative cases.
This is one of the negative examples that need to be handle
@Disabled("Need to throw exception when we cannot find value and do the same for constructor, setter and field injection")
@DisplayName("Should found profile bean and read application properties and do field injection but value not found")
@Test
void shouldFoundProfileBeanAndReadApplicationPropertiesAndSetNullValueToFieldInjectionIfNotFound() {
//when
var bringApplicationContext = BringApplication.run(TEST_DATA_NEGATIVE_PACKAGE + ".fieldproperties");
NotFoundValue notFoundValue = bringApplicationContext.getBean(NotFoundValue.class);
}
Notes:
Update BringBeanFactory with new method close
Add implementation of the method in class AnnotationBringBeanRegistry you should go throw all singletonObjects and check if we have a method with PreDestroy if yes call it.
As for the web we need to add this logic to Web listener onDestroy it will called when Tomcat stops. TomcatServletWebServerFactory -> context.addLifecycleListener();
add javadoc
add test
add MD
Add functionality of working annotation Order(n)
DI flow diagram
The BringApplication provides a simple entry point to initialize and run a BringApplicationContext.
It allows the user to create and configure a BringApplicationContext either by specifying a base package for component scanning or by providing a class that contains configuration information.
The ClassPathScannerFactory is responsible for creating a set of class path scanners, each designed to scan the classpath for specific types of annotated classes relevant to the Bring application. It initializes scanners for components, services, and configuration classes etc.
The BeanPostProcessorDefinitionFactory is responsible for creating and managing a list of BeanFactoryPostProcessor instances. It initializes the list with default post-processors, such as the ConfigurationClassPostProcessor etc. In this step we create Bean definitions for classes annotated with annotations from ClassPathScanner
The BeanPostProcessorFactory is responsible for creating and managing a list BeanPostProcessor instances. It initializes the list with default post-processors such as the ScheduleBeanPostProcessor and add addition loginc to them.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.