1.移除Sample工程 2. 将SkywalkingAgent采用ByteBuddy的Agent
This commit is contained in:
parent
a7068a8891
commit
00a5cb9aeb
|
|
@ -1,202 +0,0 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-example-account-impl</artifactId>
|
||||
<version>1.0-Final</version>
|
||||
|
||||
<name>skywalking-example-account-impl</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>Company</id>
|
||||
<url>http://10.1.228.199:18081/nexus/content/groups/public/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbox</artifactId>
|
||||
<version>2.8.4</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-beans</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-core</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-aop</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-expression</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.101tec</groupId>
|
||||
<artifactId>zkclient</artifactId>
|
||||
<version>0.7</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-core</artifactId>
|
||||
<version>2.4.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>5.1.37</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.javassist</groupId>
|
||||
<artifactId>javassist</artifactId>
|
||||
<version>3.20.0-GA</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
<version>4.1.5.RELEASE</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-jdbc</artifactId>
|
||||
<version>4.1.5.RELEASE</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-jdbc</artifactId>
|
||||
<version>4.1.5.RELEASE</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-tx</artifactId>
|
||||
<version>4.1.5.RELEASE</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-dbcp2</artifactId>
|
||||
<version>2.1</version>
|
||||
</dependency>
|
||||
<!-- mybatis -->
|
||||
<dependency>
|
||||
<groupId>org.mybatis</groupId>
|
||||
<artifactId>mybatis</artifactId>
|
||||
<version>3.3.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mybatis</groupId>
|
||||
<artifactId>mybatis-spring</artifactId>
|
||||
<version>1.2.2</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-jdbc</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<!-- save order dubbo interfaces -->
|
||||
<dependency>
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-example-account-interfaces</artifactId>
|
||||
<version>1.0-Final</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
<version>4.2.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Gson -->
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
<version>2.5</version>
|
||||
</dependency>
|
||||
<!-- sw spring plugin -->
|
||||
<dependency>
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-spring-plugin</artifactId>
|
||||
<version>1.0-Final</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-dubbo-plugin</artifactId>
|
||||
<version>1.0-Final</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-api</artifactId>
|
||||
<version>2.4.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-jdbc-plugin</artifactId>
|
||||
<version>1.0-Final</version>
|
||||
</dependency>
|
||||
|
||||
<!-- -->
|
||||
<dependency>
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-httpClient-4.2.x-plugin</artifactId>
|
||||
<version>1.0-Final</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.aspectj</groupId>
|
||||
<artifactId>aspectjweaver</artifactId>
|
||||
<version>1.8.7</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-log4j-1.x-plugin</artifactId>
|
||||
<version>1.0-Final</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-log4j-2.x-plugin</artifactId>
|
||||
<version>1.0-Final</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>1.6</source>
|
||||
<target>1.6</target>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>2.4.3</version>
|
||||
<configuration>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
package com.ai.cloud.skywalking.example.account.dao.mapper.bo;
|
||||
|
||||
public class TAccount {
|
||||
private int accountId;
|
||||
|
||||
private String phoneNumber;
|
||||
|
||||
private String mail;
|
||||
|
||||
public int getAccountId() {
|
||||
return accountId;
|
||||
}
|
||||
|
||||
public void setAccountId(int accountId) {
|
||||
this.accountId = accountId;
|
||||
}
|
||||
|
||||
public String getPhoneNumber() {
|
||||
return phoneNumber;
|
||||
}
|
||||
|
||||
public void setPhoneNumber(String phoneNumber) {
|
||||
this.phoneNumber = phoneNumber == null ? null : phoneNumber.trim();
|
||||
}
|
||||
|
||||
public String getMail() {
|
||||
return mail;
|
||||
}
|
||||
|
||||
public void setMail(String mail) {
|
||||
this.mail = mail == null ? null : mail.trim();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,420 +0,0 @@
|
|||
package com.ai.cloud.skywalking.example.account.dao.mapper.bo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class TAccountCriteria {
|
||||
protected String orderByClause;
|
||||
|
||||
protected boolean distinct;
|
||||
|
||||
protected List<Criteria> oredCriteria;
|
||||
|
||||
protected Integer limitStart;
|
||||
|
||||
protected Integer limitEnd;
|
||||
|
||||
public TAccountCriteria() {
|
||||
oredCriteria = new ArrayList<Criteria>();
|
||||
}
|
||||
|
||||
public void setOrderByClause(String orderByClause) {
|
||||
this.orderByClause = orderByClause;
|
||||
}
|
||||
|
||||
public String getOrderByClause() {
|
||||
return orderByClause;
|
||||
}
|
||||
|
||||
public void setDistinct(boolean distinct) {
|
||||
this.distinct = distinct;
|
||||
}
|
||||
|
||||
public boolean isDistinct() {
|
||||
return distinct;
|
||||
}
|
||||
|
||||
public List<Criteria> getOredCriteria() {
|
||||
return oredCriteria;
|
||||
}
|
||||
|
||||
public void or(Criteria criteria) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
|
||||
public Criteria or() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
oredCriteria.add(criteria);
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public Criteria createCriteria() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
if (oredCriteria.size() == 0) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
return criteria;
|
||||
}
|
||||
|
||||
protected Criteria createCriteriaInternal() {
|
||||
Criteria criteria = new Criteria();
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
oredCriteria.clear();
|
||||
orderByClause = null;
|
||||
distinct = false;
|
||||
}
|
||||
|
||||
public void setLimitStart(Integer limitStart) {
|
||||
this.limitStart=limitStart;
|
||||
}
|
||||
|
||||
public Integer getLimitStart() {
|
||||
return limitStart;
|
||||
}
|
||||
|
||||
public void setLimitEnd(Integer limitEnd) {
|
||||
this.limitEnd=limitEnd;
|
||||
}
|
||||
|
||||
public Integer getLimitEnd() {
|
||||
return limitEnd;
|
||||
}
|
||||
|
||||
protected abstract static class GeneratedCriteria {
|
||||
protected List<Criterion> criteria;
|
||||
|
||||
protected GeneratedCriteria() {
|
||||
super();
|
||||
criteria = new ArrayList<Criterion>();
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
return criteria.size() > 0;
|
||||
}
|
||||
|
||||
public List<Criterion> getAllCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public List<Criterion> getCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition) {
|
||||
if (condition == null) {
|
||||
throw new RuntimeException("Value for condition cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value, String property) {
|
||||
if (value == null) {
|
||||
throw new RuntimeException("Value for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value1, Object value2, String property) {
|
||||
if (value1 == null || value2 == null) {
|
||||
throw new RuntimeException("Between values for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value1, value2));
|
||||
}
|
||||
|
||||
public Criteria andAccountIdIsNull() {
|
||||
addCriterion("ACCOUNT_ID is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAccountIdIsNotNull() {
|
||||
addCriterion("ACCOUNT_ID is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAccountIdEqualTo(int value) {
|
||||
addCriterion("ACCOUNT_ID =", value, "accountId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAccountIdNotEqualTo(int value) {
|
||||
addCriterion("ACCOUNT_ID <>", value, "accountId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAccountIdGreaterThan(int value) {
|
||||
addCriterion("ACCOUNT_ID >", value, "accountId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAccountIdGreaterThanOrEqualTo(int value) {
|
||||
addCriterion("ACCOUNT_ID >=", value, "accountId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAccountIdLessThan(int value) {
|
||||
addCriterion("ACCOUNT_ID <", value, "accountId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAccountIdLessThanOrEqualTo(int value) {
|
||||
addCriterion("ACCOUNT_ID <=", value, "accountId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAccountIdIn(List<Integer> values) {
|
||||
addCriterion("ACCOUNT_ID in", values, "accountId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAccountIdNotIn(List<Integer> values) {
|
||||
addCriterion("ACCOUNT_ID not in", values, "accountId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAccountIdBetween(int value1, int value2) {
|
||||
addCriterion("ACCOUNT_ID between", value1, value2, "accountId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAccountIdNotBetween(int value1, int value2) {
|
||||
addCriterion("ACCOUNT_ID not between", value1, value2, "accountId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPhoneNumberIsNull() {
|
||||
addCriterion("PHONE_NUMBER is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPhoneNumberIsNotNull() {
|
||||
addCriterion("PHONE_NUMBER is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPhoneNumberEqualTo(String value) {
|
||||
addCriterion("PHONE_NUMBER =", value, "phoneNumber");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPhoneNumberNotEqualTo(String value) {
|
||||
addCriterion("PHONE_NUMBER <>", value, "phoneNumber");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPhoneNumberGreaterThan(String value) {
|
||||
addCriterion("PHONE_NUMBER >", value, "phoneNumber");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPhoneNumberGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("PHONE_NUMBER >=", value, "phoneNumber");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPhoneNumberLessThan(String value) {
|
||||
addCriterion("PHONE_NUMBER <", value, "phoneNumber");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPhoneNumberLessThanOrEqualTo(String value) {
|
||||
addCriterion("PHONE_NUMBER <=", value, "phoneNumber");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPhoneNumberLike(String value) {
|
||||
addCriterion("PHONE_NUMBER like", value, "phoneNumber");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPhoneNumberNotLike(String value) {
|
||||
addCriterion("PHONE_NUMBER not like", value, "phoneNumber");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPhoneNumberIn(List<String> values) {
|
||||
addCriterion("PHONE_NUMBER in", values, "phoneNumber");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPhoneNumberNotIn(List<String> values) {
|
||||
addCriterion("PHONE_NUMBER not in", values, "phoneNumber");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPhoneNumberBetween(String value1, String value2) {
|
||||
addCriterion("PHONE_NUMBER between", value1, value2, "phoneNumber");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPhoneNumberNotBetween(String value1, String value2) {
|
||||
addCriterion("PHONE_NUMBER not between", value1, value2, "phoneNumber");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMailIsNull() {
|
||||
addCriterion("MAIL is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMailIsNotNull() {
|
||||
addCriterion("MAIL is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMailEqualTo(String value) {
|
||||
addCriterion("MAIL =", value, "mail");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMailNotEqualTo(String value) {
|
||||
addCriterion("MAIL <>", value, "mail");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMailGreaterThan(String value) {
|
||||
addCriterion("MAIL >", value, "mail");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMailGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("MAIL >=", value, "mail");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMailLessThan(String value) {
|
||||
addCriterion("MAIL <", value, "mail");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMailLessThanOrEqualTo(String value) {
|
||||
addCriterion("MAIL <=", value, "mail");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMailLike(String value) {
|
||||
addCriterion("MAIL like", value, "mail");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMailNotLike(String value) {
|
||||
addCriterion("MAIL not like", value, "mail");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMailIn(List<String> values) {
|
||||
addCriterion("MAIL in", values, "mail");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMailNotIn(List<String> values) {
|
||||
addCriterion("MAIL not in", values, "mail");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMailBetween(String value1, String value2) {
|
||||
addCriterion("MAIL between", value1, value2, "mail");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMailNotBetween(String value1, String value2) {
|
||||
addCriterion("MAIL not between", value1, value2, "mail");
|
||||
return (Criteria) this;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Criteria extends GeneratedCriteria {
|
||||
|
||||
protected Criteria() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
public static class Criterion {
|
||||
private String condition;
|
||||
|
||||
private Object value;
|
||||
|
||||
private Object secondValue;
|
||||
|
||||
private boolean noValue;
|
||||
|
||||
private boolean singleValue;
|
||||
|
||||
private boolean betweenValue;
|
||||
|
||||
private boolean listValue;
|
||||
|
||||
private String typeHandler;
|
||||
|
||||
public String getCondition() {
|
||||
return condition;
|
||||
}
|
||||
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public Object getSecondValue() {
|
||||
return secondValue;
|
||||
}
|
||||
|
||||
public boolean isNoValue() {
|
||||
return noValue;
|
||||
}
|
||||
|
||||
public boolean isSingleValue() {
|
||||
return singleValue;
|
||||
}
|
||||
|
||||
public boolean isBetweenValue() {
|
||||
return betweenValue;
|
||||
}
|
||||
|
||||
public boolean isListValue() {
|
||||
return listValue;
|
||||
}
|
||||
|
||||
public String getTypeHandler() {
|
||||
return typeHandler;
|
||||
}
|
||||
|
||||
protected Criterion(String condition) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.typeHandler = null;
|
||||
this.noValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.typeHandler = typeHandler;
|
||||
if (value instanceof List<?>) {
|
||||
this.listValue = true;
|
||||
} else {
|
||||
this.singleValue = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value) {
|
||||
this(condition, value, null);
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.secondValue = secondValue;
|
||||
this.typeHandler = typeHandler;
|
||||
this.betweenValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue) {
|
||||
this(condition, value, secondValue, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
package com.ai.cloud.skywalking.example.account.dao.mapper.interfaces;
|
||||
|
||||
import com.ai.cloud.skywalking.example.account.dao.mapper.bo.TAccount;
|
||||
import com.ai.cloud.skywalking.example.account.dao.mapper.bo.TAccountCriteria;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface TAccountMapper {
|
||||
int countByExample(TAccountCriteria example);
|
||||
|
||||
int deleteByExample(TAccountCriteria example);
|
||||
|
||||
int deleteByPrimaryKey(int accountId);
|
||||
|
||||
int insert(TAccount record);
|
||||
|
||||
int insertSelective(TAccount record);
|
||||
|
||||
List<TAccount> selectByExample(TAccountCriteria example);
|
||||
|
||||
TAccount selectByPrimaryKey(int accountId);
|
||||
|
||||
int updateByExampleSelective(@Param("record") TAccount record, @Param("example") TAccountCriteria example);
|
||||
|
||||
int updateByExample(@Param("record") TAccount record, @Param("example") TAccountCriteria example);
|
||||
|
||||
int updateByPrimaryKeySelective(TAccount record);
|
||||
|
||||
int updateByPrimaryKey(TAccount record);
|
||||
}
|
||||
|
|
@ -1,67 +0,0 @@
|
|||
package com.ai.cloud.skywalking.example.account.dubbo.impl;
|
||||
|
||||
import com.ai.cloud.skywalking.tracer.RPCBuriedPointSender;
|
||||
import com.ai.cloud.skywalking.example.account.dubbo.interfaces.IAccountMaintain;
|
||||
import com.ai.cloud.skywalking.example.account.dubbo.interfaces.param.AccountInfo;
|
||||
import com.ai.cloud.skywalking.example.account.exception.BusinessException;
|
||||
import com.ai.cloud.skywalking.example.account.manage.IAccountMaintainService;
|
||||
import com.ai.cloud.skywalking.example.account.model.CommonsHttpResult;
|
||||
import com.ai.cloud.skywalking.example.account.util.HttpClientUtil;
|
||||
import com.ai.cloud.skywalking.model.Identification;
|
||||
import com.alibaba.dubbo.config.annotation.Service;
|
||||
import com.google.gson.Gson;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class AccountMaintainImpl implements IAccountMaintain {
|
||||
|
||||
private static final String MAIL_APPLICATION_DEPLOY_ADDRESS = "http://localhost:8080/mail-web";
|
||||
|
||||
private static final String SEND_MAIL_URL = "/mail/send";
|
||||
|
||||
@Autowired
|
||||
private IAccountMaintainService iAccountMaintainService;
|
||||
|
||||
@Override
|
||||
public String create(AccountInfo accountInfo) {
|
||||
Gson gson = new Gson();
|
||||
CommonsHttpResult commonsHttpResult = new CommonsHttpResult();
|
||||
try {
|
||||
boolean result = iAccountMaintainService.createAccount(accountInfo);
|
||||
if (!result) {
|
||||
commonsHttpResult.setErrorCode("99999");
|
||||
commonsHttpResult.setMessage("Create account failed");
|
||||
} else {
|
||||
Map<String, String> parameters = new HashMap<String, String>();
|
||||
parameters.put("recipientAccount", accountInfo.getMail());
|
||||
String mailResult = HttpClientUtil.sendPostRequest(MAIL_APPLICATION_DEPLOY_ADDRESS + SEND_MAIL_URL,
|
||||
parameters);
|
||||
|
||||
CommonsHttpResult commonsHttpResult1 = gson.fromJson(mailResult, CommonsHttpResult.class);
|
||||
if ("000000".equals(commonsHttpResult1.getErrorCode())) {
|
||||
commonsHttpResult.setErrorCode("000000");
|
||||
commonsHttpResult.setMessage("Create account success");
|
||||
} else {
|
||||
commonsHttpResult.setErrorCode("99999");
|
||||
commonsHttpResult.setMessage("Send mail failed");
|
||||
}
|
||||
}
|
||||
} catch (BusinessException e) {
|
||||
commonsHttpResult.setErrorCode("99999");
|
||||
commonsHttpResult.setMessage("Create account failed");
|
||||
} catch (URISyntaxException e) {
|
||||
commonsHttpResult.setErrorCode("99999");
|
||||
commonsHttpResult.setMessage("Create account failed");
|
||||
} catch (IOException e) {
|
||||
commonsHttpResult.setErrorCode("99999");
|
||||
commonsHttpResult.setMessage("Create account failed");
|
||||
}
|
||||
|
||||
return gson.toJson(commonsHttpResult);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
package com.ai.cloud.skywalking.example.account.exception;
|
||||
|
||||
public class BusinessException extends Exception {
|
||||
|
||||
public BusinessException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public BusinessException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
package com.ai.cloud.skywalking.example.account.manage;
|
||||
|
||||
import com.ai.cloud.skywalking.example.account.dubbo.interfaces.param.AccountInfo;
|
||||
import com.ai.cloud.skywalking.example.account.exception.BusinessException;
|
||||
|
||||
public interface IAccountMaintainService {
|
||||
boolean createAccount(AccountInfo accountInfo) throws BusinessException;
|
||||
}
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
package com.ai.cloud.skywalking.example.account.manage.impl;
|
||||
|
||||
import com.ai.cloud.skywalking.example.account.dao.mapper.bo.TAccount;
|
||||
import com.ai.cloud.skywalking.example.account.dao.mapper.interfaces.TAccountMapper;
|
||||
import com.ai.cloud.skywalking.example.account.dubbo.interfaces.param.AccountInfo;
|
||||
import com.ai.cloud.skywalking.example.account.exception.BusinessException;
|
||||
import com.ai.cloud.skywalking.example.account.manage.IAccountMaintainService;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.mybatis.spring.SqlSessionTemplate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@Service
|
||||
@Transactional
|
||||
public class AccountMaintainServiceImpl implements IAccountMaintainService {
|
||||
|
||||
private Logger logger = LogManager.getLogger(AccountMaintainServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
private SqlSessionTemplate sqlSessionTemplate;
|
||||
|
||||
@Override
|
||||
public boolean createAccount(AccountInfo accountInfo) throws BusinessException {
|
||||
if (accountInfo.getPhoneNumber() == null || accountInfo.getPhoneNumber().length() <= 0) {
|
||||
throw new BusinessException("Phone number cannot be null");
|
||||
}
|
||||
if (accountInfo.getPhoneNumber() == null || accountInfo.getPhoneNumber().length() <= 0) {
|
||||
throw new BusinessException("Phone number cannot be null");
|
||||
}
|
||||
try {
|
||||
TAccountMapper tAccountMapper = sqlSessionTemplate.getMapper(TAccountMapper.class);
|
||||
TAccount tAccount = new TAccount();
|
||||
tAccount.setPhoneNumber(accountInfo.getPhoneNumber());
|
||||
tAccount.setMail(accountInfo.getMail());
|
||||
tAccountMapper.insert(tAccount);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
logger.error("Create account failed", e);
|
||||
throw new BusinessException("Create account failed", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
package com.ai.cloud.skywalking.example.account.model;
|
||||
|
||||
public class CommonsHttpResult {
|
||||
private String errorCode;
|
||||
private String message;
|
||||
|
||||
public String getErrorCode() {
|
||||
return errorCode;
|
||||
}
|
||||
|
||||
public void setErrorCode(String errorCode) {
|
||||
this.errorCode = errorCode;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
package com.ai.cloud.skywalking.example.account.util;
|
||||
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
|
||||
public class DubboStart {
|
||||
|
||||
|
||||
public static void main(String[] args) throws InterruptedException {
|
||||
ClassPathXmlApplicationContext context =
|
||||
new ClassPathXmlApplicationContext("classpath*:applicationContext.xml");
|
||||
context.start();
|
||||
while (true){
|
||||
Thread.sleep(1000000000L);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
package com.ai.cloud.skywalking.example.account.util;
|
||||
|
||||
import com.ai.cloud.skywalking.plugin.httpclient.v42x.SWTracingHttpClient;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.client.entity.UrlEncodedFormEntity;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.impl.client.DefaultHttpClient;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class HttpClientUtil {
|
||||
private static final Log logger = LogFactory.getLog(HttpClientUtil.class);
|
||||
|
||||
public static String sendPostRequest(String url, Map<String, String> parametersMap) throws IOException, URISyntaxException {
|
||||
HttpClient httpclient = new SWTracingHttpClient(new DefaultHttpClient());
|
||||
HttpPost httpPost = new HttpPost(new URL(url).toURI());
|
||||
List formparams = new ArrayList();
|
||||
for (Map.Entry<String, String> entry : parametersMap.entrySet()) {
|
||||
formparams.add(new BasicNameValuePair(entry.getKey(), entry.getValue()));
|
||||
}
|
||||
|
||||
httpPost.setEntity(new UrlEncodedFormEntity(formparams, "UTF-8"));
|
||||
HttpResponse response = httpclient.execute(httpPost);
|
||||
if (response.getStatusLine().getStatusCode() == 200) {
|
||||
HttpEntity entity = response.getEntity();
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(
|
||||
entity.getContent()));
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
String tempStr;
|
||||
while ((tempStr = reader.readLine()) != null)
|
||||
buffer.append(tempStr);
|
||||
return buffer.toString();
|
||||
} else {
|
||||
throw new RuntimeException("error code " + response.getStatusLine().getStatusCode()
|
||||
+ ":" + response.getStatusLine().getReasonPhrase());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xmlns:skywalking="http://cloud.asiainfo.com/schema/skywalking"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
|
||||
http://www.springframework.org/schema/context
|
||||
http://www.springframework.org/schema/context/spring-context-3.0.xsd
|
||||
http://cloud.asiainfo.com/schema/skywalking
|
||||
http://cloud.asiainfo.com/schema/skywalking/skywalking.xsd">
|
||||
|
||||
<skywalking:trace classExpression="*"
|
||||
packageExpression="com.ai.cloud.skywalking.example.*"/>
|
||||
|
||||
<context:component-scan base-package="com.ai.cloud.skywalking.example.account"/>
|
||||
<import resource="context/spring-mybatis.xml"/>
|
||||
<import resource="provider/provider.xml"/>
|
||||
</beans>
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
jdbc.driverClassName=com.ai.cloud.skywalking.plugin.jdbc.mysql.MySQLTracingDriver
|
||||
jdbc.url=tracing:jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8
|
||||
jdbc.username=root
|
||||
jdbc.password=root
|
||||
jdbc.maxTotal=200
|
||||
jdbc.maxIdle=50
|
||||
jdbc.maxWaitMillis=1000
|
||||
jdbc.defaultAutoCommit=true
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:tx="http://www.springframework.org/schema/tx"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
|
||||
http://www.springframework.org/schema/tx
|
||||
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
|
||||
|
||||
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
|
||||
<property name="locations">
|
||||
<list>
|
||||
<value>classpath:context/jdbc.properties</value>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- 配置数据源 -->
|
||||
<bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource">
|
||||
<property name="driverClassName" value="${jdbc.driverClassName}"/>
|
||||
<property name="url" value="${jdbc.url}"/>
|
||||
<property name="username" value="${jdbc.username}"/>
|
||||
<property name="password" value="${jdbc.password}"/>
|
||||
<property name="maxTotal" value="${jdbc.maxTotal}"/>
|
||||
<property name="maxIdle" value="${jdbc.maxIdle}"/>
|
||||
<property name="maxWaitMillis" value="${jdbc.maxWaitMillis}"/>
|
||||
<property name="defaultAutoCommit" value="${jdbc.defaultAutoCommit}"/>
|
||||
</bean>
|
||||
|
||||
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
|
||||
<property name="dataSource" ref="dataSource"/>
|
||||
<property name="mapperLocations" value="classpath*:mybatis/mapper/*.xml"/>
|
||||
</bean>
|
||||
|
||||
<!-- 配置SqlSessionTemplate -->
|
||||
<bean id="sqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
|
||||
<constructor-arg name="sqlSessionFactory" ref="sqlSessionFactory"/>
|
||||
</bean>
|
||||
|
||||
<!-- 事务配置 -->
|
||||
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
|
||||
<property name="dataSource" ref="dataSource"/>
|
||||
</bean>
|
||||
|
||||
<!-- 使用annotation注解方式配置事务 -->
|
||||
<tx:annotation-driven transaction-manager="transactionManager"/>
|
||||
|
||||
<!--AOP 事务配置-->
|
||||
<tx:advice id="txAdvice" transaction-manager="transactionManager">
|
||||
<tx:attributes>
|
||||
<tx:method name="*"/>
|
||||
</tx:attributes>
|
||||
</tx:advice>
|
||||
|
||||
</beans>
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
log4j.rootLogger=INFO, A1
|
||||
#log4j.appender.A1=org.apache.log4j.FileAppender
|
||||
#log4j.appender.A1.File=${catalina.base}/logs/mvno_crm_all.log
|
||||
#log4j.appender.A1.layout=org.apache.log4j.PatternLayout
|
||||
#log4j.appender.A1.layout.ConversionPattern=%-d{yyyy-MM-dd HH:mm:ss.SSS} %c %n[%p] %n%m%n
|
||||
|
||||
log4j.appender.A1=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.A1.layout=com.ai.cloud.skywalking.plugin.log.log4j.v1.x.TraceIdPatternLayout
|
||||
log4j.appender.A1.layout.ConversionPattern=[%x] %-d{yyyy-MM-dd HH:mm:ss.SSS} %c %n[%p] %n%m%n
|
||||
|
||||
log4j.logger.com.ailk=DEBUG
|
||||
log4j.logger.org.springframework=DEBUG
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Configuration status="debug">
|
||||
<Appenders>
|
||||
<Console name="Console" target="SYSTEM_OUT">
|
||||
<PatternLayout pattern="[%tid] %d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
|
||||
</Console>
|
||||
</Appenders>
|
||||
<Loggers>
|
||||
<Root level="debug">
|
||||
<AppenderRef ref="Console"/>
|
||||
</Root>
|
||||
</Loggers>
|
||||
</Configuration>
|
||||
|
|
@ -1,181 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.ai.cloud.skywalking.example.account.dao.mapper.interfaces.TAccountMapper" >
|
||||
<resultMap id="BaseResultMap" type="com.ai.cloud.skywalking.example.account.dao.mapper.bo.TAccount" >
|
||||
<id column="ACCOUNT_ID" property="accountId" jdbcType="INTEGER" />
|
||||
<result column="PHONE_NUMBER" property="phoneNumber" jdbcType="VARCHAR" />
|
||||
<result column="MAIL" property="mail" jdbcType="VARCHAR" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause" >
|
||||
<where >
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or" >
|
||||
<if test="criteria.valid" >
|
||||
<trim prefix="(" suffix=")" prefixOverrides="and" >
|
||||
<foreach collection="criteria.criteria" item="criterion" >
|
||||
<choose >
|
||||
<when test="criterion.noValue" >
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue" >
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue" >
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue" >
|
||||
and ${criterion.condition}
|
||||
<foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Update_By_Example_Where_Clause" >
|
||||
<where >
|
||||
<foreach collection="example.oredCriteria" item="criteria" separator="or" >
|
||||
<if test="criteria.valid" >
|
||||
<trim prefix="(" suffix=")" prefixOverrides="and" >
|
||||
<foreach collection="criteria.criteria" item="criterion" >
|
||||
<choose >
|
||||
<when test="criterion.noValue" >
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue" >
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue" >
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue" >
|
||||
and ${criterion.condition}
|
||||
<foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List" >
|
||||
ACCOUNT_ID, PHONE_NUMBER, MAIL
|
||||
</sql>
|
||||
<select id="selectByExample" resultMap="BaseResultMap" parameterType="com.ai.cloud.skywalking.example.account.dao.mapper.bo.TAccountCriteria" >
|
||||
select
|
||||
<if test="distinct" >
|
||||
distinct
|
||||
</if>
|
||||
'true' as QUERYID,
|
||||
<include refid="Base_Column_List" />
|
||||
from t_account
|
||||
<if test="_parameter != null" >
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null" >
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
<if test="limitStart != null and limitStart>=0" >
|
||||
limit #{limitStart} , #{limitEnd}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="int" >
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from t_account
|
||||
where ACCOUNT_ID = #{accountId,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="int" >
|
||||
delete from t_account
|
||||
where ACCOUNT_ID = #{accountId,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.ai.cloud.skywalking.example.account.dao.mapper.bo.TAccountCriteria" >
|
||||
delete from t_account
|
||||
<if test="_parameter != null" >
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.ai.cloud.skywalking.example.account.dao.mapper.bo.TAccount" >
|
||||
insert into t_account (ACCOUNT_ID, PHONE_NUMBER, MAIL
|
||||
)
|
||||
values (#{accountId,jdbcType=INTEGER}, #{phoneNumber,jdbcType=VARCHAR}, #{mail,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.ai.cloud.skywalking.example.account.dao.mapper.bo.TAccount" >
|
||||
insert into t_account
|
||||
<trim prefix="(" suffix=")" suffixOverrides="," >
|
||||
ACCOUNT_ID,
|
||||
<if test="phoneNumber != null" >
|
||||
PHONE_NUMBER,
|
||||
</if>
|
||||
<if test="mail != null" >
|
||||
MAIL,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
||||
#{accountId,jdbcType=INTEGER},
|
||||
<if test="phoneNumber != null" >
|
||||
#{phoneNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="mail != null" >
|
||||
#{mail,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.ai.cloud.skywalking.example.account.dao.mapper.bo.TAccountCriteria" resultType="java.lang.Integer" >
|
||||
select count(*) from t_account
|
||||
<if test="_parameter != null" >
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map" >
|
||||
update t_account
|
||||
<set >
|
||||
<if test="record.accountId != null" >
|
||||
ACCOUNT_ID = #{record.accountId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.phoneNumber != null" >
|
||||
PHONE_NUMBER = #{record.phoneNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.mail != null" >
|
||||
MAIL = #{record.mail,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null" >
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExample" parameterType="map" >
|
||||
update t_account
|
||||
set ACCOUNT_ID = #{record.accountId,jdbcType=INTEGER},
|
||||
PHONE_NUMBER = #{record.phoneNumber,jdbcType=VARCHAR},
|
||||
MAIL = #{record.mail,jdbcType=VARCHAR}
|
||||
<if test="_parameter != null" >
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.ai.cloud.skywalking.example.account.dao.mapper.bo.TAccount" >
|
||||
update t_account
|
||||
<set >
|
||||
<if test="phoneNumber != null" >
|
||||
PHONE_NUMBER = #{phoneNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="mail != null" >
|
||||
MAIL = #{mail,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where ACCOUNT_ID = #{accountId,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.ai.cloud.skywalking.example.account.dao.mapper.bo.TAccount" >
|
||||
update t_account
|
||||
set PHONE_NUMBER = #{phoneNumber,jdbcType=VARCHAR},
|
||||
MAIL = #{mail,jdbcType=VARCHAR}
|
||||
where ACCOUNT_ID = #{accountId,jdbcType=INTEGER}
|
||||
</update>
|
||||
</mapper>
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
CREATE TABLE test.T_ACCOUNT
|
||||
(
|
||||
ACCOUNT_ID int PRIMARY KEY NOT NULL AUTO_INCREMENT,
|
||||
PHONE_NUMBER varchar(11) NOT NULL,
|
||||
MAIL varchar(60) NOT NULL
|
||||
);
|
||||
CREATE UNIQUE INDEX T_ACCOUNT_ACCOUNT_ID_uindex ON test.T_ACCOUNT (ACCOUNT_ID);
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
|
||||
http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
|
||||
|
||||
<dubbo:application name="skywalking-example-account-provider"/>
|
||||
<dubbo:registry address="zookeeper://127.0.0.1:2181"/>
|
||||
<dubbo:provider timeout="5000000" filter="swEnhanceFilter"/>
|
||||
<dubbo:consumer timeout="5000000" filter="swEnhanceFilter"/>
|
||||
<dubbo:protocol name="rest" port="20880" server="tomcat"/>
|
||||
<dubbo:annotation package="com.ai.cloud.skywalking.example.account.dubbo"/>
|
||||
</beans>
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
#test
|
||||
#Mon Dec 28 11:28:47 CST 2015
|
||||
buriedpoint.businesskey_max_length=300
|
||||
sender.retry_get_sender_wait_interval=2000
|
||||
buffer.pool_size=5
|
||||
senderchecker.check_polling_time=200
|
||||
|
||||
sender.max_send_length=20000
|
||||
consumer.max_consumer=2
|
||||
consumer.max_wait_time=5
|
||||
sender.max_copy_num=2
|
||||
skywalking.application_code=account-application
|
||||
consumer.consumer_fail_retry_wait_interval=50
|
||||
skywalking.user_id=6
|
||||
buriedpoint.printf=false
|
||||
buriedpoint.exclusive_exceptions=
|
||||
buriedpoint.max_exception_stack_length=4000
|
||||
sender.connect_percent=100
|
||||
buffer.buffer_max_size=18000
|
||||
sender.servers_addr=10.1.235.197:34000;10.1.235.197:35000;
|
||||
skywalking.sdk_version=1.0a2
|
||||
|
|
@ -1,86 +0,0 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-example-account-interfaces</artifactId>
|
||||
<version>1.0-Final</version>
|
||||
|
||||
<name>skywalking-example-account-interfaces</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>Company</id>
|
||||
<url>http://10.1.228.199:18081/nexus/content/groups/public/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jboss.resteasy</groupId>
|
||||
<artifactId>resteasy-jaxrs</artifactId>
|
||||
<version>3.0.7.Final</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jboss.resteasy</groupId>
|
||||
<artifactId>resteasy-client</artifactId>
|
||||
<version>3.0.7.Final</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.validation</groupId>
|
||||
<artifactId>validation-api</artifactId>
|
||||
<version>1.0.0.GA</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jboss.resteasy</groupId>
|
||||
<artifactId>resteasy-jackson-provider</artifactId>
|
||||
<version>3.0.7.Final</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.tomcat.embed</groupId>
|
||||
<artifactId>tomcat-embed-core</artifactId>
|
||||
<version>8.0.11</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.tomcat.embed</groupId>
|
||||
<artifactId>tomcat-embed-logging-juli</artifactId>
|
||||
<version>8.0.11</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.ws.rs</groupId>
|
||||
<artifactId>javax.ws.rs-api</artifactId>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>1.6</source>
|
||||
<target>1.6</target>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>2.4.3</version>
|
||||
<configuration>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
package com.ai.cloud.skywalking.example.account.dubbo.interfaces;
|
||||
|
||||
import com.ai.cloud.skywalking.example.account.dubbo.interfaces.param.AccountInfo;
|
||||
|
||||
import javax.ws.rs.Consumes;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
|
||||
|
||||
@Path("/accountMaintain")
|
||||
@Consumes({MediaType.APPLICATION_JSON})
|
||||
@Produces({MediaType.APPLICATION_JSON, MediaType.TEXT_XML})
|
||||
public interface IAccountMaintain {
|
||||
|
||||
@Path("/create")
|
||||
@POST
|
||||
String create(AccountInfo accountInfo);
|
||||
}
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
package com.ai.cloud.skywalking.example.account.dubbo.interfaces.param;
|
||||
|
||||
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import java.io.Serializable;
|
||||
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class AccountInfo implements Serializable {
|
||||
|
||||
@XmlElement(name = "phoneNumber")
|
||||
public String phoneNumber;
|
||||
@XmlElement(name = "mail")
|
||||
public String mail;
|
||||
|
||||
public String getPhoneNumber() {
|
||||
return phoneNumber;
|
||||
}
|
||||
|
||||
public void setPhoneNumber(String phoneNumber) {
|
||||
this.phoneNumber = phoneNumber;
|
||||
}
|
||||
|
||||
public String getMail() {
|
||||
return mail;
|
||||
}
|
||||
|
||||
public void setMail(String mail) {
|
||||
this.mail = mail;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-example-account</artifactId>
|
||||
<version>1.0-Final</version>
|
||||
|
||||
<name>skywalking-example-account</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
|
||||
<modules>
|
||||
<module>account-impl</module>
|
||||
<module>account-interfaces</module>
|
||||
</modules>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>1.6</source>
|
||||
<target>1.6</target>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>2.4.3</version>
|
||||
<configuration>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
@ -1,101 +0,0 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-example-mail</artifactId>
|
||||
<version>1.0-Final</version>
|
||||
|
||||
<name>skywalking-example-mail</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
<packaging>war</packaging>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>3.1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jstl</groupId>
|
||||
<artifactId>jstl</artifactId>
|
||||
<version>1.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sun.mail</groupId>
|
||||
<artifactId>javax.mail</artifactId>
|
||||
<version>1.5.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet.jsp</groupId>
|
||||
<artifactId>javax.servlet.jsp-api</artifactId>
|
||||
<version>2.3.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-web-plugin</artifactId>
|
||||
<version>1.0-Final</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-web</artifactId>
|
||||
<version>4.2.2.RELEASE</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-webmvc</artifactId>
|
||||
<version>4.2.2.RELEASE</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-spring-plugin</artifactId>
|
||||
<version>1.0-Final</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-api</artifactId>
|
||||
<version>2.4.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.aspectj</groupId>
|
||||
<artifactId>aspectjweaver</artifactId>
|
||||
<version>1.8.7</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-log4j-1.x-plugin</artifactId>
|
||||
<version>1.0-Final</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>1.6</source>
|
||||
<target>1.6</target>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>2.4.3</version>
|
||||
<configuration>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
package com.ai.cloud.skywalking.example.mail.controller;
|
||||
|
||||
import com.ai.cloud.skywalking.example.mail.util.SendeUtil;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/mail")
|
||||
public class MaillController {
|
||||
|
||||
private Logger logger = LogManager.getLogger(MaillController.class);
|
||||
|
||||
@RequestMapping("/send")
|
||||
protected void sendMail(HttpServletRequest req, HttpServletResponse response) {
|
||||
String recipientAccount = req.getParameter("recipientAccount");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
response.setContentType("application/json; charset=utf-8");
|
||||
OutputStream outputStream = null;
|
||||
try {
|
||||
outputStream = response.getOutputStream();
|
||||
if (recipientAccount == null || recipientAccount.length() <= 0) {
|
||||
outputStream.write("{\"errorCode\":\"99999\",\"message\":\"Recipient Account can not be null\"}".getBytes());
|
||||
outputStream.flush();
|
||||
return;
|
||||
}
|
||||
boolean result = SendeUtil.sendeMail(recipientAccount);
|
||||
if (result) {
|
||||
outputStream.write("{\"errorCode\":\"000000\",\"message\":\"Send mail success\"}".getBytes());
|
||||
} else {
|
||||
outputStream.write("{\"errorCode\":\"99999\",\"message\":\"Send mail failed\"}".getBytes());
|
||||
}
|
||||
outputStream.flush();
|
||||
} catch (Exception e) {
|
||||
logger.error("Send mail failed", e);
|
||||
} finally {
|
||||
if (outputStream != null) {
|
||||
try {
|
||||
outputStream.close();
|
||||
} catch (IOException e) {
|
||||
logger.error("Failed to close output stream", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
package com.ai.cloud.skywalking.example.mail.util;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.mail.Message;
|
||||
import javax.mail.MessagingException;
|
||||
import javax.mail.Session;
|
||||
import javax.mail.Transport;
|
||||
import javax.mail.internet.InternetAddress;
|
||||
import javax.mail.internet.MimeMessage;
|
||||
|
||||
public class SendeUtil {
|
||||
|
||||
public static boolean sendeMail(String recipientAccount) {
|
||||
try {
|
||||
Properties prop = new Properties();
|
||||
prop.load(SendeUtil.class.getResourceAsStream("/mail/mail.config"));
|
||||
Session session = Session.getInstance(prop);
|
||||
session.setDebug(true);
|
||||
Transport ts = session.getTransport();
|
||||
ts.connect(prop.getProperty("mail.host"), prop.getProperty("mail.username"), prop.getProperty("mail.password"));
|
||||
Message message = createSimpleMail(session, prop.getProperty("mail.username") +
|
||||
prop.getProperty("mail.account.prefix"), recipientAccount);
|
||||
ts.sendMessage(message, message.getAllRecipients());
|
||||
ts.close();
|
||||
return true;
|
||||
} catch (MessagingException e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private static MimeMessage createSimpleMail(Session session, String senderAccount, String recipientAccount) throws MessagingException {
|
||||
//创建邮件对象
|
||||
MimeMessage message = new MimeMessage(session);
|
||||
//指明邮件的发件人
|
||||
message.setFrom(new InternetAddress(senderAccount));
|
||||
//指明邮件的收件人,现在发件人和收件人是一样的,那就是自己给自己发
|
||||
message.setRecipient(Message.RecipientType.TO, new InternetAddress(recipientAccount));
|
||||
//邮件的标题
|
||||
message.setSubject("注册成功");
|
||||
//邮件的文本内容
|
||||
message.setContent("你好啊!", "text/html;charset=UTF-8");
|
||||
//返回创建好的邮件对象
|
||||
return message;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xmlns:mvc="http://www.springframework.org/schema/mvc"
|
||||
xmlns:skywalking="http://cloud.asiainfo.com/schema/skywalking"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
|
||||
http://www.springframework.org/schema/context
|
||||
http://www.springframework.org/schema/context/spring-context-3.0.xsd
|
||||
http://www.springframework.org/schema/mvc
|
||||
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
|
||||
http://cloud.asiainfo.com/schema/skywalking
|
||||
http://cloud.asiainfo.com/schema/skywalking/skywalking.xsd">
|
||||
|
||||
<!-- 默认的注解映射的支持 -->
|
||||
<mvc:annotation-driven/>
|
||||
|
||||
<!-- 设置使用注解的类所在的jar包 ,当使用 <context:component-scan/> 后,就可以将 <context:annotation-config/>
|
||||
移除了 -->
|
||||
<context:component-scan base-package="com.ai.cloud.skywalking.example.mail.controller"/>
|
||||
|
||||
|
||||
<!-- 完成请求和注解POJO的映射 -->
|
||||
<!--<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"/>-->
|
||||
|
||||
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
|
||||
<property name="prefix" value="/jsp/"/>
|
||||
<property name="suffix" value=".jsp"/>
|
||||
<property name="viewClass"
|
||||
value="org.springframework.web.servlet.view.JstlView"/>
|
||||
</bean>
|
||||
<!-- 对静态资源文件的访问 -->
|
||||
<mvc:default-servlet-handler/>
|
||||
<skywalking:trace classExpression="*" packageExpression="com.ai.cloud.skywalking.example.*"/>
|
||||
</beans>
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
log4j.rootLogger=DEBUG, A1
|
||||
#log4j.appender.A1=org.apache.log4j.FileAppender
|
||||
#log4j.appender.A1.File=${catalina.base}/logs/mvno_crm_all.log
|
||||
#log4j.appender.A1.layout=org.apache.log4j.PatternLayout
|
||||
#log4j.appender.A1.layout.ConversionPattern=%-d{yyyy-MM-dd HH:mm:ss.SSS} %c %n[%p] %n%m%n
|
||||
|
||||
log4j.appender.A1=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.A1.layout=com.ai.cloud.skywalking.plugin.log.log4j.v1.x.TraceIdPatternLayout
|
||||
log4j.appender.A1.layout.ConversionPattern=%x %-d{yyyy-MM-dd HH:mm:ss.SSS} %c %n[%p] %n%m%n
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
mail.host=mail.asiainfo.com
|
||||
mail.transport.protocol=smtp
|
||||
mail.smtp.auth=true
|
||||
mail.username=zhangxin10
|
||||
mail.password=********
|
||||
mail.account.prefix=@asiainfo.com
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
#test
|
||||
#Mon Dec 28 11:29:34 CST 2015
|
||||
buriedpoint.businesskey_max_length=300
|
||||
sender.retry_get_sender_wait_interval=2000
|
||||
buffer.pool_size=5
|
||||
senderchecker.check_polling_time=200
|
||||
|
||||
sender.max_send_length=20000
|
||||
consumer.max_consumer=2
|
||||
consumer.max_wait_time=5
|
||||
sender.max_copy_num=2
|
||||
skywalking.application_code=mail-application
|
||||
consumer.consumer_fail_retry_wait_interval=50
|
||||
skywalking.user_id=6
|
||||
buriedpoint.printf=false
|
||||
buriedpoint.exclusive_exceptions=
|
||||
buriedpoint.max_exception_stack_length=4000
|
||||
sender.connect_percent=100
|
||||
buffer.buffer_max_size=18000
|
||||
sender.servers_addr=10.1.235.197:34000;10.1.235.197:35000;
|
||||
skywalking.sdk_version=1.0a2
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://java.sun.com/xml/ns/javaee"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
|
||||
id="WebApp_ID" version="2.5">
|
||||
<display-name>skywalking-example-mail-application</display-name>
|
||||
<filter>
|
||||
<filter-name>tracingFilter</filter-name>
|
||||
<filter-class>com.ai.cloud.skywalking.plugin.web.SkyWalkingFilter</filter-class>
|
||||
</filter>
|
||||
<filter-mapping>
|
||||
<filter-name>tracingFilter</filter-name>
|
||||
<url-pattern>/mail/send</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<filter>
|
||||
<filter-name>encoding</filter-name>
|
||||
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
|
||||
<init-param>
|
||||
<param-name>encoding</param-name>
|
||||
<param-value>UTF-8</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>forceEncoding</param-name>
|
||||
<param-value>true</param-value>
|
||||
</init-param>
|
||||
</filter>
|
||||
<filter-mapping>
|
||||
<filter-name>encoding</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>springmvc</servlet-name>
|
||||
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
|
||||
<init-param>
|
||||
<param-name>contextConfigLocation</param-name>
|
||||
<param-value>
|
||||
classpath*:applicationcontext.xml
|
||||
</param-value>
|
||||
</init-param>
|
||||
<load-on-startup>1</load-on-startup>
|
||||
</servlet>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>springmvc</servlet-name>
|
||||
<url-pattern>/</url-pattern>
|
||||
</servlet-mapping>
|
||||
</web-app>
|
||||
|
|
@ -1,181 +0,0 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-example-order-impl</artifactId>
|
||||
<version>1.0-Final</version>
|
||||
|
||||
<name>skywalking-example-order-impl</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>Company</id>
|
||||
<url>http://10.1.228.199:18081/nexus/content/groups/public/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo</artifactId>
|
||||
<version>2.8.4</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-beans</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-core</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-aop</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-expression</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.101tec</groupId>
|
||||
<artifactId>zkclient</artifactId>
|
||||
<version>0.7</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.javassist</groupId>
|
||||
<artifactId>javassist</artifactId>
|
||||
<version>3.20.0-GA</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
<version>4.2.2.RELEASE</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-jdbc</artifactId>
|
||||
<version>4.1.5.RELEASE</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-tx</artifactId>
|
||||
<version>4.1.5.RELEASE</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-dbcp2</artifactId>
|
||||
<version>2.1</version>
|
||||
</dependency>
|
||||
<!-- save order dubbo interfaces -->
|
||||
<dependency>
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-example-order-interfaces</artifactId>
|
||||
<version>1.0-Final</version>
|
||||
</dependency>
|
||||
<!-- resource dubbo interfaces -->
|
||||
<dependency>
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-example-resource-interfaces</artifactId>
|
||||
<version>1.0-Final</version>
|
||||
</dependency>
|
||||
<!-- mybatis -->
|
||||
<dependency>
|
||||
<groupId>org.mybatis</groupId>
|
||||
<artifactId>mybatis</artifactId>
|
||||
<version>3.3.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mybatis</groupId>
|
||||
<artifactId>mybatis-spring</artifactId>
|
||||
<version>1.2.2</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-jdbc</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
<version>2.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-spring-plugin</artifactId>
|
||||
<version>1.0-Final</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-dubbo-plugin</artifactId>
|
||||
<version>1.0-Final</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>5.1.37</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-example-account-interfaces</artifactId>
|
||||
<version>1.0-Final</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-jdbc-plugin</artifactId>
|
||||
<version>1.0-Final</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.aspectj</groupId>
|
||||
<artifactId>aspectjweaver</artifactId>
|
||||
<version>1.8.7</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-log4j-1.x-plugin</artifactId>
|
||||
<version>1.0-Final</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>1.6</source>
|
||||
<target>1.6</target>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>2.4.3</version>
|
||||
<configuration>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
package com.ai.cloud.skywalking.example.order.dao.mapper.bo;
|
||||
|
||||
public class TOrder {
|
||||
private String orderId;
|
||||
|
||||
private int resourceId;
|
||||
|
||||
private String phoneNumber;
|
||||
|
||||
private int packageId;
|
||||
|
||||
private String mailAccount;
|
||||
|
||||
public String getOrderId() {
|
||||
return orderId;
|
||||
}
|
||||
|
||||
public void setOrderId(String orderId) {
|
||||
this.orderId = orderId == null ? null : orderId.trim();
|
||||
}
|
||||
|
||||
public int getResourceId() {
|
||||
return resourceId;
|
||||
}
|
||||
|
||||
public void setResourceId(int resourceId) {
|
||||
this.resourceId = resourceId;
|
||||
}
|
||||
|
||||
public String getPhoneNumber() {
|
||||
return phoneNumber;
|
||||
}
|
||||
|
||||
public void setPhoneNumber(String phoneNumber) {
|
||||
this.phoneNumber = phoneNumber == null ? null : phoneNumber.trim();
|
||||
}
|
||||
|
||||
public int getPackageId() {
|
||||
return packageId;
|
||||
}
|
||||
|
||||
public void setPackageId(int packageId) {
|
||||
this.packageId = packageId;
|
||||
}
|
||||
|
||||
public String getMailAccount() {
|
||||
return mailAccount;
|
||||
}
|
||||
|
||||
public void setMailAccount(String mailAccount) {
|
||||
this.mailAccount = mailAccount == null ? null : mailAccount.trim();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,550 +0,0 @@
|
|||
package com.ai.cloud.skywalking.example.order.dao.mapper.bo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class TOrderCriteria {
|
||||
protected String orderByClause;
|
||||
|
||||
protected boolean distinct;
|
||||
|
||||
protected List<Criteria> oredCriteria;
|
||||
|
||||
protected Integer limitStart;
|
||||
|
||||
protected Integer limitEnd;
|
||||
|
||||
public TOrderCriteria() {
|
||||
oredCriteria = new ArrayList<Criteria>();
|
||||
}
|
||||
|
||||
public void setOrderByClause(String orderByClause) {
|
||||
this.orderByClause = orderByClause;
|
||||
}
|
||||
|
||||
public String getOrderByClause() {
|
||||
return orderByClause;
|
||||
}
|
||||
|
||||
public void setDistinct(boolean distinct) {
|
||||
this.distinct = distinct;
|
||||
}
|
||||
|
||||
public boolean isDistinct() {
|
||||
return distinct;
|
||||
}
|
||||
|
||||
public List<Criteria> getOredCriteria() {
|
||||
return oredCriteria;
|
||||
}
|
||||
|
||||
public void or(Criteria criteria) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
|
||||
public Criteria or() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
oredCriteria.add(criteria);
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public Criteria createCriteria() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
if (oredCriteria.size() == 0) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
return criteria;
|
||||
}
|
||||
|
||||
protected Criteria createCriteriaInternal() {
|
||||
Criteria criteria = new Criteria();
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
oredCriteria.clear();
|
||||
orderByClause = null;
|
||||
distinct = false;
|
||||
}
|
||||
|
||||
public void setLimitStart(Integer limitStart) {
|
||||
this.limitStart=limitStart;
|
||||
}
|
||||
|
||||
public Integer getLimitStart() {
|
||||
return limitStart;
|
||||
}
|
||||
|
||||
public void setLimitEnd(Integer limitEnd) {
|
||||
this.limitEnd=limitEnd;
|
||||
}
|
||||
|
||||
public Integer getLimitEnd() {
|
||||
return limitEnd;
|
||||
}
|
||||
|
||||
protected abstract static class GeneratedCriteria {
|
||||
protected List<Criterion> criteria;
|
||||
|
||||
protected GeneratedCriteria() {
|
||||
super();
|
||||
criteria = new ArrayList<Criterion>();
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
return criteria.size() > 0;
|
||||
}
|
||||
|
||||
public List<Criterion> getAllCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public List<Criterion> getCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition) {
|
||||
if (condition == null) {
|
||||
throw new RuntimeException("Value for condition cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value, String property) {
|
||||
if (value == null) {
|
||||
throw new RuntimeException("Value for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value1, Object value2, String property) {
|
||||
if (value1 == null || value2 == null) {
|
||||
throw new RuntimeException("Between values for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value1, value2));
|
||||
}
|
||||
|
||||
public Criteria andOrderIdIsNull() {
|
||||
addCriterion("ORDER_ID is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOrderIdIsNotNull() {
|
||||
addCriterion("ORDER_ID is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOrderIdEqualTo(String value) {
|
||||
addCriterion("ORDER_ID =", value, "orderId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOrderIdNotEqualTo(String value) {
|
||||
addCriterion("ORDER_ID <>", value, "orderId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOrderIdGreaterThan(String value) {
|
||||
addCriterion("ORDER_ID >", value, "orderId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOrderIdGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("ORDER_ID >=", value, "orderId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOrderIdLessThan(String value) {
|
||||
addCriterion("ORDER_ID <", value, "orderId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOrderIdLessThanOrEqualTo(String value) {
|
||||
addCriterion("ORDER_ID <=", value, "orderId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOrderIdLike(String value) {
|
||||
addCriterion("ORDER_ID like", value, "orderId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOrderIdNotLike(String value) {
|
||||
addCriterion("ORDER_ID not like", value, "orderId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOrderIdIn(List<String> values) {
|
||||
addCriterion("ORDER_ID in", values, "orderId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOrderIdNotIn(List<String> values) {
|
||||
addCriterion("ORDER_ID not in", values, "orderId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOrderIdBetween(String value1, String value2) {
|
||||
addCriterion("ORDER_ID between", value1, value2, "orderId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andOrderIdNotBetween(String value1, String value2) {
|
||||
addCriterion("ORDER_ID not between", value1, value2, "orderId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andResourceIdIsNull() {
|
||||
addCriterion("RESOURCE_ID is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andResourceIdIsNotNull() {
|
||||
addCriterion("RESOURCE_ID is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andResourceIdEqualTo(int value) {
|
||||
addCriterion("RESOURCE_ID =", value, "resourceId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andResourceIdNotEqualTo(int value) {
|
||||
addCriterion("RESOURCE_ID <>", value, "resourceId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andResourceIdGreaterThan(int value) {
|
||||
addCriterion("RESOURCE_ID >", value, "resourceId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andResourceIdGreaterThanOrEqualTo(int value) {
|
||||
addCriterion("RESOURCE_ID >=", value, "resourceId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andResourceIdLessThan(int value) {
|
||||
addCriterion("RESOURCE_ID <", value, "resourceId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andResourceIdLessThanOrEqualTo(int value) {
|
||||
addCriterion("RESOURCE_ID <=", value, "resourceId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andResourceIdIn(List<Integer> values) {
|
||||
addCriterion("RESOURCE_ID in", values, "resourceId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andResourceIdNotIn(List<Integer> values) {
|
||||
addCriterion("RESOURCE_ID not in", values, "resourceId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andResourceIdBetween(int value1, int value2) {
|
||||
addCriterion("RESOURCE_ID between", value1, value2, "resourceId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andResourceIdNotBetween(int value1, int value2) {
|
||||
addCriterion("RESOURCE_ID not between", value1, value2, "resourceId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPhoneNumberIsNull() {
|
||||
addCriterion("PHONE_NUMBER is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPhoneNumberIsNotNull() {
|
||||
addCriterion("PHONE_NUMBER is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPhoneNumberEqualTo(String value) {
|
||||
addCriterion("PHONE_NUMBER =", value, "phoneNumber");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPhoneNumberNotEqualTo(String value) {
|
||||
addCriterion("PHONE_NUMBER <>", value, "phoneNumber");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPhoneNumberGreaterThan(String value) {
|
||||
addCriterion("PHONE_NUMBER >", value, "phoneNumber");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPhoneNumberGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("PHONE_NUMBER >=", value, "phoneNumber");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPhoneNumberLessThan(String value) {
|
||||
addCriterion("PHONE_NUMBER <", value, "phoneNumber");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPhoneNumberLessThanOrEqualTo(String value) {
|
||||
addCriterion("PHONE_NUMBER <=", value, "phoneNumber");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPhoneNumberLike(String value) {
|
||||
addCriterion("PHONE_NUMBER like", value, "phoneNumber");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPhoneNumberNotLike(String value) {
|
||||
addCriterion("PHONE_NUMBER not like", value, "phoneNumber");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPhoneNumberIn(List<String> values) {
|
||||
addCriterion("PHONE_NUMBER in", values, "phoneNumber");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPhoneNumberNotIn(List<String> values) {
|
||||
addCriterion("PHONE_NUMBER not in", values, "phoneNumber");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPhoneNumberBetween(String value1, String value2) {
|
||||
addCriterion("PHONE_NUMBER between", value1, value2, "phoneNumber");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPhoneNumberNotBetween(String value1, String value2) {
|
||||
addCriterion("PHONE_NUMBER not between", value1, value2, "phoneNumber");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPackageIdIsNull() {
|
||||
addCriterion("PACKAGE_ID is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPackageIdIsNotNull() {
|
||||
addCriterion("PACKAGE_ID is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPackageIdEqualTo(int value) {
|
||||
addCriterion("PACKAGE_ID =", value, "packageId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPackageIdNotEqualTo(int value) {
|
||||
addCriterion("PACKAGE_ID <>", value, "packageId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPackageIdGreaterThan(int value) {
|
||||
addCriterion("PACKAGE_ID >", value, "packageId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPackageIdGreaterThanOrEqualTo(int value) {
|
||||
addCriterion("PACKAGE_ID >=", value, "packageId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPackageIdLessThan(int value) {
|
||||
addCriterion("PACKAGE_ID <", value, "packageId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPackageIdLessThanOrEqualTo(int value) {
|
||||
addCriterion("PACKAGE_ID <=", value, "packageId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPackageIdIn(List<Integer> values) {
|
||||
addCriterion("PACKAGE_ID in", values, "packageId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPackageIdNotIn(List<Integer> values) {
|
||||
addCriterion("PACKAGE_ID not in", values, "packageId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPackageIdBetween(int value1, int value2) {
|
||||
addCriterion("PACKAGE_ID between", value1, value2, "packageId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPackageIdNotBetween(int value1, int value2) {
|
||||
addCriterion("PACKAGE_ID not between", value1, value2, "packageId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMailAccountIsNull() {
|
||||
addCriterion("MAIL_ACCOUNT is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMailAccountIsNotNull() {
|
||||
addCriterion("MAIL_ACCOUNT is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMailAccountEqualTo(String value) {
|
||||
addCriterion("MAIL_ACCOUNT =", value, "mailAccount");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMailAccountNotEqualTo(String value) {
|
||||
addCriterion("MAIL_ACCOUNT <>", value, "mailAccount");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMailAccountGreaterThan(String value) {
|
||||
addCriterion("MAIL_ACCOUNT >", value, "mailAccount");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMailAccountGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("MAIL_ACCOUNT >=", value, "mailAccount");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMailAccountLessThan(String value) {
|
||||
addCriterion("MAIL_ACCOUNT <", value, "mailAccount");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMailAccountLessThanOrEqualTo(String value) {
|
||||
addCriterion("MAIL_ACCOUNT <=", value, "mailAccount");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMailAccountLike(String value) {
|
||||
addCriterion("MAIL_ACCOUNT like", value, "mailAccount");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMailAccountNotLike(String value) {
|
||||
addCriterion("MAIL_ACCOUNT not like", value, "mailAccount");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMailAccountIn(List<String> values) {
|
||||
addCriterion("MAIL_ACCOUNT in", values, "mailAccount");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMailAccountNotIn(List<String> values) {
|
||||
addCriterion("MAIL_ACCOUNT not in", values, "mailAccount");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMailAccountBetween(String value1, String value2) {
|
||||
addCriterion("MAIL_ACCOUNT between", value1, value2, "mailAccount");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andMailAccountNotBetween(String value1, String value2) {
|
||||
addCriterion("MAIL_ACCOUNT not between", value1, value2, "mailAccount");
|
||||
return (Criteria) this;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Criteria extends GeneratedCriteria {
|
||||
|
||||
protected Criteria() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
public static class Criterion {
|
||||
private String condition;
|
||||
|
||||
private Object value;
|
||||
|
||||
private Object secondValue;
|
||||
|
||||
private boolean noValue;
|
||||
|
||||
private boolean singleValue;
|
||||
|
||||
private boolean betweenValue;
|
||||
|
||||
private boolean listValue;
|
||||
|
||||
private String typeHandler;
|
||||
|
||||
public String getCondition() {
|
||||
return condition;
|
||||
}
|
||||
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public Object getSecondValue() {
|
||||
return secondValue;
|
||||
}
|
||||
|
||||
public boolean isNoValue() {
|
||||
return noValue;
|
||||
}
|
||||
|
||||
public boolean isSingleValue() {
|
||||
return singleValue;
|
||||
}
|
||||
|
||||
public boolean isBetweenValue() {
|
||||
return betweenValue;
|
||||
}
|
||||
|
||||
public boolean isListValue() {
|
||||
return listValue;
|
||||
}
|
||||
|
||||
public String getTypeHandler() {
|
||||
return typeHandler;
|
||||
}
|
||||
|
||||
protected Criterion(String condition) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.typeHandler = null;
|
||||
this.noValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.typeHandler = typeHandler;
|
||||
if (value instanceof List<?>) {
|
||||
this.listValue = true;
|
||||
} else {
|
||||
this.singleValue = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value) {
|
||||
this(condition, value, null);
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.secondValue = secondValue;
|
||||
this.typeHandler = typeHandler;
|
||||
this.betweenValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue) {
|
||||
this(condition, value, secondValue, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
package com.ai.cloud.skywalking.example.order.dao.mapper.interfaces;
|
||||
|
||||
import com.ai.cloud.skywalking.example.order.dao.mapper.bo.TOrder;
|
||||
import com.ai.cloud.skywalking.example.order.dao.mapper.bo.TOrderCriteria;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface TOrderMapper {
|
||||
int countByExample(TOrderCriteria example);
|
||||
|
||||
int deleteByExample(TOrderCriteria example);
|
||||
|
||||
int deleteByPrimaryKey(String orderId);
|
||||
|
||||
int insert(TOrder record);
|
||||
|
||||
int insertSelective(TOrder record);
|
||||
|
||||
List<TOrder> selectByExample(TOrderCriteria example);
|
||||
|
||||
TOrder selectByPrimaryKey(String orderId);
|
||||
|
||||
int updateByExampleSelective(@Param("record") TOrder record, @Param("example") TOrderCriteria example);
|
||||
|
||||
int updateByExample(@Param("record") TOrder record, @Param("example") TOrderCriteria example);
|
||||
|
||||
int updateByPrimaryKeySelective(TOrder record);
|
||||
|
||||
int updateByPrimaryKey(TOrder record);
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
package com.ai.cloud.skywalking.example.order.exception;
|
||||
|
||||
public class BusinessException extends RuntimeException {
|
||||
|
||||
public BusinessException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
package com.ai.cloud.skywalking.example.order.impl;
|
||||
|
||||
import com.ai.cloud.skywalking.example.account.dubbo.interfaces.IAccountMaintain;
|
||||
import com.ai.cloud.skywalking.example.account.dubbo.interfaces.param.AccountInfo;
|
||||
import com.ai.cloud.skywalking.example.order.exception.BusinessException;
|
||||
import com.ai.cloud.skywalking.example.order.interfaces.IOrderMaintain;
|
||||
import com.ai.cloud.skywalking.example.order.interfaces.parameter.OrderInfo;
|
||||
import com.ai.cloud.skywalking.example.order.model.CommonsHttpResult;
|
||||
import com.ai.cloud.skywalking.example.order.service.IOrderManage;
|
||||
import com.ai.cloud.skywalking.example.resource.dubbo.interfaces.checker.IResourceCheck;
|
||||
import com.ai.cloud.skywalking.example.resource.dubbo.interfaces.checker.param.ResourceInfo;
|
||||
import com.alibaba.dubbo.config.annotation.Reference;
|
||||
import com.alibaba.dubbo.config.annotation.Service;
|
||||
import com.google.gson.Gson;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
@Service
|
||||
public class OrderMaintainImpl implements IOrderMaintain {
|
||||
@Reference
|
||||
private IResourceCheck iResourceCheck;
|
||||
|
||||
@Autowired
|
||||
private IOrderManage orderManage;
|
||||
|
||||
@Autowired
|
||||
private IAccountMaintain iAccountMaintain;
|
||||
|
||||
|
||||
@Override
|
||||
public String saveOrder(OrderInfo orderInfo) {
|
||||
ResourceInfo resourceInfo = new ResourceInfo();
|
||||
resourceInfo.setPhoneNumber(orderInfo.getPhoneNumber());
|
||||
resourceInfo.setResourceId(orderInfo.getResourceId());
|
||||
resourceInfo.setPhonePackage(orderInfo.getPackageId());
|
||||
boolean checkResourceResult = iResourceCheck.checkResource(resourceInfo);
|
||||
|
||||
if (checkResourceResult) {
|
||||
// 预占资源
|
||||
iResourceCheck.reservationResource(resourceInfo);
|
||||
// 创建用户
|
||||
AccountInfo accountInfo = new AccountInfo();
|
||||
accountInfo.setPhoneNumber(orderInfo.getPhoneNumber());
|
||||
accountInfo.setMail(orderInfo.getMailAccount());
|
||||
String result = iAccountMaintain.create(accountInfo);
|
||||
CommonsHttpResult commonsHttpResult = new Gson().fromJson(result, CommonsHttpResult.class);
|
||||
if ("99999".equals(commonsHttpResult)) {
|
||||
throw new RuntimeException("Create account failed");
|
||||
}
|
||||
return orderManage.saveOrder(orderInfo);
|
||||
} else {
|
||||
throw new BusinessException("请联系管理员");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
package com.ai.cloud.skywalking.example.order.model;
|
||||
|
||||
public class CommonsHttpResult {
|
||||
private String errorCode;
|
||||
private String message;
|
||||
|
||||
public String getErrorCode() {
|
||||
return errorCode;
|
||||
}
|
||||
|
||||
public void setErrorCode(String errorCode) {
|
||||
this.errorCode = errorCode;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
package com.ai.cloud.skywalking.example.order.service;
|
||||
|
||||
import com.ai.cloud.skywalking.example.order.interfaces.parameter.OrderInfo;
|
||||
|
||||
public interface IOrderManage {
|
||||
String saveOrder(OrderInfo orderInfo);
|
||||
}
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
package com.ai.cloud.skywalking.example.order.service.impl;
|
||||
|
||||
import org.mybatis.spring.SqlSessionTemplate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.ai.cloud.skywalking.example.order.dao.mapper.bo.TOrder;
|
||||
import com.ai.cloud.skywalking.example.order.dao.mapper.interfaces.TOrderMapper;
|
||||
import com.ai.cloud.skywalking.example.order.interfaces.parameter.OrderInfo;
|
||||
import com.ai.cloud.skywalking.example.order.service.IOrderManage;
|
||||
import com.ai.cloud.skywalking.example.order.util.OrderIdGenerator;
|
||||
|
||||
@Service
|
||||
@Transactional
|
||||
public class OrderManageImpl implements IOrderManage {
|
||||
|
||||
@Autowired
|
||||
private SqlSessionTemplate sqlSessionTemplate;
|
||||
|
||||
@Override
|
||||
public String saveOrder(OrderInfo orderInfo) {
|
||||
String orderId = OrderIdGenerator.generate();
|
||||
TOrderMapper iOrderMapper = sqlSessionTemplate.getMapper(TOrderMapper.class);
|
||||
TOrder tOrder = new TOrder();
|
||||
tOrder.setPhoneNumber(orderInfo.getPhoneNumber());
|
||||
tOrder.setOrderId(orderId);
|
||||
tOrder.setPackageId(Integer.valueOf(orderInfo.getPackageId()));
|
||||
tOrder.setResourceId(Integer.valueOf(orderInfo.getResourceId()));
|
||||
tOrder.setMailAccount(orderInfo.getMailAccount());
|
||||
iOrderMapper.insert(tOrder);
|
||||
return orderId;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
package com.ai.cloud.skywalking.example.order.util;
|
||||
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
|
||||
public class DubboStart {
|
||||
|
||||
|
||||
public static void main(String[] args) throws InterruptedException {
|
||||
ClassPathXmlApplicationContext context =
|
||||
new ClassPathXmlApplicationContext("classpath*:provider/dubbo-provider.xml");
|
||||
context.start();
|
||||
while (true){
|
||||
Thread.sleep(1000000000L);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
package com.ai.cloud.skywalking.example.order.util;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class OrderIdGenerator {
|
||||
public static String generate() {
|
||||
return UUID.randomUUID().toString().replaceAll("-", "");
|
||||
}
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
|
||||
http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
|
||||
<dubbo:reference id="iAccountMaintain"
|
||||
interface="com.ai.cloud.skywalking.example.account.dubbo.interfaces.IAccountMaintain"
|
||||
url="rest://127.0.0.1:20880"/>
|
||||
</beans>
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
jdbc.driverClassName=com.ai.cloud.skywalking.plugin.jdbc.mysql.MySQLTracingDriver
|
||||
jdbc.url=tracing:jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8
|
||||
jdbc.username=root
|
||||
jdbc.password=root
|
||||
jdbc.maxTotal=200
|
||||
jdbc.maxIdle=50
|
||||
jdbc.maxWaitMillis=1000
|
||||
jdbc.defaultAutoCommit=true
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:tx="http://www.springframework.org/schema/tx"
|
||||
xmlns:skywalking="http://cloud.asiainfo.com/schema/skywalking"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
|
||||
http://www.springframework.org/schema/tx
|
||||
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
|
||||
http://cloud.asiainfo.com/schema/skywalking
|
||||
http://cloud.asiainfo.com/schema/skywalking/skywalking.xsd">
|
||||
|
||||
|
||||
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
|
||||
<property name="locations">
|
||||
<list>
|
||||
<value>classpath:context/jdbc.properties</value>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- 配置数据源 -->
|
||||
<bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource">
|
||||
<property name="driverClassName" value="${jdbc.driverClassName}"/>
|
||||
<property name="url" value="${jdbc.url}"/>
|
||||
<property name="username" value="${jdbc.username}"/>
|
||||
<property name="password" value="${jdbc.password}"/>
|
||||
<property name="maxTotal" value="${jdbc.maxTotal}"/>
|
||||
<property name="maxIdle" value="${jdbc.maxIdle}"/>
|
||||
<property name="maxWaitMillis" value="${jdbc.maxWaitMillis}"/>
|
||||
<property name="defaultAutoCommit" value="${jdbc.defaultAutoCommit}"/>
|
||||
</bean>
|
||||
|
||||
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
|
||||
<property name="dataSource" ref="dataSource"/>
|
||||
<property name="mapperLocations" value="classpath*:mybatis/mapper/*.xml"/>
|
||||
</bean>
|
||||
|
||||
<!-- 配置SqlSessionTemplate -->
|
||||
<bean id="sqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
|
||||
<constructor-arg name="sqlSessionFactory" ref="sqlSessionFactory"/>
|
||||
</bean>
|
||||
|
||||
<!-- 事务配置 -->
|
||||
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
|
||||
<property name="dataSource" ref="dataSource"/>
|
||||
</bean>
|
||||
|
||||
<!-- 使用annotation注解方式配置事务 -->
|
||||
<tx:annotation-driven transaction-manager="transactionManager"/>
|
||||
|
||||
<!--AOP 事务配置-->
|
||||
<tx:advice id="txAdvice" transaction-manager="transactionManager">
|
||||
<tx:attributes>
|
||||
<tx:method name="*"/>
|
||||
</tx:attributes>
|
||||
</tx:advice>
|
||||
|
||||
<skywalking:trace classExpression="*" packageExpression="com.ai.cloud.skywalking.example.order.service.*"/>
|
||||
<skywalking:trace classExpression="*" packageExpression="com.ai.cloud.skywalking.example.order.dao.*"/>
|
||||
|
||||
</beans>
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
log4j.rootLogger=INFO, A1
|
||||
#log4j.appender.A1=org.apache.log4j.FileAppender
|
||||
#log4j.appender.A1.File=${catalina.base}/logs/mvno_crm_all.log
|
||||
#log4j.appender.A1.layout=org.apache.log4j.PatternLayout
|
||||
#log4j.appender.A1.layout.ConversionPattern=%-d{yyyy-MM-dd HH:mm:ss.SSS} %c %n[%p] %n%m%n
|
||||
|
||||
log4j.appender.A1=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.A1.layout=com.ai.cloud.skywalking.plugin.log.log4j.v1.x.TraceIdPatternLayout
|
||||
log4j.appender.A1.layout.ConversionPattern=%x %-d{yyyy-MM-dd HH:mm:ss.SSS} %c %n[%p] %n%m%n
|
||||
|
||||
log4j.logger.com.ailk=DEBUG
|
||||
log4j.logger.org.springframework=DEBUG
|
||||
|
|
@ -1,207 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.ai.cloud.skywalking.example.order.dao.mapper.interfaces.TOrderMapper" >
|
||||
<resultMap id="BaseResultMap" type="com.ai.cloud.skywalking.example.order.dao.mapper.bo.TOrder" >
|
||||
<id column="ORDER_ID" property="orderId" jdbcType="VARCHAR" />
|
||||
<result column="RESOURCE_ID" property="resourceId" jdbcType="INTEGER" />
|
||||
<result column="PHONE_NUMBER" property="phoneNumber" jdbcType="VARCHAR" />
|
||||
<result column="PACKAGE_ID" property="packageId" jdbcType="INTEGER" />
|
||||
<result column="MAIL_ACCOUNT" property="mailAccount" jdbcType="VARCHAR" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause" >
|
||||
<where >
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or" >
|
||||
<if test="criteria.valid" >
|
||||
<trim prefix="(" suffix=")" prefixOverrides="and" >
|
||||
<foreach collection="criteria.criteria" item="criterion" >
|
||||
<choose >
|
||||
<when test="criterion.noValue" >
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue" >
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue" >
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue" >
|
||||
and ${criterion.condition}
|
||||
<foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Update_By_Example_Where_Clause" >
|
||||
<where >
|
||||
<foreach collection="example.oredCriteria" item="criteria" separator="or" >
|
||||
<if test="criteria.valid" >
|
||||
<trim prefix="(" suffix=")" prefixOverrides="and" >
|
||||
<foreach collection="criteria.criteria" item="criterion" >
|
||||
<choose >
|
||||
<when test="criterion.noValue" >
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue" >
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue" >
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue" >
|
||||
and ${criterion.condition}
|
||||
<foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List" >
|
||||
ORDER_ID, RESOURCE_ID, PHONE_NUMBER, PACKAGE_ID, MAIL_ACCOUNT
|
||||
</sql>
|
||||
<select id="selectByExample" resultMap="BaseResultMap" parameterType="com.ai.cloud.skywalking.example.order.dao.mapper.bo.TOrderCriteria" >
|
||||
select
|
||||
<if test="distinct" >
|
||||
distinct
|
||||
</if>
|
||||
'true' as QUERYID,
|
||||
<include refid="Base_Column_List" />
|
||||
from t_order
|
||||
<if test="_parameter != null" >
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null" >
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
<if test="limitStart != null and limitStart>=0" >
|
||||
limit #{limitStart} , #{limitEnd}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from t_order
|
||||
where ORDER_ID = #{orderId,jdbcType=VARCHAR}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
|
||||
delete from t_order
|
||||
where ORDER_ID = #{orderId,jdbcType=VARCHAR}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.ai.cloud.skywalking.example.order.dao.mapper.bo.TOrderCriteria" >
|
||||
delete from t_order
|
||||
<if test="_parameter != null" >
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.ai.cloud.skywalking.example.order.dao.mapper.bo.TOrder" >
|
||||
insert into t_order (ORDER_ID, RESOURCE_ID, PHONE_NUMBER,
|
||||
PACKAGE_ID, MAIL_ACCOUNT)
|
||||
values (#{orderId,jdbcType=VARCHAR}, #{resourceId,jdbcType=INTEGER}, #{phoneNumber,jdbcType=VARCHAR},
|
||||
#{packageId,jdbcType=INTEGER}, #{mailAccount,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.ai.cloud.skywalking.example.order.dao.mapper.bo.TOrder" >
|
||||
insert into t_order
|
||||
<trim prefix="(" suffix=")" suffixOverrides="," >
|
||||
<if test="orderId != null" >
|
||||
ORDER_ID,
|
||||
</if>
|
||||
RESOURCE_ID,
|
||||
<if test="phoneNumber != null" >
|
||||
PHONE_NUMBER,
|
||||
</if>
|
||||
PACKAGE_ID,
|
||||
<if test="mailAccount != null" >
|
||||
MAIL_ACCOUNT,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
||||
<if test="orderId != null" >
|
||||
#{orderId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
#{resourceId,jdbcType=INTEGER},
|
||||
<if test="phoneNumber != null" >
|
||||
#{phoneNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
#{packageId,jdbcType=INTEGER},
|
||||
<if test="mailAccount != null" >
|
||||
#{mailAccount,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.ai.cloud.skywalking.example.order.dao.mapper.bo.TOrderCriteria" resultType="java.lang.Integer" >
|
||||
select count(*) from t_order
|
||||
<if test="_parameter != null" >
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map" >
|
||||
update t_order
|
||||
<set >
|
||||
<if test="record.orderId != null" >
|
||||
ORDER_ID = #{record.orderId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.resourceId != null" >
|
||||
RESOURCE_ID = #{record.resourceId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.phoneNumber != null" >
|
||||
PHONE_NUMBER = #{record.phoneNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.packageId != null" >
|
||||
PACKAGE_ID = #{record.packageId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.mailAccount != null" >
|
||||
MAIL_ACCOUNT = #{record.mailAccount,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null" >
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExample" parameterType="map" >
|
||||
update t_order
|
||||
set ORDER_ID = #{record.orderId,jdbcType=VARCHAR},
|
||||
RESOURCE_ID = #{record.resourceId,jdbcType=INTEGER},
|
||||
PHONE_NUMBER = #{record.phoneNumber,jdbcType=VARCHAR},
|
||||
PACKAGE_ID = #{record.packageId,jdbcType=INTEGER},
|
||||
MAIL_ACCOUNT = #{record.mailAccount,jdbcType=VARCHAR}
|
||||
<if test="_parameter != null" >
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.ai.cloud.skywalking.example.order.dao.mapper.bo.TOrder" >
|
||||
update t_order
|
||||
<set >
|
||||
<if test="resourceId != null" >
|
||||
RESOURCE_ID = #{resourceId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="phoneNumber != null" >
|
||||
PHONE_NUMBER = #{phoneNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="packageId != null" >
|
||||
PACKAGE_ID = #{packageId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="mailAccount != null" >
|
||||
MAIL_ACCOUNT = #{mailAccount,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where ORDER_ID = #{orderId,jdbcType=VARCHAR}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.ai.cloud.skywalking.example.order.dao.mapper.bo.TOrder" >
|
||||
update t_order
|
||||
set RESOURCE_ID = #{resourceId,jdbcType=INTEGER},
|
||||
PHONE_NUMBER = #{phoneNumber,jdbcType=VARCHAR},
|
||||
PACKAGE_ID = #{packageId,jdbcType=INTEGER},
|
||||
MAIL_ACCOUNT = #{mailAccount,jdbcType=VARCHAR}
|
||||
where ORDER_ID = #{orderId,jdbcType=VARCHAR}
|
||||
</update>
|
||||
</mapper>
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
create TABLE t_order (
|
||||
ORDER_ID varchar(32) not null,
|
||||
RESOURCE_ID int(11),
|
||||
PHONE_NUMBER varchar(11) not null,
|
||||
PACKAGE_ID int(11),
|
||||
MAIL_ACCOUNT varchar(45),
|
||||
PRIMARY KEY (ORDER_ID)
|
||||
);
|
||||
CREATE UNIQUE INDEX T_ORDER_ORDER_ID_uindex ON t_order (ORDER_ID ASC);
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
|
||||
http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
|
||||
<dubbo:application name="skywalking-example-order"/>
|
||||
<dubbo:registry address="zookeeper://127.0.0.1:2181"/>
|
||||
<dubbo:protocol name="dubbo" port="30880"/>
|
||||
<dubbo:provider timeout="5000000" filter="swEnhanceFilter"/>
|
||||
<dubbo:consumer timeout="5000000" filter="swEnhanceFilter"/>
|
||||
<bean id="orderMaintain" class="com.ai.cloud.skywalking.example.order.impl.OrderMaintainImpl"/>
|
||||
<dubbo:service interface="com.ai.cloud.skywalking.example.order.interfaces.IOrderMaintain" ref="orderMaintain" filter="swEnhanceFilter"/>
|
||||
|
||||
<dubbo:annotation package="com.ai.cloud.skywalking.example.order"/>
|
||||
|
||||
<import resource="../consumer/dubbo-consumer.xml"/>
|
||||
<import resource="../context/spring-mybatis.xml"/>
|
||||
</beans>
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
#test
|
||||
#Mon Dec 28 11:30:29 CST 2015
|
||||
buriedpoint.businesskey_max_length=300
|
||||
sender.retry_get_sender_wait_interval=2000
|
||||
buffer.pool_size=5
|
||||
senderchecker.check_polling_time=200
|
||||
|
||||
sender.max_send_length=20000
|
||||
consumer.max_consumer=2
|
||||
consumer.max_wait_time=5
|
||||
sender.max_copy_num=2
|
||||
skywalking.application_code=order-application
|
||||
consumer.consumer_fail_retry_wait_interval=50
|
||||
skywalking.user_id=6
|
||||
buriedpoint.printf=false
|
||||
buriedpoint.exclusive_exceptions=
|
||||
buriedpoint.max_exception_stack_length=4000
|
||||
sender.connect_percent=100
|
||||
buffer.buffer_max_size=18000
|
||||
sender.servers_addr=10.1.235.197:34000;10.1.235.197:35000;
|
||||
skywalking.sdk_version=1.0a2
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-example-order-interfaces</artifactId>
|
||||
<version>1.0-Final</version>
|
||||
|
||||
<name>skywalking-example-order-interfaces</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>1.6</source>
|
||||
<target>1.6</target>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>2.4.3</version>
|
||||
<configuration>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
package com.ai.cloud.skywalking.example.order.interfaces;
|
||||
|
||||
import com.ai.cloud.skywalking.example.order.interfaces.parameter.OrderInfo;
|
||||
|
||||
public interface IOrderMaintain {
|
||||
String saveOrder(OrderInfo orderInfo);
|
||||
}
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
package com.ai.cloud.skywalking.example.order.interfaces.parameter;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class OrderInfo implements Serializable {
|
||||
|
||||
private String resourceId;
|
||||
|
||||
private String phoneNumber;
|
||||
|
||||
private String packageId;
|
||||
|
||||
private String mailAccount;
|
||||
|
||||
|
||||
public String getResourceId() {
|
||||
return resourceId;
|
||||
}
|
||||
|
||||
public void setResourceId(String resourceId) {
|
||||
this.resourceId = resourceId;
|
||||
}
|
||||
|
||||
public String getPhoneNumber() {
|
||||
return phoneNumber;
|
||||
}
|
||||
|
||||
public void setPhoneNumber(String phoneNumber) {
|
||||
this.phoneNumber = phoneNumber;
|
||||
}
|
||||
|
||||
public String getPackageId() {
|
||||
return packageId;
|
||||
}
|
||||
|
||||
public void setPackageId(String packageId) {
|
||||
this.packageId = packageId;
|
||||
}
|
||||
|
||||
public String getMailAccount() {
|
||||
return mailAccount;
|
||||
}
|
||||
|
||||
public void setMailAccount(String mailAccount) {
|
||||
this.mailAccount = mailAccount;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-example-order</artifactId>
|
||||
<version>1.0-Final</version>
|
||||
|
||||
<name>skywalking-example-order</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
<modules>
|
||||
<module>order-interfaces</module>
|
||||
<module>order-impl</module>
|
||||
</modules>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>1.6</source>
|
||||
<target>1.6</target>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>2.4.3</version>
|
||||
<configuration>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-example</artifactId>
|
||||
<version>1.0-Final</version>
|
||||
|
||||
<modules>
|
||||
<module>account-application</module>
|
||||
<module>mail-application</module>
|
||||
<module>resources-application</module>
|
||||
<module>web-application</module>
|
||||
<module>order-application</module>
|
||||
</modules>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>skywalking-example</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>1.6</source>
|
||||
<target>1.6</target>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>2.4.3</version>
|
||||
<configuration>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-example-resources</artifactId>
|
||||
<version>1.0-Final</version>
|
||||
|
||||
<modules>
|
||||
<module>resource-impl</module>
|
||||
<module>resource-interfaces</module>
|
||||
</modules>
|
||||
<name>skywalking-example-resources</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>1.6</source>
|
||||
<target>1.6</target>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>2.4.3</version>
|
||||
<configuration>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
@ -1,142 +0,0 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-example-resource-impl</artifactId>
|
||||
<version>1.0-Final</version>
|
||||
|
||||
<name>skywalking-example-resource-impl</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>Company</id>
|
||||
<url>http://10.1.228.199:18081/nexus/content/groups/public/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbox</artifactId>
|
||||
<version>2.8.4</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-beans</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-core</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-aop</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-expression</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.101tec</groupId>
|
||||
<artifactId>zkclient</artifactId>
|
||||
<version>0.7</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-core</artifactId>
|
||||
<version>2.4.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>5.1.37</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.javassist</groupId>
|
||||
<artifactId>javassist</artifactId>
|
||||
<version>3.20.0-GA</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
<version>4.1.5.RELEASE</version>
|
||||
</dependency>
|
||||
|
||||
<!-- save order dubbo interfaces -->
|
||||
<dependency>
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-example-resource-interfaces</artifactId>
|
||||
<version>1.0-Final</version>
|
||||
</dependency>
|
||||
|
||||
<!-- -->
|
||||
<dependency>
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-spring-plugin</artifactId>
|
||||
<version>1.0-Final</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-dubbo-plugin</artifactId>
|
||||
<version>1.0-Final</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-jdbc-plugin</artifactId>
|
||||
<version>1.0-Final</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.aspectj</groupId>
|
||||
<artifactId>aspectjweaver</artifactId>
|
||||
<version>1.8.7</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-log4j-1.x-plugin</artifactId>
|
||||
<version>1.0-Final</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-log4j-2.x-plugin</artifactId>
|
||||
<version>1.0-Final</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>1.6</source>
|
||||
<target>1.6</target>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>2.4.3</version>
|
||||
<configuration>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
@ -1,118 +0,0 @@
|
|||
package com.ai.cloud.skywalking.example.resource.dao;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.sql.*;
|
||||
|
||||
@Component
|
||||
public class ResourceDAO {
|
||||
private static Logger logger = LogManager.getLogger(ResourceDAO.class);
|
||||
private static final String URL = "tracing:jdbc:mysql://localhost:3306/test";
|
||||
private static final String DRIVER_CLASS = "com.ai.cloud.skywalking.plugin.jdbc.mysql.MySQLTracingDriver";
|
||||
private static final String USER_NAME = "root";
|
||||
private static final String PASSWORD = "root";
|
||||
private static Connection con;
|
||||
|
||||
static {
|
||||
try {
|
||||
Class.forName(DRIVER_CLASS);
|
||||
} catch (ClassNotFoundException e) {
|
||||
logger.error("Cannot find the driver class", e);
|
||||
}
|
||||
try {
|
||||
con = DriverManager.getConnection(URL, USER_NAME, PASSWORD);
|
||||
} catch (SQLException e) {
|
||||
logger.error("Cannot connect the DB.", e);
|
||||
}
|
||||
}
|
||||
|
||||
public String selectPhoneNumberStatus(String phoneNumber) {
|
||||
try {
|
||||
PreparedStatement preparedStatement = con.prepareStatement(
|
||||
"SELECT STATUE FROM T_PHONE_NUMBER WHERE PHONE_NUMBER = ?");
|
||||
preparedStatement.setString(1, phoneNumber);
|
||||
ResultSet resultSet = preparedStatement.executeQuery();
|
||||
if (resultSet.next()) {
|
||||
return resultSet.getString("STATUE");
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
logger.error("Select phone number status failed", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean updatePhoneNumberStatus(String phoneNumber) {
|
||||
try {
|
||||
PreparedStatement preparedStatement = con.prepareStatement(
|
||||
"UPDATE t_phone_number SET STATUE = ? WHERE PHONE_NUMBER = ?");
|
||||
preparedStatement.setString(1, "1");
|
||||
preparedStatement.setString(2, phoneNumber);
|
||||
preparedStatement.execute();
|
||||
return true;
|
||||
} catch (SQLException e) {
|
||||
logger.error("update phone number status failed", e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public String selectResourceStatus(String resourceId) {
|
||||
try {
|
||||
PreparedStatement preparedStatement = con.prepareStatement(
|
||||
"SELECT STATUE FROM T_RESOURCE WHERE RESOURCE_ID = ?");
|
||||
preparedStatement.setString(1, resourceId);
|
||||
ResultSet resultSet = preparedStatement.executeQuery();
|
||||
if (resultSet.next()) {
|
||||
return resultSet.getString("STATUE");
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
logger.error("Select resource status failed.", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean updateResourceStatus(String resourceId) {
|
||||
try {
|
||||
PreparedStatement preparedStatement = con.prepareStatement(
|
||||
"UPDATE t_resource SET STATUE = ? WHERE RESOURCE_ID = ?");
|
||||
preparedStatement.setString(1, "1");
|
||||
preparedStatement.setString(2, resourceId);
|
||||
preparedStatement.execute();
|
||||
return true;
|
||||
} catch (SQLException e) {
|
||||
logger.error("Update phone number status failed", e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public String selectPhonePackageStatus(String packageId) {
|
||||
try {
|
||||
PreparedStatement preparedStatement = con.prepareStatement(
|
||||
"SELECT STATUE FROM T_PHONE_PACKAGE WHERE PACKAGE_ID = ?");
|
||||
preparedStatement.setString(1, packageId);
|
||||
ResultSet resultSet = preparedStatement.executeQuery();
|
||||
if (resultSet.next()) {
|
||||
return resultSet.getString("STATUE");
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
logger.error("Select phone package status failed.", e);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean updatePhonePackageStatus(String packageId) {
|
||||
try {
|
||||
PreparedStatement preparedStatement = con.prepareStatement(
|
||||
"UPDATE t_phone_package SET STATUE = ? WHERE PACKAGE_ID = ?");
|
||||
preparedStatement.setString(1, "1");
|
||||
preparedStatement.setString(2, packageId);
|
||||
preparedStatement.execute();
|
||||
return true;
|
||||
} catch (SQLException e) {
|
||||
logger.error("Update phone number status failed", e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
package com.ai.cloud.skywalking.example.resource.dubbo.impl;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import com.ai.cloud.skywalking.example.resource.dubbo.interfaces.checker.IResourceCheck;
|
||||
import com.ai.cloud.skywalking.example.resource.dubbo.interfaces.checker.param.ResourceInfo;
|
||||
import com.ai.cloud.skywalking.example.resource.service.IResourceManage;
|
||||
import com.alibaba.dubbo.config.annotation.Service;
|
||||
|
||||
@Service
|
||||
public class ResourceCheckImpl implements IResourceCheck {
|
||||
|
||||
@Autowired
|
||||
private IResourceManage resourceManage;
|
||||
|
||||
@Override
|
||||
public boolean checkResource(ResourceInfo info) {
|
||||
return resourceManage.checkResource(info);
|
||||
}
|
||||
|
||||
public boolean reservationResource(ResourceInfo info) {
|
||||
return resourceManage.reservationResource(info);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
package com.ai.cloud.skywalking.example.resource.exception;
|
||||
|
||||
public class BusinessException extends RuntimeException {
|
||||
|
||||
public BusinessException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
package com.ai.cloud.skywalking.example.resource.service;
|
||||
|
||||
import com.ai.cloud.skywalking.example.resource.dubbo.interfaces.checker.param.ResourceInfo;
|
||||
import com.ai.cloud.skywalking.example.resource.exception.BusinessException;
|
||||
|
||||
public interface IResourceManage {
|
||||
boolean checkResource(ResourceInfo resourceInfo);
|
||||
|
||||
boolean reservationResource(ResourceInfo resourceInfo);
|
||||
}
|
||||
|
|
@ -1,69 +0,0 @@
|
|||
package com.ai.cloud.skywalking.example.resource.service.impl;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.ai.cloud.skywalking.example.resource.dao.ResourceDAO;
|
||||
import com.ai.cloud.skywalking.example.resource.dubbo.interfaces.checker.param.ResourceInfo;
|
||||
import com.ai.cloud.skywalking.example.resource.exception.BusinessException;
|
||||
import com.ai.cloud.skywalking.example.resource.service.IResourceManage;
|
||||
|
||||
@Component
|
||||
public class ResourceManageImpl implements IResourceManage {
|
||||
|
||||
@Autowired
|
||||
private ResourceDAO resourceDAO;
|
||||
|
||||
|
||||
@Override
|
||||
public boolean checkResource(ResourceInfo resourceInfo) throws BusinessException {
|
||||
return checkPhoneNumber(resourceInfo.getPhoneNumber()) && checkResourceId(resourceInfo.getResourceId()) &&
|
||||
checkPhonePackage(resourceInfo.getPhonePackage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean reservationResource(ResourceInfo resourceInfo) {
|
||||
return resourceDAO.updatePhoneNumberStatus(resourceInfo.getPhoneNumber())
|
||||
&& resourceDAO.updateResourceStatus(resourceInfo.getResourceId());
|
||||
}
|
||||
|
||||
|
||||
public boolean checkPhoneNumber(String phoneNumber) throws BusinessException {
|
||||
if (resourceDAO.selectPhoneNumberStatus(phoneNumber) == null) {
|
||||
throw new BusinessException("Cannot find phone number[" + phoneNumber + "]");
|
||||
}
|
||||
|
||||
if ("0".equals(resourceDAO.selectPhoneNumberStatus(phoneNumber))) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public boolean checkResourceId(String resourceId) throws BusinessException {
|
||||
if (resourceDAO.selectResourceStatus(resourceId) == null) {
|
||||
throw new BusinessException("Cannot find resourceId[" + resourceId + "]");
|
||||
}
|
||||
|
||||
if ("0".equals(resourceDAO.selectResourceStatus(resourceId))) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public boolean checkPhonePackage(String packageId) throws BusinessException {
|
||||
if (resourceDAO.selectResourceStatus(packageId) == null) {
|
||||
throw new BusinessException("Cannot find package Id[" + packageId + "]");
|
||||
}
|
||||
|
||||
if ("0".equals(resourceDAO.selectPhonePackageStatus(packageId))) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
package com.ai.cloud.skywalking.example.resource.util;
|
||||
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
|
||||
public class DubboStart {
|
||||
|
||||
|
||||
public static void main(String[] args) throws InterruptedException {
|
||||
ClassPathXmlApplicationContext context =
|
||||
new ClassPathXmlApplicationContext("classpath*:applicationContext.xml");
|
||||
context.start();
|
||||
while (true){
|
||||
Thread.sleep(1000000000L);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xmlns:skywalking="http://cloud.asiainfo.com/schema/skywalking"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
|
||||
http://www.springframework.org/schema/context
|
||||
http://www.springframework.org/schema/context/spring-context-3.0.xsd
|
||||
http://cloud.asiainfo.com/schema/skywalking
|
||||
http://cloud.asiainfo.com/schema/skywalking/skywalking.xsd">
|
||||
|
||||
<context:component-scan base-package="com.ai.cloud.skywalking.example.resource"/>
|
||||
<import resource="provider/dubbo-provider.xml"/>
|
||||
<skywalking:trace classExpression="*" packageExpression="com.ai.cloud.skywalking.example.resource.service.*"/>
|
||||
<skywalking:trace classExpression="*" packageExpression="com.ai.cloud.skywalking.example.resource.dao.*"/>
|
||||
|
||||
</beans>
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
|
||||
|
||||
<log4j:configuration>
|
||||
|
||||
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
|
||||
<layout class="com.ai.cloud.skywalking.plugin.log.log4j.v1.x.TraceIdPatternLayout">
|
||||
<param name="ConversionPattern"
|
||||
value="%x %d - %c -%-4r [%t] %-5p %x - %m%n" />
|
||||
</layout>
|
||||
</appender>
|
||||
|
||||
<root>
|
||||
<priority value="debug" />
|
||||
<appender-ref ref="CONSOLE" />
|
||||
</root>
|
||||
|
||||
|
||||
</log4j:configuration>
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Configuration status="debug">
|
||||
<Appenders>
|
||||
<Console name="Console" target="SYSTEM_OUT">
|
||||
<PatternLayout pattern="%tid %d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
|
||||
</Console>
|
||||
</Appenders>
|
||||
<Loggers>
|
||||
<Root level="debug">
|
||||
<AppenderRef ref="Console"/>
|
||||
</Root>
|
||||
</Loggers>
|
||||
</Configuration>
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
CREATE TABLE `t_phone_number` (
|
||||
`PHONE_NUMBER` VARCHAR(11) NOT NULL,
|
||||
`STATUE` VARCHAR(2) NOT NULL,
|
||||
PRIMARY KEY (`PHONE_NUMBER`)
|
||||
);
|
||||
|
||||
CREATE TABLE `t_resource` (
|
||||
`RESOURCE_ID` INT NOT NULL,
|
||||
`RESOURCE_NAME` VARCHAR(45) NOT NULL,
|
||||
`STATUE` VARCHAR(5) NOT NULL,
|
||||
PRIMARY KEY (`RESOURCE_ID`)
|
||||
);
|
||||
|
||||
CREATE TABLE `t_phone_package` (
|
||||
`PACKAGE_ID` INT NOT NULL,
|
||||
`PACKAGE_NAME` VARCHAR(45) NOT NULL,
|
||||
`STATUE` VARCHAR(5) NOT NULL,
|
||||
PRIMARY KEY (`PACKAGE_ID`)
|
||||
);
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
|
||||
http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
|
||||
<dubbo:application name="skywalking-provider"/>
|
||||
<dubbo:registry address="zookeeper://127.0.0.1:2181"/>
|
||||
<dubbo:protocol name="dubbo" port="10880"/>
|
||||
<dubbo:provider timeout="5000000" filter="swEnhanceFilter"/>
|
||||
<bean id="resourceCheck" class="com.ai.cloud.skywalking.example.resource.dubbo.impl.ResourceCheckImpl"/>
|
||||
<dubbo:service interface="com.ai.cloud.skywalking.example.resource.dubbo.interfaces.checker.IResourceCheck"
|
||||
ref="resourceCheck"/>
|
||||
</beans>
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
#test
|
||||
#Mon Dec 28 11:31:03 CST 2015
|
||||
buriedpoint.businesskey_max_length=300
|
||||
sender.retry_get_sender_wait_interval=2000
|
||||
buffer.pool_size=5
|
||||
senderchecker.check_polling_time=200
|
||||
|
||||
sender.max_send_length=20000
|
||||
consumer.max_consumer=2
|
||||
consumer.max_wait_time=5
|
||||
sender.max_copy_num=2
|
||||
skywalking.application_code=resource-application
|
||||
consumer.consumer_fail_retry_wait_interval=50
|
||||
skywalking.user_id=6
|
||||
buriedpoint.printf=false
|
||||
buriedpoint.exclusive_exceptions=
|
||||
buriedpoint.max_exception_stack_length=4000
|
||||
sender.connect_percent=100
|
||||
buffer.buffer_max_size=18000
|
||||
sender.servers_addr=10.1.235.197:34000;10.1.235.197:35000;
|
||||
skywalking.sdk_version=1.0a2
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-example-resource-interfaces</artifactId>
|
||||
<version>1.0-Final</version>
|
||||
|
||||
<name>skywalking-example-resource-interfaces</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>Company</id>
|
||||
<url>http://10.1.228.199:18081/nexus/content/groups/public/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>1.6</source>
|
||||
<target>1.6</target>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>2.4.3</version>
|
||||
<configuration>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
package com.ai.cloud.skywalking.example.resource.dubbo.interfaces.checker;
|
||||
|
||||
import com.ai.cloud.skywalking.example.resource.dubbo.interfaces.checker.param.ResourceInfo;
|
||||
|
||||
public interface IResourceCheck {
|
||||
boolean checkResource(ResourceInfo info);
|
||||
boolean reservationResource(ResourceInfo info);
|
||||
}
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
package com.ai.cloud.skywalking.example.resource.dubbo.interfaces.checker.param;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class ResourceInfo implements Serializable{
|
||||
private String phoneNumber;
|
||||
private String resourceId;
|
||||
//手机套餐
|
||||
private String phonePackage;
|
||||
|
||||
public String getPhoneNumber() {
|
||||
return phoneNumber;
|
||||
}
|
||||
|
||||
public void setPhoneNumber(String phoneNumber) {
|
||||
this.phoneNumber = phoneNumber;
|
||||
}
|
||||
|
||||
public String getResourceId() {
|
||||
return resourceId;
|
||||
}
|
||||
|
||||
public void setResourceId(String resourceId) {
|
||||
this.resourceId = resourceId;
|
||||
}
|
||||
|
||||
public String getPhonePackage() {
|
||||
return phonePackage;
|
||||
}
|
||||
|
||||
public void setPhonePackage(String phonePackage) {
|
||||
this.phonePackage = phonePackage;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,131 +0,0 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-example-web</artifactId>
|
||||
<version>1.0-Final</version>
|
||||
|
||||
<name>skywalking-example-web</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
<packaging>war</packaging>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>3.1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jstl</groupId>
|
||||
<artifactId>jstl</artifactId>
|
||||
<version>1.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet.jsp</groupId>
|
||||
<artifactId>javax.servlet.jsp-api</artifactId>
|
||||
<version>2.3.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo</artifactId>
|
||||
<version>2.5.3</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.101tec</groupId>
|
||||
<artifactId>zkclient</artifactId>
|
||||
<version>0.7</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.javassist</groupId>
|
||||
<artifactId>javassist</artifactId>
|
||||
<version>3.20.0-GA</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
<version>4.2.2.RELEASE</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-web</artifactId>
|
||||
<version>4.2.2.RELEASE</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-webmvc</artifactId>
|
||||
<version>4.2.2.RELEASE</version>
|
||||
</dependency>
|
||||
<!--SkyWalking web filter -->
|
||||
<dependency>
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-web-plugin</artifactId>
|
||||
<version>1.0-Final</version>
|
||||
</dependency>
|
||||
<!-- SkyWalking dubbo filter -->
|
||||
<dependency>
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-dubbo-plugin</artifactId>
|
||||
<version>1.0-Final</version>
|
||||
</dependency>
|
||||
<!-- SkyWalking spring plugin-->
|
||||
<dependency>
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-spring-plugin</artifactId>
|
||||
<version>1.0-Final</version>
|
||||
</dependency>
|
||||
<!--Save order Dubbo server -->
|
||||
<dependency>
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-example-order-interfaces</artifactId>
|
||||
<version>1.0-Final</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.aspectj</groupId>
|
||||
<artifactId>aspectjweaver</artifactId>
|
||||
<version>1.8.7</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.ai.cloud</groupId>
|
||||
<artifactId>skywalking-log4j-1.x-plugin</artifactId>
|
||||
<version>1.0-Final</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>1.6</source>
|
||||
<target>1.6</target>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>2.4.3</version>
|
||||
<configuration>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
package com.ai.cloud.skywalking.example.controller;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.ai.cloud.skywalking.api.BusinessKeyAppender;
|
||||
import com.ai.cloud.skywalking.example.order.interfaces.IOrderMaintain;
|
||||
import com.ai.cloud.skywalking.example.order.interfaces.parameter.OrderInfo;
|
||||
import com.alibaba.dubbo.config.annotation.Reference;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/order")
|
||||
public class OrderSaveController {
|
||||
|
||||
@Reference
|
||||
private IOrderMaintain orderMaintain;
|
||||
|
||||
@Autowired
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
@RequestMapping("/save")
|
||||
public ModelAndView save(HttpServletRequest req) {
|
||||
String phoneNumber = req.getParameter("phoneNumber");
|
||||
String resourceId = req.getParameter("resourceId");
|
||||
String packageId = req.getParameter("packageId");
|
||||
String mail = req.getParameter("mail");
|
||||
|
||||
String businessKey = "phoneNumber:" + phoneNumber + ",resourceId:" + resourceId + ",mail:" + mail;
|
||||
BusinessKeyAppender.setBusinessKey2Trace(businessKey);
|
||||
|
||||
OrderInfo orderInfo = new OrderInfo();
|
||||
orderInfo.setResourceId(resourceId);
|
||||
orderInfo.setPhoneNumber(phoneNumber);
|
||||
orderInfo.setPackageId(packageId);
|
||||
orderInfo.setMailAccount(mail);
|
||||
String orderId = orderMaintain.saveOrder(orderInfo);
|
||||
System.out.println("orderId:" + orderId);
|
||||
ModelAndView view = new ModelAndView("order/saveOrderResult");
|
||||
return view;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xmlns:mvc="http://www.springframework.org/schema/mvc"
|
||||
xmlns:skywalking="http://cloud.asiainfo.com/schema/skywalking"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
|
||||
http://www.springframework.org/schema/context
|
||||
http://www.springframework.org/schema/context/spring-context-3.0.xsd
|
||||
http://www.springframework.org/schema/mvc
|
||||
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
|
||||
http://cloud.asiainfo.com/schema/skywalking
|
||||
http://cloud.asiainfo.com/schema/skywalking/skywalking.xsd">
|
||||
|
||||
<!-- 默认的注解映射的支持 -->
|
||||
<mvc:annotation-driven/>
|
||||
|
||||
<!-- 设置使用注解的类所在的jar包 ,当使用 <context:component-scan/> 后,就可以将 <context:annotation-config/>
|
||||
移除了 -->
|
||||
<context:component-scan base-package="com.ai.cloud.skywalking.example.controller"/>
|
||||
|
||||
|
||||
<!-- 完成请求和注解POJO的映射 -->
|
||||
<!--<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"/> -->
|
||||
|
||||
<bean
|
||||
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
|
||||
<property name="prefix" value="/jsp/"/>
|
||||
<property name="suffix" value=".jsp"/>
|
||||
<property name="viewClass"
|
||||
value="org.springframework.web.servlet.view.JstlView"/>
|
||||
</bean>
|
||||
<!-- 对静态资源文件的访问 -->
|
||||
<mvc:default-servlet-handler/>
|
||||
|
||||
<import resource="consumer/dubbo-consumer.xml"/>
|
||||
<skywalking:trace classExpression="*" packageExpression="com.ai.cloud.skywalking.example.controller..*"/>
|
||||
</beans>
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
|
||||
http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
|
||||
|
||||
<dubbo:application name="skywalking-consumer"/>
|
||||
<dubbo:consumer filter="swEnhanceFilter"/>
|
||||
<dubbo:registry address="zookeeper://127.0.0.1:2181"/>
|
||||
<dubbo:reference id="orderMaintain" interface="com.ai.cloud.skywalking.example.order.interfaces.IOrderMaintain"/>
|
||||
|
||||
<dubbo:annotation package="com.ai.cloud.skywalking.example.controller"/>
|
||||
|
||||
</beans>
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
log4j.rootLogger=DEBUG, A1
|
||||
#log4j.appender.A1=org.apache.log4j.FileAppender
|
||||
#log4j.appender.A1.File=${catalina.base}/logs/mvno_crm_all.log
|
||||
#log4j.appender.A1.layout=org.apache.log4j.PatternLayout
|
||||
#log4j.appender.A1.layout.ConversionPattern=%-d{yyyy-MM-dd HH:mm:ss.SSS} %c %n[%p] %n%m%n
|
||||
|
||||
log4j.appender.A1=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.A1.layout=com.ai.cloud.skywalking.plugin.log.log4j.v1.x.TraceIdPatternLayout
|
||||
log4j.appender.A1.layout.ConversionPattern=%x %-d{yyyy-MM-dd HH:mm:ss.SSS} %c %n[%p] %n%m%n
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
#test
|
||||
#Mon Dec 28 11:30:00 CST 2015
|
||||
buriedpoint.businesskey_max_length=300
|
||||
sender.retry_get_sender_wait_interval=2000
|
||||
buffer.pool_size=5
|
||||
senderchecker.check_polling_time=200
|
||||
|
||||
sender.max_send_length=20000
|
||||
consumer.max_consumer=2
|
||||
consumer.max_wait_time=5
|
||||
sender.max_copy_num=2
|
||||
skywalking.application_code=web-application
|
||||
consumer.consumer_fail_retry_wait_interval=50
|
||||
skywalking.user_id=6
|
||||
buriedpoint.printf=false
|
||||
buriedpoint.exclusive_exceptions=
|
||||
buriedpoint.max_exception_stack_length=4000
|
||||
sender.connect_percent=100
|
||||
buffer.buffer_max_size=18000
|
||||
sender.servers_addr=10.1.235.197:34000;10.1.235.197:35000;
|
||||
skywalking.sdk_version=1.0a2
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://java.sun.com/xml/ns/javaee"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
|
||||
id="WebApp_ID" version="2.5">
|
||||
<display-name>skywalking-example-web-application</display-name>
|
||||
<!--Trace Filter -->
|
||||
<filter>
|
||||
<filter-name>tracingFilter</filter-name>
|
||||
<filter-class>com.ai.cloud.skywalking.plugin.web.SkyWalkingFilter</filter-class>
|
||||
</filter>
|
||||
|
||||
<filter-mapping>
|
||||
<filter-name>tracingFilter</filter-name>
|
||||
<url-pattern>/order/save</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<filter>
|
||||
<filter-name>encoding</filter-name>
|
||||
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
|
||||
<init-param>
|
||||
<param-name>encoding</param-name>
|
||||
<param-value>UTF-8</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>forceEncoding</param-name>
|
||||
<param-value>true</param-value>
|
||||
</init-param>
|
||||
</filter>
|
||||
<filter-mapping>
|
||||
<filter-name>encoding</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>springmvc</servlet-name>
|
||||
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
|
||||
<init-param>
|
||||
<param-name>contextConfigLocation</param-name>
|
||||
<param-value>
|
||||
classpath*:applicationcontext.xml
|
||||
</param-value>
|
||||
</init-param>
|
||||
<load-on-startup>1</load-on-startup>
|
||||
</servlet>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>springmvc</servlet-name>
|
||||
<url-pattern>/</url-pattern>
|
||||
</servlet-mapping>
|
||||
</web-app>
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
<%--
|
||||
Created by IntelliJ IDEA.
|
||||
User: astraea
|
||||
Date: 2015/11/26
|
||||
Time: 15:37
|
||||
To change this template use File | Settings | File Templates.
|
||||
--%>
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>Save Order result</title>
|
||||
</head>
|
||||
<body>
|
||||
Save Order Success
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,23 +1,55 @@
|
|||
package com.ai.cloud.skywalking.agent;
|
||||
|
||||
import com.ai.cloud.skywalking.conf.Config;
|
||||
import com.ai.cloud.skywalking.conf.AuthDesc;
|
||||
import com.ai.cloud.skywalking.conf.ConfigInitializer;
|
||||
import com.ai.cloud.skywalking.plugin.PluginBootstrap;
|
||||
import com.ai.cloud.skywalking.transformer.ClassTransformer;
|
||||
import com.ai.cloud.skywalking.logging.LogManager;
|
||||
import com.ai.cloud.skywalking.logging.Logger;
|
||||
import com.ai.cloud.skywalking.plugin.*;
|
||||
import com.ai.cloud.skywalking.plugin.boot.BootPluginDefine;
|
||||
import net.bytebuddy.agent.builder.AgentBuilder;
|
||||
import net.bytebuddy.description.type.TypeDescription;
|
||||
import net.bytebuddy.dynamic.DynamicType;
|
||||
import net.bytebuddy.matcher.ElementMatchers;
|
||||
|
||||
import java.lang.instrument.Instrumentation;
|
||||
import java.util.List;
|
||||
|
||||
public class SkywalkingAgent {
|
||||
|
||||
public static void premain(String agentArgs, Instrumentation inst) {
|
||||
private static Logger logger = LogManager.getLogger(SkywalkingAgent.class);
|
||||
|
||||
public static void premain(String agentArgs, Instrumentation instrumentation) throws PluginException {
|
||||
ConfigInitializer.initialize();
|
||||
if (!AuthDesc.isAuth()) {
|
||||
|
||||
List<IPlugin> plugins = new PluginBootstrap().loadPlugins();
|
||||
final PluginDefineCategory pluginDefineCategory = PluginDefineCategory.category(plugins);
|
||||
|
||||
startBootPluginDefines(pluginDefineCategory.getBootPluginsDefines());
|
||||
|
||||
new AgentBuilder.Default().type(ElementMatchers.<TypeDescription>any()).transform(new AgentBuilder.Transformer() {
|
||||
public DynamicType.Builder<?> transform(DynamicType.Builder<?> builder, TypeDescription typeDescription, ClassLoader classLoader) {
|
||||
AbstractClassEnhancePluginDefine pluginDefine = pluginDefineCategory.getClassEnhancePluginDefines().get(typeDescription.getTypeName());
|
||||
if (pluginDefine == null) {
|
||||
return builder;
|
||||
}
|
||||
|
||||
try {
|
||||
return pluginDefine.define0(builder);
|
||||
} catch (PluginException e) {
|
||||
logger.error("Failed to enhance plugin " + pluginDefine.getClass().getName(), e);
|
||||
return builder;
|
||||
}
|
||||
}
|
||||
}).installOn(instrumentation);
|
||||
|
||||
if (Config.SkyWalking.ALL_METHOD_MONITOR) {
|
||||
String interceptorPackage = System.getProperty("interceptor.package", "");
|
||||
inst.addTransformer(new ClassTransformer(interceptorPackage));
|
||||
}
|
||||
}
|
||||
|
||||
PluginBootstrap bootstrap = new PluginBootstrap();
|
||||
bootstrap.start();
|
||||
|
||||
public static void startBootPluginDefines(List<BootPluginDefine> bootPluginDefines) throws PluginException {
|
||||
for (BootPluginDefine bootPluginDefine : bootPluginDefines) {
|
||||
bootPluginDefine.define(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
package com.ai.cloud.skywalking.plugin.interceptor;
|
||||
package com.ai.cloud.skywalking.plugin;
|
||||
|
||||
import com.ai.cloud.skywalking.logging.LogManager;
|
||||
import com.ai.cloud.skywalking.logging.Logger;
|
||||
import com.ai.cloud.skywalking.plugin.IPlugin;
|
||||
import com.ai.cloud.skywalking.plugin.PluginException;
|
||||
import com.ai.cloud.skywalking.protocol.util.StringUtil;
|
||||
import net.bytebuddy.ByteBuddy;
|
||||
import net.bytebuddy.dynamic.ClassFileLocator;
|
||||
|
|
@ -17,36 +15,33 @@ public abstract class AbstractClassEnhancePluginDefine implements IPlugin {
|
|||
private static Logger logger = LogManager.getLogger(AbstractClassEnhancePluginDefine.class);
|
||||
|
||||
@Override
|
||||
public void define() throws PluginException {
|
||||
public void define(DynamicType.Builder<?> builder) throws PluginException {
|
||||
builder = define0(builder);
|
||||
builder.name(enhanceClassName()).make().load(ClassLoader.getSystemClassLoader(), ClassLoadingStrategy.Default.INJECTION).getLoaded();
|
||||
}
|
||||
|
||||
public DynamicType.Builder<?> define0(DynamicType.Builder<?> builder) throws PluginException {
|
||||
String interceptorDefineClassName = this.getClass().getName();
|
||||
|
||||
String enhanceOriginClassName = enhanceClassName();
|
||||
if (StringUtil.isEmpty(enhanceOriginClassName)) {
|
||||
logger.warn("classname of being intercepted is not defined by {}.",
|
||||
interceptorDefineClassName);
|
||||
return;
|
||||
logger.warn("classname of being intercepted is not defined by {}.", interceptorDefineClassName);
|
||||
return builder;
|
||||
}
|
||||
|
||||
logger.debug("prepare to enhance class {} by {}.",
|
||||
enhanceOriginClassName, interceptorDefineClassName);
|
||||
|
||||
Resolution resolution = CLASS_TYPE_POOL.describe(enhanceOriginClassName);
|
||||
if (!resolution.isResolved()) {
|
||||
logger.warn("class {} can't be resolved, enhance by {} failue.",
|
||||
enhanceOriginClassName, interceptorDefineClassName);
|
||||
return;
|
||||
}
|
||||
logger.debug("prepare to enhance class {} by {}.", enhanceOriginClassName, interceptorDefineClassName);
|
||||
|
||||
/**
|
||||
* find witness classes for enhance class
|
||||
*/
|
||||
String[] witnessClasses = witnessClasses();
|
||||
if(witnessClasses != null) {
|
||||
if (witnessClasses != null) {
|
||||
for (String witnessClass : witnessClasses) {
|
||||
Resolution witnessClassResolution = CLASS_TYPE_POOL.describe(witnessClass);
|
||||
if (!witnessClassResolution.isResolved()) {
|
||||
logger.warn("enhance class {} by plugin {} is not working. Because witness class {} is not existed.", enhanceOriginClassName, interceptorDefineClassName, witnessClass);
|
||||
return;
|
||||
logger.warn("enhance class {} by plugin {} is not working. Because witness class {} is not existed.", enhanceOriginClassName, interceptorDefineClassName,
|
||||
witnessClass);
|
||||
return builder;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -54,24 +49,12 @@ public abstract class AbstractClassEnhancePluginDefine implements IPlugin {
|
|||
/**
|
||||
* find origin class source code for interceptor
|
||||
*/
|
||||
DynamicType.Builder<?> newClassBuilder = new ByteBuddy()
|
||||
.rebase(resolution.resolve(),
|
||||
ClassFileLocator.ForClassLoader.ofClassPath());
|
||||
DynamicType.Builder<?> newClassBuilder = this.enhance(enhanceOriginClassName, builder);
|
||||
|
||||
newClassBuilder = this.enhance(enhanceOriginClassName, newClassBuilder);
|
||||
|
||||
/**
|
||||
* naming class as origin class name, make and load class to
|
||||
* classloader.
|
||||
*/
|
||||
newClassBuilder
|
||||
.name(enhanceOriginClassName)
|
||||
.make()
|
||||
.load(ClassLoader.getSystemClassLoader(),
|
||||
ClassLoadingStrategy.Default.INJECTION).getLoaded();
|
||||
logger.debug("enhance class {} by {} completely.", enhanceOriginClassName, interceptorDefineClassName);
|
||||
|
||||
logger.debug("enhance class {} by {} completely.",
|
||||
enhanceOriginClassName, interceptorDefineClassName);
|
||||
return newClassBuilder;
|
||||
}
|
||||
|
||||
protected abstract DynamicType.Builder<?> enhance(String enhanceOriginClassName, DynamicType.Builder<?> newClassBuilder) throws PluginException;
|
||||
|
|
@ -89,7 +72,7 @@ public abstract class AbstractClassEnhancePluginDefine implements IPlugin {
|
|||
*
|
||||
* @return
|
||||
*/
|
||||
protected String[] witnessClasses(){
|
||||
return new String[]{};
|
||||
protected String[] witnessClasses() {
|
||||
return new String[] {};
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,8 @@
|
|||
package com.ai.cloud.skywalking.plugin;
|
||||
|
||||
|
||||
import net.bytebuddy.dynamic.DynamicType;
|
||||
|
||||
public interface IPlugin {
|
||||
public void define() throws PluginException;
|
||||
void define(DynamicType.Builder<?> builder) throws PluginException;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
package com.ai.cloud.skywalking.plugin;
|
||||
|
||||
import com.ai.cloud.skywalking.conf.AuthDesc;
|
||||
import com.ai.cloud.skywalking.logging.LogManager;
|
||||
import com.ai.cloud.skywalking.logging.Logger;
|
||||
import net.bytebuddy.pool.TypePool;
|
||||
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class PluginBootstrap {
|
||||
|
|
@ -13,11 +13,7 @@ public class PluginBootstrap {
|
|||
|
||||
public static TypePool CLASS_TYPE_POOL = null;
|
||||
|
||||
public void start() {
|
||||
if (!AuthDesc.isAuth()) {
|
||||
return;
|
||||
}
|
||||
|
||||
public List<IPlugin> loadPlugins() {
|
||||
CLASS_TYPE_POOL = TypePool.Default.ofClassPath();
|
||||
|
||||
PluginResourcesResolver resolver = new PluginResourcesResolver();
|
||||
|
|
@ -25,32 +21,33 @@ public class PluginBootstrap {
|
|||
|
||||
if (resources == null || resources.size() == 0) {
|
||||
logger.info("no plugin files (skywalking-plugin.properties) found, continue to start application.");
|
||||
return;
|
||||
return new ArrayList<IPlugin>();
|
||||
}
|
||||
|
||||
for (URL pluginUrl : resources) {
|
||||
try {
|
||||
PluginCfg.CFG.load(pluginUrl.openStream());
|
||||
} catch (Throwable t) {
|
||||
logger.error("plugin [{}] init failure.", new Object[]{pluginUrl}, t);
|
||||
logger.error("plugin [{}] init failure.", new Object[] {pluginUrl}, t);
|
||||
}
|
||||
}
|
||||
|
||||
List<String> pluginClassList = PluginCfg.CFG
|
||||
.getPluginClassList();
|
||||
List<String> pluginClassList = PluginCfg.CFG.getPluginClassList();
|
||||
|
||||
List<IPlugin> plugins = new ArrayList<IPlugin>();
|
||||
for (String pluginClassName : pluginClassList) {
|
||||
try {
|
||||
logger.debug("prepare to enhance class by plugin {}.",
|
||||
pluginClassName);
|
||||
IPlugin plugin = (IPlugin) Class.forName(
|
||||
pluginClassName).newInstance();
|
||||
plugin.define();
|
||||
logger.debug("prepare to enhance class by plugin {}.", pluginClassName);
|
||||
IPlugin plugin = (IPlugin) Class.forName(pluginClassName).newInstance();
|
||||
plugins.add(plugin);
|
||||
} catch (Throwable t) {
|
||||
logger.error("prepare to enhance class by plugin [{}] failure.",
|
||||
new Object[]{pluginClassName}, t);
|
||||
logger.error("prepare to enhance class by plugin [{}] failure.", new Object[] {pluginClassName}, t);
|
||||
}
|
||||
}
|
||||
|
||||
return plugins;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,44 @@
|
|||
package com.ai.cloud.skywalking.plugin;
|
||||
|
||||
import com.ai.cloud.skywalking.plugin.boot.BootPluginDefine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class PluginDefineCategory {
|
||||
|
||||
private static PluginDefineCategory pluginDefineCategory;
|
||||
|
||||
private final Map<String, AbstractClassEnhancePluginDefine> classEnhancePluginDefines = new HashMap<String, AbstractClassEnhancePluginDefine>();
|
||||
private final List<BootPluginDefine> bootPluginDefines = new ArrayList<BootPluginDefine>();
|
||||
|
||||
private PluginDefineCategory(List<IPlugin> plugins) {
|
||||
for (IPlugin plugin : plugins) {
|
||||
if (plugin instanceof AbstractClassEnhancePluginDefine) {
|
||||
classEnhancePluginDefines.put(((AbstractClassEnhancePluginDefine) plugin).enhanceClassName(), (AbstractClassEnhancePluginDefine) plugin);
|
||||
}
|
||||
|
||||
if (plugin instanceof BootPluginDefine) {
|
||||
bootPluginDefines.add((BootPluginDefine) plugin);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static PluginDefineCategory category(List<IPlugin> plugins) {
|
||||
if (pluginDefineCategory == null) {
|
||||
pluginDefineCategory = new PluginDefineCategory(plugins);
|
||||
}
|
||||
return pluginDefineCategory;
|
||||
}
|
||||
|
||||
public List<BootPluginDefine> getBootPluginsDefines() {
|
||||
return pluginDefineCategory.bootPluginDefines;
|
||||
}
|
||||
|
||||
public Map<String, AbstractClassEnhancePluginDefine> getClassEnhancePluginDefines() {
|
||||
return pluginDefineCategory.classEnhancePluginDefines;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -2,42 +2,61 @@ package com.ai.cloud.skywalking.plugin;
|
|||
|
||||
import com.ai.cloud.skywalking.logging.LogManager;
|
||||
import com.ai.cloud.skywalking.logging.Logger;
|
||||
import net.bytebuddy.ByteBuddy;
|
||||
import net.bytebuddy.dynamic.ClassFileLocator;
|
||||
import net.bytebuddy.dynamic.DynamicType;
|
||||
import net.bytebuddy.pool.TypePool;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 替代应用函数的main函数入口,确保在程序入口处运行 <br/>
|
||||
* 用于替代-javaagent的另一种模式 <br/>
|
||||
*
|
||||
* @author wusheng
|
||||
*
|
||||
* @author wusheng
|
||||
*/
|
||||
public class TracingBootstrap {
|
||||
private static Logger logger = LogManager.getLogger(TracingBootstrap.class);
|
||||
private static Logger logger = LogManager.getLogger(TracingBootstrap.class);
|
||||
|
||||
private TracingBootstrap() {
|
||||
}
|
||||
private TracingBootstrap() {
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws IllegalAccessException,
|
||||
IllegalArgumentException, InvocationTargetException,
|
||||
NoSuchMethodException, SecurityException, ClassNotFoundException {
|
||||
if (args.length == 0) {
|
||||
throw new RuntimeException(
|
||||
"bootstrap failure. need args[0] to be main class.");
|
||||
}
|
||||
public static void main(String[] args) throws PluginException, ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException {
|
||||
if (args.length == 0) {
|
||||
throw new RuntimeException("bootstrap failure. need args[0] to be main class.");
|
||||
}
|
||||
|
||||
try {
|
||||
PluginBootstrap bootstrap = new PluginBootstrap();
|
||||
bootstrap.start();
|
||||
} catch (Throwable t) {
|
||||
logger.error("PluginBootstrap start failure.", t);
|
||||
}
|
||||
List<IPlugin> plugins = null;
|
||||
|
||||
String[] newArgs = Arrays.copyOfRange(args, 1, args.length);
|
||||
try {
|
||||
PluginBootstrap bootstrap = new PluginBootstrap();
|
||||
plugins = bootstrap.loadPlugins();
|
||||
} catch (Throwable t) {
|
||||
logger.error("PluginBootstrap start failure.", t);
|
||||
}
|
||||
|
||||
|
||||
Class.forName(args[0]).getMethod("main", String[].class)
|
||||
.invoke(null, new Object[]{newArgs});
|
||||
}
|
||||
for (IPlugin plugin : plugins) {
|
||||
DynamicType.Builder<?> newClassBuilder = null;
|
||||
|
||||
if (plugin instanceof AbstractClassEnhancePluginDefine) {
|
||||
String enhanceClassName = ((AbstractClassEnhancePluginDefine) plugin).enhanceClassName();
|
||||
TypePool.Resolution resolution = TypePool.Default.ofClassPath().describe(enhanceClassName);
|
||||
if (!resolution.isResolved()) {
|
||||
logger.error("Failed to resolve the class " + enhanceClassName);
|
||||
continue;
|
||||
}
|
||||
newClassBuilder = new ByteBuddy().rebase(resolution.resolve(), ClassFileLocator.ForClassLoader.ofClassPath());
|
||||
}
|
||||
|
||||
plugin.define(newClassBuilder);
|
||||
|
||||
}
|
||||
|
||||
String[] newArgs = Arrays.copyOfRange(args, 1, args.length);
|
||||
|
||||
|
||||
Class.forName(args[0]).getMethod("main", String[].class).invoke(null, new Object[] {newArgs});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,14 +2,15 @@ package com.ai.cloud.skywalking.plugin.boot;
|
|||
|
||||
import com.ai.cloud.skywalking.plugin.IPlugin;
|
||||
import com.ai.cloud.skywalking.plugin.PluginException;
|
||||
import net.bytebuddy.dynamic.DynamicType;
|
||||
|
||||
public abstract class BootPluginDefine implements IPlugin {
|
||||
|
||||
@Override
|
||||
public void define() throws PluginException {
|
||||
this.boot();
|
||||
}
|
||||
|
||||
protected abstract void boot() throws BootException;
|
||||
@Override
|
||||
public void define(DynamicType.Builder<?> builder) throws PluginException {
|
||||
this.boot();
|
||||
}
|
||||
|
||||
protected abstract void boot() throws BootException;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,7 +68,8 @@ public abstract class MethodMatcher {
|
|||
}
|
||||
|
||||
public enum Modifier {
|
||||
Public, Default, Private, Protected;
|
||||
Public, Default, Private, Protected,
|
||||
ClassLoadingStrategy;
|
||||
|
||||
private ElementMatcher.Junction<MethodDescription> elementMatcher() {
|
||||
switch (this) {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import net.bytebuddy.matcher.ElementMatcher;
|
|||
import net.bytebuddy.matcher.ElementMatchers;
|
||||
|
||||
import com.ai.cloud.skywalking.plugin.PluginException;
|
||||
import com.ai.cloud.skywalking.plugin.interceptor.AbstractClassEnhancePluginDefine;
|
||||
import com.ai.cloud.skywalking.plugin.AbstractClassEnhancePluginDefine;
|
||||
import com.ai.cloud.skywalking.plugin.interceptor.EnhanceException;
|
||||
import com.ai.cloud.skywalking.plugin.interceptor.EnhancedClassInstanceContext;
|
||||
import com.ai.cloud.skywalking.plugin.interceptor.MethodMatcher;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,42 @@
|
|||
package com.ai.cloud.skywalking.plugin.interceptor.enhance;
|
||||
|
||||
import com.ai.cloud.skywalking.api.IBuriedPointType;
|
||||
import com.ai.cloud.skywalking.protocol.common.CallType;
|
||||
import net.bytebuddy.implementation.bind.annotation.AllArguments;
|
||||
import net.bytebuddy.implementation.bind.annotation.Origin;
|
||||
import net.bytebuddy.implementation.bind.annotation.RuntimeType;
|
||||
import net.bytebuddy.implementation.bind.annotation.SuperCall;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
public class MethodInputAndOutParameterInterceptor {
|
||||
public static IBuriedPointType METHOD_INVOKE_BURIEDPOINT = new IBuriedPointType() {
|
||||
@Override
|
||||
public String getTypeName() {
|
||||
return "LOCAL";
|
||||
}
|
||||
|
||||
@Override
|
||||
public CallType getCallType() {
|
||||
return CallType.SYNC;
|
||||
}
|
||||
};
|
||||
@RuntimeType
|
||||
public Object interceptor(@AllArguments Object[] allArgument, @Origin Method method, @Origin Class<?> clazz, @SuperCall Callable<?> zuper) throws Exception {
|
||||
|
||||
|
||||
|
||||
Object ret = null;
|
||||
try {
|
||||
ret = zuper.call();
|
||||
} catch (Throwable e) {
|
||||
|
||||
throw e;
|
||||
} finally {
|
||||
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,15 +1,31 @@
|
|||
package test.ai.cloud.matcher;
|
||||
|
||||
import com.ai.cloud.skywalking.plugin.*;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import net.bytebuddy.ByteBuddy;
|
||||
import net.bytebuddy.dynamic.ClassFileLocator;
|
||||
import net.bytebuddy.dynamic.DynamicType;
|
||||
import net.bytebuddy.pool.TypePool;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.ai.cloud.skywalking.plugin.PluginBootstrap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class ExclusionMatcherTest extends TestCase {
|
||||
@Test
|
||||
public void testMatcher() throws ClassNotFoundException, IllegalAccessException, InstantiationException, InterruptedException, PluginException {
|
||||
List<IPlugin> pluginDefines = new PluginBootstrap().loadPlugins();
|
||||
|
||||
PluginDefineCategory category = PluginDefineCategory.category(pluginDefines);
|
||||
|
||||
|
||||
for (Map.Entry<String, AbstractClassEnhancePluginDefine> entry : category.getClassEnhancePluginDefines().entrySet()) {
|
||||
DynamicType.Builder<?> newClassBuilder =
|
||||
new ByteBuddy().rebase(TypePool.Default.ofClassPath().describe(entry.getKey()).resolve(), ClassFileLocator.ForClassLoader.ofClassPath());
|
||||
|
||||
entry.getValue().define(newClassBuilder);
|
||||
}
|
||||
|
||||
public class ExclusionMatcherTest extends TestCase{
|
||||
@Test
|
||||
public void testMatcher() throws ClassNotFoundException, IllegalAccessException, InstantiationException, InterruptedException {
|
||||
new PluginBootstrap().start();
|
||||
TestMatcherClass testMatcherClass = (TestMatcherClass) Class.forName("test.ai.cloud.matcher.TestMatcherClass").newInstance();
|
||||
|
||||
testMatcherClass.set();
|
||||
|
|
|
|||
|
|
@ -1,28 +1,27 @@
|
|||
package test.ai.cloud.plugin;
|
||||
|
||||
import com.ai.cloud.skywalking.plugin.PluginException;
|
||||
import com.ai.cloud.skywalking.plugin.TracingBootstrap;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.ai.cloud.skywalking.plugin.TracingBootstrap;
|
||||
|
||||
public class PluginMainTest {
|
||||
@Test
|
||||
public void testMain() throws IllegalAccessException,
|
||||
IllegalArgumentException, InvocationTargetException,
|
||||
NoSuchMethodException, SecurityException, ClassNotFoundException {
|
||||
TracingBootstrap
|
||||
.main(new String[] { "test.ai.cloud.plugin.PluginMainTest" });
|
||||
}
|
||||
@Test
|
||||
public void testMain() throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException, PluginException {
|
||||
TracingBootstrap.main(new String[] {"test.ai.cloud.plugin.PluginMainTest"});
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws InstantiationException, IllegalAccessException, ClassNotFoundException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
|
||||
long start = System.currentTimeMillis();
|
||||
public static void main(String[] args)
|
||||
throws InstantiationException, IllegalAccessException, ClassNotFoundException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException,
|
||||
SecurityException {
|
||||
long start = System.currentTimeMillis();
|
||||
|
||||
BeInterceptedClass inst = (BeInterceptedClass) Class.forName("test.ai.cloud.plugin.BeInterceptedClass").newInstance();
|
||||
inst.printabc();
|
||||
long end = System.currentTimeMillis();
|
||||
System.out.println(end - start + "ms");
|
||||
|
||||
BeInterceptedClass.call();
|
||||
}
|
||||
BeInterceptedClass inst = (BeInterceptedClass) Class.forName("test.ai.cloud.plugin.BeInterceptedClass").newInstance();
|
||||
inst.printabc();
|
||||
long end = System.currentTimeMillis();
|
||||
System.out.println(end - start + "ms");
|
||||
|
||||
BeInterceptedClass.call();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -97,20 +97,20 @@
|
|||
<scope>compile</scope>
|
||||
</dependency>
|
||||
-->
|
||||
<!--
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbox</artifactId>
|
||||
<version>2.8.4</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
-->
|
||||
<!--
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>dubbo</artifactId>
|
||||
<version>2.5.3</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
-->
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.ai.cloud.skywalking.plugin.test.dubbo.consumer;
|
||||
|
||||
import com.ai.cloud.skywalking.plugin.PluginException;
|
||||
import com.ai.cloud.skywalking.plugin.TracingBootstrap;
|
||||
import com.ai.cloud.skywalking.plugin.test.dubbo.interfaces.IDubboInterA;
|
||||
import com.ai.skywalking.testframework.api.RequestSpanAssert;
|
||||
|
|
@ -13,17 +14,14 @@ public class DubboConsumer {
|
|||
|
||||
|
||||
@Test
|
||||
public void test() throws InvocationTargetException, NoSuchMethodException, ClassNotFoundException, IllegalAccessException {
|
||||
TracingBootstrap
|
||||
.main(new String[]{"com.ai.cloud.skywalking.plugin.test.dubbo.consumer.DubboConsumer"});
|
||||
public void test() throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException, PluginException {
|
||||
TracingBootstrap.main(new String[] {"com.ai.cloud.skywalking.plugin.test.dubbo.consumer.DubboConsumer"});
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws InterruptedException {
|
||||
ApplicationContext context = new ClassPathXmlApplicationContext("classpath*:consumer/dubbo-consumer.xml");
|
||||
IDubboInterA dubboInterA = context.getBean(IDubboInterA.class);
|
||||
dubboInterA.doBusiness("AAAAA");
|
||||
RequestSpanAssert.assertEquals(new String[][]{
|
||||
{"0", "dubbo://127.0.0.1:20880/com.ai.cloud.skywalking.plugin.test.dubbo.interfaces.IDubboInterA.doBusiness(String)", ""}
|
||||
});
|
||||
RequestSpanAssert.assertEquals(new String[][] {{"0", "dubbo://127.0.0.1:20880/com.ai.cloud.skywalking.plugin.test.dubbo.interfaces.IDubboInterA.doBusiness(String)", ""}});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.ai.cloud.skywalking.plugin.test.dubbo.impl;
|
||||
|
||||
import com.ai.cloud.skywalking.plugin.PluginException;
|
||||
import com.ai.cloud.skywalking.plugin.TracingBootstrap;
|
||||
import org.junit.Test;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
|
|
@ -9,14 +10,12 @@ import java.lang.reflect.InvocationTargetException;
|
|||
public class DubboStart {
|
||||
|
||||
@Test
|
||||
public void test() throws InvocationTargetException, NoSuchMethodException, ClassNotFoundException, IllegalAccessException {
|
||||
TracingBootstrap
|
||||
.main(new String[]{"com.ai.cloud.skywalking.plugin.test.dubbo.impl.DubboStart"});
|
||||
public void test() throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException, PluginException {
|
||||
TracingBootstrap.main(new String[] {"com.ai.cloud.skywalking.plugin.test.dubbo.impl.DubboStart"});
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws InterruptedException {
|
||||
ClassPathXmlApplicationContext classPathXmlApplicationContext = new
|
||||
ClassPathXmlApplicationContext("classpath*:provider/dubbo-provider.xml");
|
||||
ClassPathXmlApplicationContext classPathXmlApplicationContext = new ClassPathXmlApplicationContext("classpath*:provider/dubbo-provider.xml");
|
||||
|
||||
classPathXmlApplicationContext.start();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.ai.cloud.skywalking.plugin.test.dubbox283.consumer;
|
||||
|
||||
import com.ai.cloud.skywalking.plugin.PluginException;
|
||||
import com.ai.cloud.skywalking.plugin.TracingBootstrap;
|
||||
import com.ai.cloud.skywalking.plugin.dubbox.bugfix.below283.BugFixAcitve;
|
||||
import com.ai.cloud.skywalking.plugin.test.dubbox283.interfaces.IDubboxRestInterA;
|
||||
|
|
@ -19,7 +20,7 @@ public class DubboxRestConsumer {
|
|||
private static final Log logger = LogFactory.getLog(DubboxRestConsumer.class);
|
||||
|
||||
@Test
|
||||
public void test() throws InvocationTargetException, NoSuchMethodException, ClassNotFoundException, IllegalAccessException {
|
||||
public void test() throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException, PluginException {
|
||||
TracingBootstrap.main(new String[] {"com.ai.cloud.skywalking.plugin.test.dubbox283.consumer.DubboxRestConsumer"});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.ai.cloud.skywalking.plugin.test.dubbox283.consumer;
|
||||
|
||||
import com.ai.cloud.skywalking.plugin.PluginException;
|
||||
import com.ai.cloud.skywalking.plugin.TracingBootstrap;
|
||||
import com.ai.cloud.skywalking.plugin.dubbox.bugfix.below283.BugFixAcitve;
|
||||
import org.junit.Test;
|
||||
|
|
@ -10,15 +11,13 @@ import java.lang.reflect.InvocationTargetException;
|
|||
public class DubboxRestStart {
|
||||
|
||||
@Test
|
||||
public void test() throws InvocationTargetException, NoSuchMethodException, ClassNotFoundException, IllegalAccessException {
|
||||
TracingBootstrap
|
||||
.main(new String[]{"com.ai.cloud.skywalking.plugin.test.dubbox283.consumer.DubboxRestStart"});
|
||||
public void test() throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException, PluginException {
|
||||
TracingBootstrap.main(new String[] {"com.ai.cloud.skywalking.plugin.test.dubbox283.consumer.DubboxRestStart"});
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws InterruptedException {
|
||||
new BugFixAcitve();
|
||||
ClassPathXmlApplicationContext classPathXmlApplicationContext = new
|
||||
ClassPathXmlApplicationContext("classpath*:provider/dubbox283-provider.xml");
|
||||
ClassPathXmlApplicationContext classPathXmlApplicationContext = new ClassPathXmlApplicationContext("classpath*:provider/dubbox283-provider.xml");
|
||||
|
||||
classPathXmlApplicationContext.start();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.ai.cloud.skywalking.plugin.test.dubbox284.consumer;
|
||||
|
||||
import com.ai.cloud.skywalking.plugin.PluginException;
|
||||
import com.ai.cloud.skywalking.plugin.TracingBootstrap;
|
||||
import com.ai.cloud.skywalking.plugin.test.dubbox283.interfaces.param.DubboxRestInterAParameter;
|
||||
import com.ai.cloud.skywalking.plugin.test.dubbox284.interfaces.IDubboxRestInterA;
|
||||
|
|
@ -18,7 +19,7 @@ public class DubboxRestConsumer {
|
|||
private static final Log logger = LogFactory.getLog(DubboxRestConsumer.class);
|
||||
|
||||
@Test
|
||||
public void test() throws InvocationTargetException, NoSuchMethodException, ClassNotFoundException, IllegalAccessException {
|
||||
public void test() throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException, PluginException {
|
||||
TracingBootstrap.main(new String[] {"com.ai.cloud.skywalking.plugin.test.dubbox284.consumer.DubboxRestConsumer"});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.ai.cloud.skywalking.plugin.test.dubbox284.consumer;
|
||||
|
||||
import com.ai.cloud.skywalking.plugin.PluginException;
|
||||
import com.ai.cloud.skywalking.plugin.TracingBootstrap;
|
||||
import com.ai.cloud.skywalking.plugin.dubbox.bugfix.below283.BugFixAcitve;
|
||||
import org.junit.Test;
|
||||
|
|
@ -10,15 +11,13 @@ import java.lang.reflect.InvocationTargetException;
|
|||
public class DubboxRestStart {
|
||||
|
||||
@Test
|
||||
public void test() throws InvocationTargetException, NoSuchMethodException, ClassNotFoundException, IllegalAccessException {
|
||||
TracingBootstrap
|
||||
.main(new String[]{"com.ai.cloud.skywalking.plugin.test.dubbox284.consumer.DubboxRestStart"});
|
||||
public void test() throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException, PluginException {
|
||||
TracingBootstrap.main(new String[] {"com.ai.cloud.skywalking.plugin.test.dubbox284.consumer.DubboxRestStart"});
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws InterruptedException {
|
||||
new BugFixAcitve();
|
||||
ClassPathXmlApplicationContext classPathXmlApplicationContext = new
|
||||
ClassPathXmlApplicationContext("classpath*:provider/dubbox284-provider.xml");
|
||||
ClassPathXmlApplicationContext classPathXmlApplicationContext = new ClassPathXmlApplicationContext("classpath*:provider/dubbox284-provider.xml");
|
||||
|
||||
classPathXmlApplicationContext.start();
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue