Skip to content

Commit

Permalink
1. 修复方法匹配的严重问题,忘记匹配方法名 -_-
Browse files Browse the repository at this point in the history
2. 修复方法匹配的严重问题,匹配参数列表时用了Set,导致方法中有参数类型相同的被压缩,从而得到一个错误的参数列表
3. 容器版本升级到0.1.0.4
4. api升级到1.0.12
  • Loading branch information
oldmanpushcart committed Feb 27, 2018
1 parent 8b559b6 commit 212cfb1
Show file tree
Hide file tree
Showing 19 changed files with 66 additions and 58 deletions.
7 changes: 4 additions & 3 deletions bin/sandbox-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ cp ../sandbox-core/target/sandbox-core-*-jar-with-dependencies.jar ${SANDBOX_TAR
&& cp install-local.sh ${SANDBOX_TARGET_DIR}/install-local.sh
echo "${SANDBOX_VERSION}" > ${SANDBOX_TARGET_DIR}/cfg/version

# for test
## cp ../sandbox-debug-module/target/sandbox-debug-module-*-jar-with-dependencies.jar\
## ${SANDBOX_TARGET_DIR}/module/sandbox-debug-module.jar
# for example
mkdir -p ${SANDBOX_TARGET_DIR}/example\
&& cp ../sandbox-debug-module/target/sandbox-debug-module-*-jar-with-dependencies.jar\
${SANDBOX_TARGET_DIR}/example/sandbox-debug-module.jar

# for mgr
cp ../sandbox-mgr-module/target/sandbox-mgr-module-*-jar-with-dependencies.jar ${SANDBOX_TARGET_DIR}/module/sandbox-mgr-module.jar \
Expand Down
22 changes: 12 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@

<groupId>com.alibaba.jvm.sandbox</groupId>
<artifactId>sandbox</artifactId>
<version>1.0.11</version>
<version>1.0.12</version>
<packaging>pom</packaging>

<name>sandbox ${project.version}</name>
<name>sandbox ${sandbox.version}</name>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<sandbox.version>1.0.12-SNAPSHOT</sandbox.version>
</properties>

<build>
Expand All @@ -20,9 +21,10 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<version>2.4</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-5</version>
</plugin>
Expand Down Expand Up @@ -113,22 +115,22 @@
<dependency>
<groupId>com.alibaba.jvm.sandbox</groupId>
<artifactId>sandbox-api</artifactId>
<version>${project.version}</version>
<version>${sandbox.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba.jvm.sandbox</groupId>
<artifactId>sandbox-provider-api</artifactId>
<version>${project.version}</version>
<version>${sandbox.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba.jvm.sandbox</groupId>
<artifactId>sandbox-common-api</artifactId>
<version>${project.version}</version>
<version>${sandbox.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba.jvm.sandbox</groupId>
<artifactId>sandbox-spy</artifactId>
<version>${project.version}</version>
<version>${sandbox.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down Expand Up @@ -273,9 +275,9 @@
</developers>

<scm>
<connection>scm:git:https://github.com/alibaba/jvm-Sandbox.git</connection>
<developerConnection>scm:git:https://github.com/alibaba/jvm-Sandbox.git</developerConnection>
<url>https://github.com/alibaba/jvm-Sandbox</url>
<connection>scm:git:https://github.com/alibaba/jvm-sandbox.git</connection>
<developerConnection>scm:git:https://github.com/alibaba/jvm-sandbox.git</developerConnection>
<url>https://github.com/alibaba/jvm-sandbox</url>
</scm>


Expand Down
18 changes: 9 additions & 9 deletions sandbox-agent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,21 @@
<parent>
<groupId>com.alibaba.jvm.sandbox</groupId>
<artifactId>sandbox</artifactId>
<version>1.0.11</version>
<version>1.0.12</version>
</parent>
<artifactId>sandbox-agent</artifactId>
<name>sandbox-agent ${project.version}</name>
<name>sandbox-agent ${sandbox.version}</name>

<build>
<finalName>sandbox-agent-${project.version}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
Expand All @@ -39,13 +46,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>

Expand Down
4 changes: 2 additions & 2 deletions sandbox-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<parent>
<groupId>com.alibaba.jvm.sandbox</groupId>
<artifactId>sandbox</artifactId>
<version>1.0.11</version>
<version>1.0.12</version>
</parent>
<artifactId>sandbox-api</artifactId>
<name>sandbox-api ${project.version}</name>
<name>sandbox-api ${sandbox.version}</name>

<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,6 @@ final public void onEvent(final Event event) throws Throwable {
}




// --- 以下为内部操作实现 ---


Expand Down Expand Up @@ -298,7 +296,8 @@ protected Behavior load(BehaviorCacheKey key) {
}
} else {
for (final Method method : key.clazz.getDeclaredMethods()) {
if (key.javaMethodDesc.equals(new BehaviorDescriptor(method).getDescriptor())) {
if (key.javaMethodName.equals(method.getName())
&& key.javaMethodDesc.equals(new BehaviorDescriptor(method).getDescriptor())) {
return new Behavior.MethodImpl(method);
}
}
Expand Down
4 changes: 2 additions & 2 deletions sandbox-common-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<parent>
<artifactId>sandbox</artifactId>
<groupId>com.alibaba.jvm.sandbox</groupId>
<version>1.0.11</version>
<version>1.0.12</version>
</parent>
<artifactId>sandbox-common-api</artifactId>
<name>sandbox-common-api ${project.version}</name>
<name>sandbox-common-api ${sandbox.version}</name>
<dependencies>
<dependency>
<groupId>javax.annotation</groupId>
Expand Down
4 changes: 2 additions & 2 deletions sandbox-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<parent>
<groupId>com.alibaba.jvm.sandbox</groupId>
<artifactId>sandbox</artifactId>
<version>1.0.11</version>
<version>1.0.12</version>
</parent>
<artifactId>sandbox-core</artifactId>
<name>sandbox-core ${project.version}</name>
<name>sandbox-core ${sandbox.version}</name>

<build>
<finalName>sandbox-core-${project.version}</finalName>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.alibaba.jvm.sandbox.core.manager.impl;

import com.alibaba.jvm.sandbox.api.*;
import com.alibaba.jvm.sandbox.api.Module;
import com.alibaba.jvm.sandbox.api.resource.*;
import com.alibaba.jvm.sandbox.core.CoreConfigure;
import com.alibaba.jvm.sandbox.core.classloader.ModuleClassLoader;
Expand Down Expand Up @@ -559,6 +560,7 @@ private boolean isChecksumCRC32Existed(long checksumCRC32) {
*/
private void softFlush() throws ModuleException {

final File systemModuleLibDir = new File(cfg.getSystemModuleLibPath());
final File[] userModuleLibDirArray = cfg.getUserModuleLibFilesWithCache();
for (final File userModuleLibDir : userModuleLibDirArray) {

Expand Down Expand Up @@ -588,10 +590,16 @@ private void softFlush() throws ModuleException {
// 2. 找出所有待卸载的已加载用户模块
for (final CoreModule coreModule : loadedModuleBOMap.values()) {
final ModuleClassLoader moduleClassLoader = coreModule.getLoader();
// 如果不是用户模块目录,忽略
if (!isOptimisticDirectoryContainsFile(userModuleLibDir, coreModule.getJarFile())) {

// 如果是系统模块目录则跳过
if(isOptimisticDirectoryContainsFile(systemModuleLibDir, coreModule.getJarFile())) {
continue;
}
//
// // 如果不是用户模块目录,忽略
// if (!isOptimisticDirectoryContainsFile(userModuleLibDir, coreModule.getJarFile())) {
// continue;
// }
// 如果CRC32已经在这次待加载的集合中,则说明这个文件没有变动,忽略
if (checksumCRC32s.contains(moduleClassLoader.getChecksumCRC32())) {
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@
import com.alibaba.jvm.sandbox.core.util.matcher.structure.ClassStructure;
import org.apache.commons.lang3.ArrayUtils;

import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.*;

import static com.alibaba.jvm.sandbox.api.filter.AccessFlags.*;

Expand Down Expand Up @@ -45,7 +42,7 @@ private String[] toJavaClassNameArray(final Collection<ClassStructure> classStru
if (null == classStructures) {
return null;
}
final Set<String> javaClassNames = new LinkedHashSet<String>();
final List<String> javaClassNames = new ArrayList<String>();
for (final ClassStructure classStructure : classStructures) {
javaClassNames.add(classStructure.getJavaClassName());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.0.3
0.1.0.4
5 changes: 3 additions & 2 deletions sandbox-debug-module/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
<parent>
<groupId>com.alibaba.jvm.sandbox</groupId>
<artifactId>sandbox-module-starter</artifactId>
<version>1.0.11</version>
<version>1.0.12</version>
<relativePath>../sandbox-module-starter/pom.xml</relativePath>
</parent>
<artifactId>sandbox-debug-module</artifactId>
<name>sandbox-debug-module ${project.version}</name>
<name>sandbox-debug-module ${sandbox.version}</name>

<build>
<finalName>sandbox-debug-module-${sandbox.version}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public void onEvent(Event event) throws Throwable {

try {
printer.println(String.format(
"concurrent-limit on [%s#%s] concurrent:%s.\nPress CTRL_C about it!",
"concurrent-limit on [%s#%s] concurrent:%s.\nPress CTRL_C abort it!",
cnPattern,
mnPattern,
concurrent
Expand Down Expand Up @@ -213,7 +213,7 @@ public void onEvent(Event event) throws Throwable {

try {
printer.println(String.format(
"rate-limit on [%s#%s] rate:%.2f(TPS).\nPress CTRL_C about it!",
"rate-limit on [%s#%s] rate:%.2f(TPS).\nPress CTRL_C abort it!",
cnPattern,
mnPattern,
rate
Expand Down Expand Up @@ -337,7 +337,7 @@ public void onEvent(Event event) throws Throwable {

try {
printer.println(String.format(
"exception on [%s#%s] exception: %s.\nPress CTRL_C about it!",
"exception on [%s#%s] exception: %s.\nPress CTRL_C abort it!",
cnPattern,
mnPattern,
exType.name()
Expand Down Expand Up @@ -414,7 +414,7 @@ public void onEvent(Event event) throws Throwable {

try {
printer.println(String.format(
"delay on [%s#%s] %s(ms).\nPress CTRL_C about it!",
"delay on [%s#%s] %s(ms).\nPress CTRL_C abort it!",
cnPattern,
mnPattern,
delayMs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ protected void afterCallThrowing(final Advice advice,

try {
printer.println(String.format(
"tracing on [%s#%s].\nPress CTRL_C about it!",
"tracing on [%s#%s].\nPress CTRL_C abort it!",
cnPattern,
mnPattern
));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ private void printlnByExpress(final Bind bind) {
});
try {
printer.println(String.format(
"watching on [%s#%s], at %s, watch:%s.\nPress CTRL_C about it!",
"watching on [%s#%s], at %s, watch:%s.\nPress CTRL_C abort it!",
cnPattern,
mnPattern,
triggers,
Expand Down
4 changes: 2 additions & 2 deletions sandbox-mgr-module/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<parent>
<artifactId>sandbox</artifactId>
<groupId>com.alibaba.jvm.sandbox</groupId>
<version>1.0.11</version>
<version>1.0.12</version>
</parent>
<artifactId>sandbox-mgr-module</artifactId>
<name>sandbox-mgr-module ${project.version}</name>
<name>sandbox-mgr-module ${sandbox.version}</name>

<build>
<finalName>sandbox-mgr-module-${project.version}</finalName>
Expand Down
4 changes: 2 additions & 2 deletions sandbox-mgr-provider/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<parent>
<artifactId>sandbox</artifactId>
<groupId>com.alibaba.jvm.sandbox</groupId>
<version>1.0.11</version>
<version>1.0.12</version>
</parent>
<artifactId>sandbox-mgr-provider</artifactId>
<name>sandbox-mgr-provider ${project.version}</name>
<name>sandbox-mgr-provider ${sandbox.version}</name>
<build>
<finalName>sandbox-mgr-provider-${project.version}</finalName>
<plugins>
Expand Down
6 changes: 3 additions & 3 deletions sandbox-module-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
<parent>
<groupId>com.alibaba.jvm.sandbox</groupId>
<artifactId>sandbox</artifactId>
<version>1.0.11</version>
<version>1.0.12</version>
</parent>
<artifactId>sandbox-module-starter</artifactId>
<name>sandbox-module-starter ${project.version}</name>
<name>sandbox-module-starter ${sandbox.version}</name>
<packaging>pom</packaging>

<build>
<finalName>sandbox-debug-module-${project.version}</finalName>
<finalName>${project.name}-${project.version}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
4 changes: 2 additions & 2 deletions sandbox-provider-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<parent>
<artifactId>sandbox</artifactId>
<groupId>com.alibaba.jvm.sandbox</groupId>
<version>1.0.11</version>
<version>1.0.12</version>
</parent>
<artifactId>sandbox-provider-api</artifactId>
<name>sandbox-provider-api ${project.version}</name>
<name>sandbox-provider-api ${sandbox.version}</name>

<dependencies>
<dependency>
Expand Down
4 changes: 2 additions & 2 deletions sandbox-spy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<parent>
<groupId>com.alibaba.jvm.sandbox</groupId>
<artifactId>sandbox</artifactId>
<version>1.0.11</version>
<version>1.0.12</version>
</parent>
<artifactId>sandbox-spy</artifactId>
<name>sandbox-spy ${project.version}</name>
<name>sandbox-spy ${sandbox.version}</name>

<build>
<finalName>sandbox-spy-${project.version}</finalName>
Expand Down

0 comments on commit 212cfb1

Please sign in to comment.