simple-framework | 深入理解spring-framework , 搭建简易框架 | Aspect Oriented library

 by   zhangchao6018 Java Version: Current License: No License

kandi X-RAY | simple-framework Summary

kandi X-RAY | simple-framework Summary

simple-framework is a Java library typically used in Programming Style, Aspect Oriented applications. simple-framework has no bugs, it has no vulnerabilities, it has build file available and it has low support. You can download it from GitHub.

######SpringAOP的实现原理 代理模式 demo.pattern.proxy.impl.AlipayToB demo.pattern.proxy.impl.AlipayToC 问题:对不同接口的实现,增强功能一致,也需要编写多个代理类(代理类需要实现不同的接口) 需求改进 溯源ClassLoader 切入点: 根据一定规则去改动或者生成新的字节流,将切面逻辑织入其中 动态代理-- 根据接口或者目标类,计算出代理类的字节码并加载到JVM中去 1.Jdk动态代理 程序运行时动态生成类的字节码,并加载到JVM中 要求被代理类必须【实现特定接口】 并不要求代理对象去实现接口,所以可以可以复用代理对象的逻辑 --java.lang.reflect.InvocationHandler.invoke --java.lang.reflect.Proxy 2.CGLIB动态代理 代码生成库:Code Generation Library 不要求被代理类实现接口 内部主要封装了ASM Java字节码操控框架 动态生成子类以覆盖非final的方法,绑定钩子回调自定义拦截器 3.区别 JDK动态代理:基于反射,要求业务类必须实现接口 优势: 不需要额外jar包提来,更可靠 平滑支持JDK版本的升级 CGLIIB:基于ASM机制实现,生成业务类的子类作为代理类 优势: 被代理对象无需实现接口,能实现代理类的无侵入 4.SpringAop的底层机制 CGLIB和JDK动态代理共存 默认:Bean实现接口则用JDK,否则使用CGLIB. ######自研框架的AOP1.0 使用CGLIB 思路: 1.解决标记的问题(注解),定义横切逻辑的骨架 1.定义横切逻辑相关的注解:org.simpleframework.aop.annotation.Aspect 2.定义供外部使用的横切逻辑骨架 2.定义Aspect横切逻辑以及被代理方法的执行顺序 创建MethodInterceptor的实现类 定义必要的成员变量--被代理类以及Aspect列表 按照Order对Aspect进行排序 实现对横切逻辑以及被代理对象方法的定序执行 3.将横切逻辑织入到被代理的对象以生成动态代理对象. ######自研框架的MVC DispatcherServlet 解析请求路径和请求方法 依赖容器,建立并维护Controller方法与请求的映射 用合适的Controller方法去处理特定的请求 责任链模式执行请求之 1.StaticResourceRequestProcessor的开发: 2.JspRequestProcessor 3.ControllerRequestProcessor 功能: 针对特定请求,选择匹配的Controller方法进行处理 解析请求里的参数及其对应的值,并赋值给Controller方法的参数 选择合适的Render,为后续请求结果的渲染做准备 实现: 默认--DefaultResultRender InternalErrorResultRender ResourceNotFoundResultRender JsonResultRender ViewResultRender
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              simple-framework has a low active ecosystem.
              It has 1 star(s) with 1 fork(s). There are 1 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              simple-framework has no issues reported. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of simple-framework is current.

            kandi-Quality Quality

              simple-framework has no bugs reported.

            kandi-Security Security

              simple-framework has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              simple-framework does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              simple-framework releases are not available. You will need to build from source code and install.
              Build file is available. You can build the component from source.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi has reviewed simple-framework and discovered the below as its top functions. This is intended to give you an instant insight into simple-framework implemented functionality, and help decide if they suit your requirements.
            • Init
            • Pack aspect info list
            • Handle ioc
            • Extract class file
            • Intercept the method
            • Collect all of the aspect info from the sorted list
            • Invoke advice after the method is called
            • Process the controller
            • Invoke controller method
            • Get main page info
            • Entry point for the EnumStarvingSingleton
            • Renders the view
            • Add head line
            • Start a new thread
            • Parse method annotation
            • The main method of this class
            • Main method
            • Init path controller map
            • Add new headline
            • Main entry point
            • Prints the error message
            • Prints the reflection class
            • Query the list of head lines
            • Entry point for testing
            • Prints the demo
            • Entry point
            Get all kandi verified functions for this library.

            simple-framework Key Features

            No Key Features are available at this moment for simple-framework.

            simple-framework Examples and Code Snippets

            No Code Snippets are available at this moment for simple-framework.

            Community Discussions

            QUESTION

            @Recover method not intercepted by Spring AOP advice
            Asked 2021-Jun-08 at 03:45

            While writing code using Spring/Java and Aspect oriented programing, I'm facing an issue. In the service class, I have the retry method using @Retryable and a recovery method using @Recover.

            Each of these 2 methods are attached to Aspects. The Retryable method - "triggerJob" inside TestProcessService is attached to these methods in TestAspect class - beforeTestTriggerJobsAdvice, afterTestTriggerJobsAdvice, onErrorTestTriggerJobsAdvice. They all are working fine and getting triggered at the right time.

            PROBLEM STATEMENT: The Recovery method - "recover" inside TestProcessService is attached to these methods in TestAspect class - beforeRecoveryTestJobsAdvice, onErrorRecoveryTestTriggerJobsAdvice, and afterRecoveryTestTriggerJobsAdvice.

            BUT NONE OF THESE ASPECT METHODS ARE GETTING CALLED once the code reached the recover method inside TestProcessService.

            Here is the code:

            SCHEDULER CLASS (triggers the methods inside TEST_MyProcessService class at regular interval)

            ...

            ANSWER

            Answered 2021-Jun-08 at 03:45

            I am not a Spring user, but interested in all things AOP, both AspectJ and Spring AOP. I liked your little puzzle. Thanks to your MCVE, I was able to reproduce the issue and debug into it. This is a perfect example for why an MCVE is so much superior to simply posting a bunch of code snippets. So thanks for that, please keep up this way of asking questions.

            When looking at the situation in a debugger, you see that while the aspect is proceeding into triggerJob, at some point we are in method AnnotationAwareRetryOperationsInterceptor.invoke and there we have the following code:

            Source https://stackoverflow.com/questions/67810277

            QUESTION

            I get java.lang.ClassNotFoundException: org.springframework.web.context.WebApplicationContext at Tomcat webb app
            Asked 2020-Nov-13 at 12:51

            I'm trying to run a web app with maven, spring on a tomcat server in intelliji idea. And i get: Artifact crm-web:war exploded: Error during artifact deployment.

            Loggs:

            Caused by: java.lang.NoClassDefFoundError: org/springframework/web/context/WebApplicationContext Caused by: java.lang.ClassNotFoundException: org.springframework.web.context.WebApplicationContext SEVERE: Exception invoking method createStandardContext SEVERE: Exception invoking method manageApp

            Here is project structure:

            ...

            ANSWER

            Answered 2020-Nov-13 at 12:51

            I was able to solve the problem by moving all the necessary jars to the WEB-INF/lib folder. Turns out they were in a different directory

            Source https://stackoverflow.com/questions/64817490

            QUESTION

            Is it Possible to add PostSharp for dynamic compilation using c# compiler
            Asked 2020-Aug-17 at 10:26

            I am using Microsoft.CodeDom.Providers.DotNetCompilerPlatform nuget packge for compilation of code at runtime. It is achievable but in my scenario my dynamic class needs to use Postsharp for aspect oriented programming.

            Can anyone point me to the commandline support to add Postsharp dependency injection for the compiled assembly using the csc.exe, like what is done by the MSBuild or Visualstudio.

            ...

            ANSWER

            Answered 2020-Aug-17 at 10:26

            You can't easily do that with the current versions of PostSharp. The last version to have command-line execution is 5.0 and that is no longer supported.

            The problem is that PostSharp reads too many properties in MSBuild or passed to it by MSBuild.

            If it's possible for you to generate an msbuild file, you can then build it the Microsoft.Build NuGet package and have PostSharp run on the generated code that way.

            Source https://stackoverflow.com/questions/63418879

            QUESTION

            Check User Authorization with Aspect Oriented Programming in Asp.Net Core 3.1 Web Api
            Asked 2020-Mar-02 at 10:03

            I want to check user authorization in the api method.

            Method responsible for get for an employee by id. So user should render this method if the user works the same company with employee. So I mean user CompanyId should be same with the Employee CompanyId.

            Think about like this api method:

            ...

            ANSWER

            Answered 2020-Mar-02 at 10:03

            You could customize a ActionFilter like below:

            Source https://stackoverflow.com/questions/60477530

            QUESTION

            Install AspectJ Eclipse
            Asked 2020-Jan-05 at 15:41

            I'm trying to get started with aspect oriented programming. I'm using latest eclipse (currently 12-2019)

            ...

            ANSWER

            Answered 2020-Jan-05 at 14:42

            Your problem caused by the removal of org.eclipse.core.runtime.compatibility plugin from Eclipse 4.6 .

            Read more about this problem here.

            The correct solution is to:

            Install AspectJ from the correct download link.

            The most updated to Eclipse 4.10 is: http://download.eclipse.org/tools/ajdt/410/dev/update

            Another solution is to:

            1. Uninstall Eclipse.

            2. Install Eclipse 4.3 (matching your AspectJ version) .

            3. Retry AspectJ install.

            The more complex solution is:

            1. Locate and build/extract org.eclipse.core.runtime.compatibility jar file from Maven repository.

            2. Put org.eclipse.core.runtime.compatibility jar file into Eclipse plugins directory.

            3. Run eclipse in --clean mode to rebuild and register the added plugin.

            4. Retry AspectJ install.

            You might encounter more missing dependencies for org.eclipse.core.runtime.compatibility, eventually will have to load all the related plugins (long effort).

            Source https://stackoverflow.com/questions/59599688

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install simple-framework

            You can download it from GitHub.
            You can use simple-framework like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the simple-framework component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/zhangchao6018/simple-framework.git

          • CLI

            gh repo clone zhangchao6018/simple-framework

          • sshUrl

            git@github.com:zhangchao6018/simple-framework.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Aspect Oriented Libraries

            Try Top Libraries by zhangchao6018

            spring-framework-study

            by zhangchao6018Java

            rabbitmq-demo

            by zhangchao6018Java

            LeetCode-solution

            by zhangchao6018Java

            distribute

            by zhangchao6018Java

            hibernate-validator-demo

            by zhangchao6018Java