Skip to content

Commit

Permalink
* 提升版本至0.3.0-RC3
Browse files Browse the repository at this point in the history
  • Loading branch information
liuyangming committed Jan 5, 2017
1 parent 94bcf94 commit 181a575
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 23 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ByteTCC是一个基于TCC(Try/Confirm/Cancel)机制的分布式事务管理
<dependency>
<groupId>org.bytesoft</groupId>
<artifactId>bytetcc-supports</artifactId>
<version>0.3.0-RC2</version>
<version>0.3.0-RC3</version>
</dependency>
```
#### 1.2. 编写业务服务
Expand Down Expand Up @@ -71,7 +71,8 @@ public class AccountServiceCancel implements IAccountService {
* 1、支持Spring容器的声明式事务管理;
* 2、支持普通事务、TCC事务、业务补偿型事务等事务机制;
* 3、支持多数据源、跨应用、跨服务器等分布式事务场景;
* 4、支持dubbo服务框架;
* 4、支持长事务;
* 5、支持dubbo服务框架;

## 四、历史版本
#### 4.1. v0.1.2
Expand Down
2 changes: 1 addition & 1 deletion bytetcc-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.bytesoft</groupId>
<artifactId>bytetcc-parent</artifactId>
<version>0.3.0-RC2</version>
<version>0.3.0-RC3</version>
</parent>
<artifactId>bytetcc-common</artifactId>
<packaging>jar</packaging>
Expand Down
6 changes: 3 additions & 3 deletions bytetcc-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.bytesoft</groupId>
<artifactId>bytetcc-parent</artifactId>
<version>0.3.0-RC2</version>
<version>0.3.0-RC3</version>
</parent>
<artifactId>bytetcc-core</artifactId>
<packaging>jar</packaging>
Expand All @@ -22,13 +22,13 @@
<dependency>
<groupId>org.bytesoft</groupId>
<artifactId>bytetcc-common</artifactId>
<version>0.3.0-RC2</version>
<version>0.3.0-RC3</version>
</dependency>

<dependency>
<groupId>org.bytesoft</groupId>
<artifactId>bytejta-core</artifactId>
<version>0.3.0-RC2</version>
<version>0.3.0-RC3</version>
</dependency>

<dependency>
Expand Down
6 changes: 3 additions & 3 deletions bytetcc-supports/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.bytesoft</groupId>
<artifactId>bytetcc-parent</artifactId>
<version>0.3.0-RC2</version>
<version>0.3.0-RC3</version>
</parent>
<artifactId>bytetcc-supports</artifactId>
<packaging>jar</packaging>
Expand All @@ -22,12 +22,12 @@
<dependency>
<groupId>org.bytesoft</groupId>
<artifactId>bytetcc-core</artifactId>
<version>0.3.0-RC2</version>
<version>0.3.0-RC3</version>
</dependency>
<dependency>
<groupId>org.bytesoft</groupId>
<artifactId>bytejta-supports</artifactId>
<version>0.3.0-RC2</version>
<version>0.3.0-RC3</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import org.apache.commons.lang3.StringUtils;
import org.bytesoft.compensable.Compensable;
import org.bytesoft.compensable.RemotingException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeansException;
import org.springframework.beans.FatalBeanException;
import org.springframework.beans.factory.config.BeanDefinition;
Expand All @@ -32,6 +34,7 @@
import org.springframework.transaction.annotation.Transactional;

public class CompensableAnnotationValidator implements BeanFactoryPostProcessor {
static final Logger logger = LoggerFactory.getLogger(CompensableAnnotationValidator.class);

public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
Map<String, Class<?>> otherServiceMap = new HashMap<String, Class<?>>();
Expand All @@ -48,6 +51,10 @@ public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
try {
clazz = cl.loadClass(className);
} catch (ClassNotFoundException ex) {
logger.warn("Cannot load class {}, beanId= {}!", className, beanName, ex);
continue;
} catch (RuntimeException rex) {
logger.warn("Cannot load class {}, beanId= {}!", className, beanName, rex);
continue;
}

Expand Down Expand Up @@ -94,8 +101,7 @@ public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
}
Class<?> clazz = otherServiceMap.get(confirmableKey);
if (clazz == null) {
throw new IllegalStateException(
String.format("The confirm bean(id= %s) is not exists!", confirmableKey));
throw new IllegalStateException(String.format("The confirm bean(id= %s) is not exists!", confirmableKey));
}

try {
Expand Down Expand Up @@ -123,8 +129,7 @@ public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
}
Class<?> clazz = otherServiceMap.get(cancellableKey);
if (clazz == null) {
throw new IllegalStateException(
String.format("The cancel bean(id= %s) is not exists!", cancellableKey));
throw new IllegalStateException(String.format("The cancel bean(id= %s) is not exists!", cancellableKey));
}

try {
Expand Down Expand Up @@ -176,8 +181,7 @@ private void validateTransactionalPropagation(Method method, Class<?> clazz) thr
}

if (transactional == null) {
throw new IllegalStateException(
String.format("Method(%s) must be specificed a Transactional annotation!", method));
throw new IllegalStateException(String.format("Method(%s) must be specificed a Transactional annotation!", method));
}
Propagation propagation = transactional.propagation();
if (Propagation.REQUIRED.equals(propagation) == false //
Expand All @@ -188,17 +192,15 @@ private void validateTransactionalPropagation(Method method, Class<?> clazz) thr
}
}

private void validateTransactionalRollbackFor(Method method, Class<?> clazz, String beanName)
throws IllegalStateException {
private void validateTransactionalRollbackFor(Method method, Class<?> clazz, String beanName) throws IllegalStateException {
Transactional transactional = method.getAnnotation(Transactional.class);
if (transactional == null) {
Class<?> declaringClass = method.getDeclaringClass();
transactional = declaringClass.getAnnotation(Transactional.class);
}

if (transactional == null) {
throw new IllegalStateException(
String.format("Method(%s) must be specificed a Transactional annotation!", method));
throw new IllegalStateException(String.format("Method(%s) must be specificed a Transactional annotation!", method));
}

String[] rollbackForClassNameArray = transactional.rollbackForClassName();
Expand Down Expand Up @@ -227,9 +229,9 @@ private void validateTransactionalRollbackFor(Method method, Class<?> clazz, Str
}

if (matched == false) {
throw new IllegalStateException(String.format(
"The value of Transactional.rollbackFor annotated on method(%s) must includes %s!", method,
errorType.getName()));
throw new IllegalStateException(
String.format("The value of Transactional.rollbackFor annotated on method(%s) must includes %s!",
method, errorType.getName()));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>org.bytesoft</groupId>
<artifactId>bytetcc-parent</artifactId>
<version>0.3.0-RC2</version>
<version>0.3.0-RC3</version>
<packaging>pom</packaging>
<name>bytetcc-parent</name>
<description>ByteTCC is a transaction manager based on the TCC(Try/Confirm/Cancel) mechanism.</description>
Expand Down

0 comments on commit 181a575

Please sign in to comment.