Skip to content

Commit

Permalink
Merge pull request #17 from buession/2.3.x
Browse files Browse the repository at this point in the history
Release 2.3.3
  • Loading branch information
eduosi authored May 6, 2024
2 parents 09bfe57 + f13e6f4 commit 4c019f5
Show file tree
Hide file tree
Showing 67 changed files with 1,015 additions and 517 deletions.
38 changes: 38 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,44 @@
===========================


## [2.3.3](https://github.com/buession/buessionframework/releases/tag/v2.3.3) (2024-05-06)

### 🔨依赖升级

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


### ⭐ 新特性

- **buession-core:** 新增默认线程工厂 DefaultThreadFactory
- **buession-core:** 新增默认线程池执行器 DefaultThreadPoolExecutor
- **buession-core:** File 新增创建软链接方法
- **buession-core:** PropertyMapper 新增 alwaysApplyingWhenNull 条件为 null 时,alwaysApplyingWhenNonText 条件为 null 或无字符串(不含空格、换行符、制表位)时


### 🔔 变化

- **buession-core:** 废弃 ThreadPoolConfiguration name 属性
- **buession-core:** 废弃 ThreadPoolConfiguration timeUnit 属性,使用 keepAliveTimeUnit 替代
- **buession-core:** 废弃 ObjectUtils 使用 java 原生 API Optional
- **buession-core:** 废弃 StatusUtils ,迁移至枚举 Status 本身


### 🐞 Bug 修复

- **buession-core:** 修复 StringUtils 类忽略大小写判断是否以字符开头或结尾,错误判断的 BUG
- **buession-dao:** 修复 MongoDBDao 处理 in、nin 条件值错误传递问题


### ⏪ 优化

- **buession-core:** 优化数据验证,减少内存占用
- **buession-json:** 数据脱敏,性能优化


---


## [2.3.2](https://github.com/buession/buessionframework/releases/tag/v2.3.2) (2023-12-27)

### 🔨依赖升级
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.3.2</version>
<version>2.3.3</version>
</parent>
<artifactId>buession-aop</artifactId>
<url>http://www.buession.com/</url>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.slf4j.LoggerFactory;

import java.util.Arrays;
import java.util.StringJoiner;

/**
* Aspectj 方法注解拦截器抽象类
Expand All @@ -56,9 +57,7 @@ public AbstractAspectjAnnotationsMethodInterceptor() {
* 异常
*/
public void performBeforeInterception(JoinPoint joinPoint) throws Throwable {
if(logger.isDebugEnabled()){
performInterceptionDebug(joinPoint);
}
performInterceptionDebug(joinPoint);

// 1. Adapt the join point into a method invocation
BeforeAdviceMethodInvocationAdapter mi = BeforeAdviceMethodInvocationAdapter.createFromJoinPoint(joinPoint);
Expand All @@ -76,9 +75,7 @@ public void performBeforeInterception(JoinPoint joinPoint) throws Throwable {
* 异常
*/
public void performAfterInterception(JoinPoint joinPoint) throws Throwable {
if(logger.isDebugEnabled()){
performInterceptionDebug(joinPoint);
}
performInterceptionDebug(joinPoint);

// 1. Adapt the join point into a method invocation
AfterAdviceMethodInvocationAdapter mi = AfterAdviceMethodInvocationAdapter.createFromJoinPoint(joinPoint);
Expand All @@ -97,9 +94,7 @@ public void performAfterInterception(JoinPoint joinPoint) throws Throwable {
* @since 2.3.0
*/
public void performAfterReturningInterception(JoinPoint joinPoint) throws Throwable {
if(logger.isDebugEnabled()){
performInterceptionDebug(joinPoint);
}
performInterceptionDebug(joinPoint);

// 1. Adapt the join point into a method invocation
AfterReturningAdviceMethodInvocationAdapter mi = AfterReturningAdviceMethodInvocationAdapter.createFromJoinPoint(
Expand All @@ -119,9 +114,7 @@ public void performAfterReturningInterception(JoinPoint joinPoint) throws Throwa
* @since 2.3.0
*/
public void performAfterThrowingInterception(JoinPoint joinPoint) throws Throwable {
if(logger.isDebugEnabled()){
performInterceptionDebug(joinPoint);
}
performInterceptionDebug(joinPoint);

// 1. Adapt the join point into a method invocation
AfterThrowingAdviceMethodInvocationAdapter mi = AfterThrowingAdviceMethodInvocationAdapter.createFromJoinPoint(
Expand All @@ -133,12 +126,15 @@ public void performAfterThrowingInterception(JoinPoint joinPoint) throws Throwab
/**
* 点方法抛出异常时会执行
*
* @param joinPoint
* {@link JoinPoint}
*
* @throws Throwable
* 异常
* @since 2.3.0
*/
public void performAroundInterception(JoinPoint joinPoint) throws Throwable {
if(logger.isDebugEnabled()){
performInterceptionDebug(joinPoint);
}
performInterceptionDebug(joinPoint);

// 1. Adapt the join point into a method invocation
AroundAdviceMethodInvocationAdapter mi = AroundAdviceMethodInvocationAdapter.createFromJoinPoint(
Expand All @@ -148,17 +144,18 @@ public void performAroundInterception(JoinPoint joinPoint) throws Throwable {
}

protected void performInterceptionDebug(final JoinPoint joinPoint) {
final StringBuilder message = new StringBuilder(255);
if(logger.isDebugEnabled()){
StringJoiner joiner = new StringJoiner(System.lineSeparator());

message.append("Invoking a method decorated with a annotation").append(System.lineSeparator());
message.append("\tkind : ").append(joinPoint.getKind()).append(System.lineSeparator());
message.append("\tjoinPoint : ").append(joinPoint).append(System.lineSeparator());
message.append("\tannotations: ")
.append(Arrays.toString(((MethodSignature) joinPoint.getSignature()).getMethod().getAnnotations()))
.append(System.lineSeparator());
message.append("\ttarget : ").append(joinPoint.getTarget());
joiner.add("Invoking a method decorated with a annotation");
joiner.add("\tkind : " + joinPoint.getKind());
joiner.add("\tjoinPoint : " + joinPoint);
joiner.add("\tannotations: " +
Arrays.toString(((MethodSignature) joinPoint.getSignature()).getMethod().getAnnotations()));
joiner.add("\ttarget : " + joinPoint.getTarget());

logger.debug(message.toString());
logger.debug(joiner.toString());
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* +-------------------------------------------------------------------------------------------------------+
* | License: http://www.apache.org/licenses/LICENSE-2.0.txt |
* | Author: Yong.Teng <[email protected]> |
* | Copyright @ 2013-2022 Buession.com Inc. |
* | Copyright @ 2013-2023 Buession.com Inc. |
* +-------------------------------------------------------------------------------------------------------+
*/
package com.buession.aop.interceptor;
Expand Down Expand Up @@ -60,7 +60,7 @@ public abstract class AbstractAnnotationMethodInterceptor<A extends Annotation>
* @param handler
* JSR-175 注解读取和处理器
*/
public AbstractAnnotationMethodInterceptor(AnnotationHandler<A> handler){
public AbstractAnnotationMethodInterceptor(AnnotationHandler<A> handler) {
this(handler, new DefaultAnnotationResolver());
}

Expand All @@ -72,46 +72,68 @@ public AbstractAnnotationMethodInterceptor(AnnotationHandler<A> handler){
* @param resolver
* 注解解析器
*/
public AbstractAnnotationMethodInterceptor(AnnotationHandler<A> handler, AnnotationResolver resolver){
public AbstractAnnotationMethodInterceptor(AnnotationHandler<A> handler, AnnotationResolver resolver) {
Assert.isNull(handler, "AnnotationHandler cloud not be null.");

setHandler(handler);
setResolver(Optional.of(resolver).orElse(new DefaultAnnotationResolver()));
}

public AnnotationHandler<A> getHandler(){
/**
* 返回 JSR-175 注解读取和处理器
*
* @return JSR-175 注解读取和处理器
*/
public AnnotationHandler<A> getHandler() {
return handler;
}

public void setHandler(AnnotationHandler<A> handler){
/**
* 设置 JSR-175 注解读取和处理器
*
* @param handler
* JSR-175 注解读取和处理器
*/
public void setHandler(AnnotationHandler<A> handler) {
this.handler = handler;
}

public AnnotationResolver getResolver(){
/**
* 返回注解解析器
*
* @return 注解解析器
*/
public AnnotationResolver getResolver() {
return resolver;
}

public void setResolver(AnnotationResolver resolver){
/**
* 设置注解解析器
*
* @param resolver
* 注解解析器
*/
public void setResolver(AnnotationResolver resolver) {
this.resolver = resolver;
}

@Override
public boolean isSupport(MethodInvocation mi){
public boolean isSupport(MethodInvocation mi) {
return getAnnotation(mi) != null;
}

@Override
public Object invoke(MethodInvocation mi) throws Throwable{
public Object invoke(MethodInvocation mi) throws Throwable {
execute(mi);
return mi.proceed();
}

@Override
public void execute(MethodInvocation mi) throws Throwable{
public void execute(MethodInvocation mi) throws Throwable {
getHandler().execute(mi, getAnnotation(mi));
}

protected A getAnnotation(MethodInvocation mi){
protected A getAnnotation(MethodInvocation mi) {
return getResolver().getAnnotation(mi, getHandler().getAnnotationClass());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,15 @@
public class DefaultAnnotationResolver extends AbstractAnnotationResolver {

@Override
public <A extends Annotation> A getAnnotation(MethodInvocation mi, Class<A> clazz){
public <A extends Annotation> A getAnnotation(MethodInvocation mi, Class<A> clazz) {
Method method = preGetAnnotation(mi, clazz);

A annotation = method.getAnnotation(clazz);
if(annotation == null){
Object miThis = mi.getThis();
annotation = miThis == null ? null : miThis.getClass().getAnnotation(clazz);
if(miThis != null){
annotation = miThis.getClass().getAnnotation(clazz);
}
}

return annotation;
Expand Down
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.3.2</version>
<version>2.3.3</version>
</parent>
<artifactId>buession-beans</artifactId>
<url>http://www.buession.com/</url>
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.3.2</version>
<version>2.3.3</version>
</parent>
<artifactId>buession-core</artifactId>
<url>http://www.buession.com/</url>
Expand Down
Loading

0 comments on commit 4c019f5

Please sign in to comment.