Skip to content

Commit

Permalink
Merge pull request #5 from buession/2.1.x
Browse files Browse the repository at this point in the history
release 2.1.1
  • Loading branch information
eduosi authored Aug 18, 2022
2 parents f961660 + 9fa40ac commit 38966cd
Show file tree
Hide file tree
Showing 32 changed files with 287 additions and 54 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
Buession Framework Changelog
===========================


## [2.1.1](https://github.com/buession/buession-parent/releases/tag/v2.1.1) (2022-08-18)

### 🔨依赖升级

- [依赖库版本升级和安全漏洞修复](https://github.com/buession/buession-parent/releases/tag/v2.1.1)


### ⭐ 新特性

- **buession-core:** DateTime 增加统计年、月天数


---


## [2.1.0](https://github.com/buession/buessionframework/releases/tag/v2.1.0) (2022-08-07)

### 🔨依赖升级
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@


<p align="center">
<img src="docs/images/logo.png" alt="BuessionFramework" title="BuessionFramework" width="280px" />
<img src="logo.png" alt="BuessionFramework" title="BuessionFramework" width="280px" />
</p>

## Requirements
Expand Down
2 changes: 1 addition & 1 deletion buession-aop/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>com.buession</groupId>
<artifactId>buession-parent</artifactId>
<relativePath>../buession-parent</relativePath>
<version>2.1.0</version>
<version>2.1.1</version>
</parent>
<artifactId>buession-aop</artifactId>
<url>https://github.com/buession/buessionframework</url>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,17 @@
import java.lang.reflect.Method;

/**
* Aop Alliance 方法注解拦截器抽象类
*
* @author Yong.Teng
* @since 2.1.0
*/
public abstract class AbstractAopAllianceAnnotationsMethodInterceptor extends AbstractAnnotationsMethodInterceptor
implements AnnotationsMethodInterceptor {

/**
* 构造函数
*/
public AbstractAopAllianceAnnotationsMethodInterceptor(){
super();
}
Expand All @@ -47,6 +52,14 @@ public Object invoke(MethodInvocation methodInvocation) throws Throwable{
return super.invoke(mi);
}

/**
* Create instance for {@link com.buession.aop.MethodInvocation}.
*
* @param mi
* The method invocation joinpoint
*
* @return The instance of {@link com.buession.aop.MethodInvocation}
*/
protected com.buession.aop.MethodInvocation createMethodInvocation(final MethodInvocation mi){
return new com.buession.aop.MethodInvocation() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,43 +24,17 @@
*/
package com.buession.aop.aspectj;

import com.buession.aop.interceptor.AbstractAnnotationsMethodInterceptor;
import org.aspectj.lang.JoinPoint;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* Aspectj 方法注解拦截器抽象类
*
* @author Yong.Teng
* @since 2.1.0
*/
public abstract class AbstractAspectAnnotationsMethodInterceptor extends AbstractAnnotationsMethodInterceptor {

private final Logger logger = LoggerFactory.getLogger(getClass());
@Deprecated
public abstract class AbstractAspectAnnotationsMethodInterceptor extends AbstractAspectjAnnotationsMethodInterceptor {

public AbstractAspectAnnotationsMethodInterceptor(){
super();
}

public void performBeforeInterception(JoinPoint joinPoint) throws Throwable{
if(logger.isDebugEnabled()){
AspectjAnnotationsMethodInterceptorLogUtils.performBeforeInterceptionDebug(logger, joinPoint);
}

// 1. Adapt the join point into a method invocation
BeforeAdviceMethodInvocationAdapter mi = BeforeAdviceMethodInvocationAdapter.createFromJoinPoint(joinPoint);
// 2. Delegate the authorization of the method call to the super class
super.invoke(mi);
}

public void performAfterInterception(JoinPoint joinPoint) throws Throwable{
if(logger.isDebugEnabled()){
AspectjAnnotationsMethodInterceptorLogUtils.performAfterInterceptionDebug(logger, joinPoint);
}

// 1. Adapt the join point into a method invocation
AfterAdviceMethodInvocationAdapter mi = AfterAdviceMethodInvocationAdapter.createFromJoinPoint(joinPoint);
// 2. Delegate the authorization of the method call to the super class
super.invoke(mi);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
* See the NOTICE file distributed with this work for additional information regarding copyright ownership.
* The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and limitations under the License.
*
* =========================================================================================================
*
* This software consists of voluntary contributions made by many individuals on behalf of the
* Apache Software Foundation. For more information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* +-------------------------------------------------------------------------------------------------------+
* | License: http://www.apache.org/licenses/LICENSE-2.0.txt |
* | Author: Yong.Teng <[email protected]> |
* | Copyright @ 2013-2022 Buession.com Inc. |
* +-------------------------------------------------------------------------------------------------------+
*/
package com.buession.aop.aspectj;

import com.buession.aop.interceptor.AbstractAnnotationsMethodInterceptor;
import org.aspectj.lang.JoinPoint;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* Aspectj 方法注解拦截器抽象类
*
* @author Yong.Teng
* @since 2.1.0
*/
public abstract class AbstractAspectjAnnotationsMethodInterceptor extends AbstractAnnotationsMethodInterceptor {

private final Logger logger = LoggerFactory.getLogger(getClass());

public AbstractAspectjAnnotationsMethodInterceptor(){
super();
}

public void performBeforeInterception(JoinPoint joinPoint) throws Throwable{
if(logger.isDebugEnabled()){
AspectjAnnotationsMethodInterceptorLogUtils.performBeforeInterceptionDebug(logger, joinPoint);
}

// 1. Adapt the join point into a method invocation
BeforeAdviceMethodInvocationAdapter mi = BeforeAdviceMethodInvocationAdapter.createFromJoinPoint(joinPoint);
// 2. Delegate the authorization of the method call to the super class
super.invoke(mi);
}

public void performAfterInterception(JoinPoint joinPoint) throws Throwable{
if(logger.isDebugEnabled()){
AspectjAnnotationsMethodInterceptorLogUtils.performAfterInterceptionDebug(logger, joinPoint);
}

// 1. Adapt the join point into a method invocation
AfterAdviceMethodInvocationAdapter mi = AfterAdviceMethodInvocationAdapter.createFromJoinPoint(joinPoint);
// 2. Delegate the authorization of the method call to the super class
super.invoke(mi);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* @author Yong.Teng
* @since 2.1.0
*/
public class AspectjAnnotationsMethodInterceptorLogUtils {
class AspectjAnnotationsMethodInterceptorLogUtils {

private AspectjAnnotationsMethodInterceptorLogUtils(){

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,29 +27,63 @@
import org.aspectj.lang.Signature;

/**
* 签名错误异常
*
* @author Yong.Teng
*/
public class SignatureIllegalArgumentException extends IllegalArgumentException {

private final static long serialVersionUID = 6148632731869242050L;

/**
* 签名
*/
private final Signature signature;

/**
* 构造函数,定义了默认异常信息
*
* @param signature
* 签名
*/
public SignatureIllegalArgumentException(Signature signature){
this(signature,
"The join point signature is invalid: expected a MethodSignature or an AdviceSignature but was ");
}

/**
* 构造函数
*
* @param signature
* 签名
* @param message
* 异常信息
*/
public SignatureIllegalArgumentException(Signature signature, String message){
super(message + signature);
this.signature = signature;
}

/**
* 构造函数
*
* @param signature
* 签名
* @param message
* 异常信息
* @param cause
* {@link Throwable}
*/
public SignatureIllegalArgumentException(Signature signature, String message, Throwable cause){
super(message + signature, cause);
this.signature = signature;
}

/**
* 返回签名
*
* @return 签名
*/
public Signature getSignature(){
return signature;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@
import org.aopalliance.intercept.MethodInterceptor;

/**
* 注解方法拦截器
*
* @author Yong.Teng
* @since 2.1.0
*/
@FunctionalInterface
public interface AnnotationsMethodInterceptor extends MethodInterceptor {

}
2 changes: 1 addition & 1 deletion buession-beans/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>com.buession</groupId>
<artifactId>buession-parent</artifactId>
<relativePath>../buession-parent</relativePath>
<version>2.1.0</version>
<version>2.1.1</version>
</parent>
<artifactId>buession-beans</artifactId>
<url>https://github.com/buession/buessionframework</url>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,54 @@
*/
public class PropertyDescriptorUtils {

/**
* 返回 {@link PropertyDescriptor} 的 getter 方法
*
* @param descriptor
* {@link PropertyDescriptor}
*
* @return {@link PropertyDescriptor} 的 getter 方法
*/
public static Method getReadMethod(final PropertyDescriptor descriptor){
return MethodUtils.getAccessibleMethod(descriptor.getReadMethod());
}

/**
* 返回类 clazz {@link PropertyDescriptor} 的 getter 方法
*
* @param clazz
* 类
* @param descriptor
* {@link PropertyDescriptor}
*
* @return 类 clazz {@link PropertyDescriptor} 的 getter 方法
*/
public static Method getReadMethod(final Class<?> clazz, final PropertyDescriptor descriptor){
return MethodUtils.getAccessibleMethod(clazz, descriptor.getReadMethod());
}

/**
* 返回 {@link PropertyDescriptor} 的 setter 方法
*
* @param descriptor
* {@link PropertyDescriptor}
*
* @return {@link PropertyDescriptor} 的 setter 方法
*/
public static Method getWriteMethod(final PropertyDescriptor descriptor){
return MethodUtils.getAccessibleMethod(descriptor.getWriteMethod());
}

/**
* 返回类 clazz {@link PropertyDescriptor} 的 setter 方法
*
* @param clazz
* 类
* @param descriptor
* {@link PropertyDescriptor}
*
* @return 类 clazz {@link PropertyDescriptor} 的 setter 方法
*/
public static Method getWriteMethod(final Class<?> clazz, final PropertyDescriptor descriptor){
return MethodUtils.getAccessibleMethod(clazz, descriptor.getWriteMethod());
}
Expand Down
2 changes: 1 addition & 1 deletion buession-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>com.buession</groupId>
<artifactId>buession-parent</artifactId>
<relativePath>../buession-parent</relativePath>
<version>2.1.0</version>
<version>2.1.1</version>
</parent>
<artifactId>buession-core</artifactId>
<url>https://github.com/buession/buessionframework</url>
Expand Down
Loading

0 comments on commit 38966cd

Please sign in to comment.