From 0db9382c50d6b8aafa5335210524e93f8303dd1d Mon Sep 17 00:00:00 2001 From: dukun Date: Wed, 15 Nov 2017 17:06:13 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BC=98=E5=8C=96pom=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E7=BB=93=E6=9E=84=202.=20=E4=BC=98=E5=8C=96=E9=83=A8=E5=88=86?= =?UTF-8?q?=E4=B8=8D=E6=AD=A3=E7=A1=AE=E7=9A=84=E6=B3=A8=E8=A7=86=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=203.=20=E4=BC=98=E5=8C=96package=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E9=80=BB=E8=BE=91=EF=BC=8C=E6=9B=B4=E4=B8=A5=E8=B0=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/sandbox-packages.sh | 20 ++++---- pom.xml | 50 ++++++++++++------ sandbox-agent/pom.xml | 19 ++----- sandbox-api/pom.xml | 51 ++----------------- sandbox-common-api/pom.xml | 49 +----------------- sandbox-core/pom.xml | 17 +------ .../jvm/sandbox/core/CoreConfigure.java | 2 +- .../classloader/RoutingURLClassLoader.java | 2 +- .../jvm/sandbox/core/enhance/Enhancer.java | 2 +- .../core/enhance/UnCaughtException.java | 2 +- .../core/enhance/annotation/Interrupted.java | 2 +- .../sandbox/core/enhance/weaver/CodeLock.java | 4 +- .../core/enhance/weaver/asm/AsmCodeLock.java | 4 +- .../core/enhance/weaver/asm/AsmMethods.java | 2 +- .../core/enhance/weaver/asm/AsmTypes.java | 2 +- .../core/enhance/weaver/asm/EventWeaver.java | 2 +- .../enhance/weaver/asm/ReWriteMethod.java | 2 +- .../core/manager/ModuleLifeCycleEventBus.java | 2 +- .../core/manager/ModuleResourceManager.java | 2 +- .../impl/DefaultCoreModuleManager.java | 4 +- .../core/manager/impl/ModuleJarLoader.java | 2 +- .../jetty/servlet/ModuleHttpServlet.java | 6 +-- .../servlet/WebSocketAcceptorServlet.java | 2 +- .../jvm/sandbox/core/util/FeatureCodec.java | 8 +-- .../jvm/sandbox/core/util/Initializer.java | 8 +-- .../jvm/sandbox/core/util/NetworkUtils.java | 1 + .../jvm/sandbox/core/util/ObjectIDs.java | 4 +- .../core/util/SandboxReflectUtils.java | 6 +-- .../jvm/sandbox/core/util/Sequencer.java | 2 +- .../sandbox/core/util/collection/GaStack.java | 2 +- .../util/collection/ThreadUnsafeGaStack.java | 6 +-- sandbox-debug-module/pom.xml | 21 ++------ sandbox-mgr-module/pom.xml | 19 ++----- sandbox-mgr-provider/pom.xml | 20 ++------ sandbox-provider-api/pom.xml | 50 +----------------- sandbox-spy/pom.xml | 18 +------ .../java/com/alibaba/jvm/sandbox/spy/Spy.java | 12 +++-- sandbox-util/pom.xml | 22 +------- 38 files changed, 119 insertions(+), 330 deletions(-) diff --git a/bin/sandbox-packages.sh b/bin/sandbox-packages.sh index cc2ad445..c191a26a 100755 --- a/bin/sandbox-packages.sh +++ b/bin/sandbox-packages.sh @@ -29,13 +29,13 @@ mkdir -p ${SANDBOX_TARGET_DIR}/provider # copy jar to TARGET_DIR -cp ../sandbox-core/target/sandbox-core-*-jar-with-dependencies.jar ${SANDBOX_TARGET_DIR}/lib/sandbox-core.jar -cp ../sandbox-agent/target/sandbox-agent-jar-with-dependencies.jar ${SANDBOX_TARGET_DIR}/lib/sandbox-agent.jar -cp ../sandbox-spy/target/sandbox-spy-*-jar-with-dependencies.jar ${SANDBOX_TARGET_DIR}/lib/sandbox-spy.jar -cp sandbox-logback.xml ${SANDBOX_TARGET_DIR}/cfg/sandbox-logback.xml -cp sandbox.properties ${SANDBOX_TARGET_DIR}/cfg/sandbox.properties -cp sandbox.sh ${SANDBOX_TARGET_DIR}/bin/sandbox.sh -cp install-local.sh ${SANDBOX_TARGET_DIR}/install-local.sh +cp ../sandbox-core/target/sandbox-core-*-jar-with-dependencies.jar ${SANDBOX_TARGET_DIR}/lib/sandbox-core.jar \ + && cp ../sandbox-agent/target/sandbox-agent-*-jar-with-dependencies.jar ${SANDBOX_TARGET_DIR}/lib/sandbox-agent.jar \ + && cp ../sandbox-spy/target/sandbox-spy-*-jar-with-dependencies.jar ${SANDBOX_TARGET_DIR}/lib/sandbox-spy.jar \ + && cp sandbox-logback.xml ${SANDBOX_TARGET_DIR}/cfg/sandbox-logback.xml \ + && cp sandbox.properties ${SANDBOX_TARGET_DIR}/cfg/sandbox.properties \ + && cp sandbox.sh ${SANDBOX_TARGET_DIR}/bin/sandbox.sh \ + && cp install-local.sh ${SANDBOX_TARGET_DIR}/install-local.sh echo "${SANDBOX_VERSION}" > ${SANDBOX_TARGET_DIR}/cfg/version # for test @@ -43,10 +43,8 @@ echo "${SANDBOX_VERSION}" > ${SANDBOX_TARGET_DIR}/cfg/version ## ${SANDBOX_TARGET_DIR}/module/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 -cp ../sandbox-mgr-provider/target/sandbox-mgr-provider-*-jar-with-dependencies.jar\ - ${SANDBOX_TARGET_DIR}/provider/sandbox-mgr-provider.jar +cp ../sandbox-mgr-module/target/sandbox-mgr-module-*-jar-with-dependencies.jar ${SANDBOX_TARGET_DIR}/module/sandbox-mgr-module.jar \ + && cp ../sandbox-mgr-provider/target/sandbox-mgr-provider-*-jar-with-dependencies.jar ${SANDBOX_TARGET_DIR}/provider/sandbox-mgr-provider.jar # make it execute able chmod +x ${SANDBOX_TARGET_DIR}/*.sh diff --git a/pom.xml b/pom.xml index 0e4bd8f1..69e16c45 100755 --- a/pom.xml +++ b/pom.xml @@ -3,14 +3,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - - com.alibaba.jvm.sandbox sandbox 1.0.0-SNAPSHOT @@ -37,6 +29,31 @@ true + + org.apache.maven.plugins + maven-javadoc-plugin + 3.0.0-M1 + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.0.1 + + + + jar-no-fork + + + + @@ -174,17 +191,18 @@ sandbox-mgr-provider - - - alibaba-releases - http://mvnrepo.alibaba-inc.com/mvn/releases - - alibaba-snapshots - http://mvnrepo.alibaba-inc.com/mvn/snapshots + luanjia-ossrh + https://oss.sonatype.org/content/repositories/snapshots + + luanjia-ossrh + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + - --> + diff --git a/sandbox-agent/pom.xml b/sandbox-agent/pom.xml index 746c1883..228b82c3 100755 --- a/sandbox-agent/pom.xml +++ b/sandbox-agent/pom.xml @@ -9,22 +9,11 @@ 1.0.0-SNAPSHOT sandbox-agent - 1.0.0-SNAPSHOT - sandbox-agent + sandbox-agent ${project.version} - sandbox-agent + sandbox-agent-${project.version} - - org.apache.maven.plugins - maven-compiler-plugin - - 1.6 - 1.6 - UTF-8 - true - - org.apache.maven.plugins maven-assembly-plugin @@ -52,7 +41,5 @@ - - UTF-8 - + diff --git a/sandbox-api/pom.xml b/sandbox-api/pom.xml index 9ddb839d..5cc00c8c 100755 --- a/sandbox-api/pom.xml +++ b/sandbox-api/pom.xml @@ -10,51 +10,8 @@ sandbox-api ${sandbox.api.version} - sandbox-api - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.0.0-M1 - - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.6 - 1.6 - UTF-8 - true - - - - org.apache.maven.plugins - maven-source-plugin - 3.0.1 - - - - jar-no-fork - - - - - - + sandbox-api ${sandbox.api.version} + javax.servlet @@ -66,7 +23,5 @@ sandbox-common-api - - UTF-8 - + diff --git a/sandbox-common-api/pom.xml b/sandbox-common-api/pom.xml index 1b1795c3..8049de18 100644 --- a/sandbox-common-api/pom.xml +++ b/sandbox-common-api/pom.xml @@ -10,52 +10,5 @@ sandbox-common-api ${sandbox.common.api.version} - sandbox-common-api - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.0.0-M1 - - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.6 - 1.6 - UTF-8 - true - - - - org.apache.maven.plugins - maven-source-plugin - 3.0.1 - - - - jar-no-fork - - - - - - - - UTF-8 - + sandbox-common-api ${sandbox.common.api.version} diff --git a/sandbox-core/pom.xml b/sandbox-core/pom.xml index 64e95858..468f4ab6 100755 --- a/sandbox-core/pom.xml +++ b/sandbox-core/pom.xml @@ -9,21 +9,11 @@ 1.0.0-SNAPSHOT sandbox-core - 1.0.0-SNAPSHOT - sandbox-core + sandbox-core ${project.version} + sandbox-core-${project.version} - - org.apache.maven.plugins - maven-compiler-plugin - - 1.6 - 1.6 - UTF-8 - true - - org.apache.maven.plugins maven-assembly-plugin @@ -134,7 +124,4 @@ ant - - UTF-8 - diff --git a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/CoreConfigure.java b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/CoreConfigure.java index b659928e..d74f011d 100755 --- a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/CoreConfigure.java +++ b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/CoreConfigure.java @@ -215,7 +215,7 @@ private boolean isLaunchByAttachMode() { } /** - * 获取沙箱的启动模式
+ * 获取沙箱的启动模式 * 默认按照ATTACH模式启动 * * @return 沙箱的启动模式 diff --git a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/classloader/RoutingURLClassLoader.java b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/classloader/RoutingURLClassLoader.java index 22dbad71..ee193d54 100644 --- a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/classloader/RoutingURLClassLoader.java +++ b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/classloader/RoutingURLClassLoader.java @@ -96,7 +96,7 @@ public Routing(final ClassLoader classLoader, final String... regexExpressArray) } /** - * 当前参与匹配的Java类名是否命中路由匹配规则
+ * 当前参与匹配的Java类名是否命中路由匹配规则 * 命中匹配规则的类加载,将会从此ClassLoader中完成对应的加载行为 * * @param javaClassName 参与匹配的Java类名 diff --git a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/enhance/Enhancer.java b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/enhance/Enhancer.java index 18bb3395..a1002662 100755 --- a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/enhance/Enhancer.java +++ b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/enhance/Enhancer.java @@ -7,7 +7,7 @@ public interface Enhancer { /** - * 转换为增强后的字节码数组
+ * 转换为增强后的字节码数组 * * @param loader 目标类加载器 * @param srcByteCodeArray 源字节码数组 diff --git a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/enhance/UnCaughtException.java b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/enhance/UnCaughtException.java index e25356cb..b4455e8c 100755 --- a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/enhance/UnCaughtException.java +++ b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/enhance/UnCaughtException.java @@ -1,7 +1,7 @@ package com.alibaba.jvm.sandbox.core.enhance; /** - * 未捕获异常
+ * 未捕获异常 * 用来封装不希望抛出的异常 * Created by luanjia@taobao.com on 16/5/21. */ diff --git a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/enhance/annotation/Interrupted.java b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/enhance/annotation/Interrupted.java index 7ee24c0a..df1657ba 100755 --- a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/enhance/annotation/Interrupted.java +++ b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/enhance/annotation/Interrupted.java @@ -3,7 +3,7 @@ import java.lang.annotation.*; /** - * 中断式事件处理器
+ * 中断式事件处理器 * 当事件处理器处理事件抛出异常时,将会中断原有方法调用 * Created by luanjia@taobao.com on 16/7/26. */ diff --git a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/enhance/weaver/CodeLock.java b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/enhance/weaver/CodeLock.java index 90a7cc16..48f455c9 100755 --- a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/enhance/weaver/CodeLock.java +++ b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/enhance/weaver/CodeLock.java @@ -1,7 +1,7 @@ package com.alibaba.jvm.sandbox.core.enhance.weaver; /** - * 代码锁
+ * 代码锁 * 什么叫代码锁?代码锁的出现是由于在字节码中,我们无法用简单的if语句来判定这段代码是生成的还是原有的。 * 这会导致一些监控逻辑的混乱,比如trace命令如果不使用代码锁保护,将能看到Greys所植入的代码并进行跟踪 * Created by oldmanpushcart@gmail.com on 15/5/28. @@ -9,7 +9,7 @@ public interface CodeLock { /** - * 根据字节码流锁或解锁代码
+ * 根据字节码流锁或解锁代码 * 通过对字节码流的判断,决定当前代码是锁定和解锁 * * @param opcode 字节码 diff --git a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/enhance/weaver/asm/AsmCodeLock.java b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/enhance/weaver/asm/AsmCodeLock.java index 7d7f61de..f325c50f 100755 --- a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/enhance/weaver/asm/AsmCodeLock.java +++ b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/enhance/weaver/asm/AsmCodeLock.java @@ -5,7 +5,7 @@ import org.objectweb.asm.commons.AdviceAdapter; /** - * ASM代码锁
+ * ASM代码锁 * Created by oldmanpushcart@gmail.com on 15/5/28. */ public class AsmCodeLock implements CodeLock, Opcodes { @@ -71,7 +71,7 @@ public void code(int code) { } /* - * 重置索引
+ * 重置索引 * 一般在代码序列判断失败时,则会对索引进行重置,冲头开始匹配特征序列 */ private void reset() { diff --git a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/enhance/weaver/asm/AsmMethods.java b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/enhance/weaver/asm/AsmMethods.java index ab6ab138..49193171 100755 --- a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/enhance/weaver/asm/AsmMethods.java +++ b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/enhance/weaver/asm/AsmMethods.java @@ -8,7 +8,7 @@ import static com.alibaba.jvm.sandbox.core.util.SandboxReflectUtils.unCaughtGetClassDeclaredJavaMethod; /** - * 常用的ASM method 集合
+ * 常用的ASM method 集合 * 省得我到处声明 * Created by luanjia@taobao.com on 16/5/21. */ diff --git a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/enhance/weaver/asm/AsmTypes.java b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/enhance/weaver/asm/AsmTypes.java index 4db46644..3af30ccd 100755 --- a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/enhance/weaver/asm/AsmTypes.java +++ b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/enhance/weaver/asm/AsmTypes.java @@ -5,7 +5,7 @@ import java.com.alibaba.jvm.sandbox.spy.Spy; /** - * 常用的ASM type集合
+ * 常用的ASM type集合 * 省得我到处声明 * Created by luanjia@taobao.com on 16/5/21. */ diff --git a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/enhance/weaver/asm/EventWeaver.java b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/enhance/weaver/asm/EventWeaver.java index f27f2c54..7145ed05 100755 --- a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/enhance/weaver/asm/EventWeaver.java +++ b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/enhance/weaver/asm/EventWeaver.java @@ -237,7 +237,7 @@ private void processControl() { } /** - * 加载ClassLoader
+ * 加载ClassLoader * 这里分开静态方法中ClassLoader的获取以及普通方法中ClassLoader的获取 * 主要是性能上的考虑 */ diff --git a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/enhance/weaver/asm/ReWriteMethod.java b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/enhance/weaver/asm/ReWriteMethod.java index 0a527b41..6ea96cb5 100755 --- a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/enhance/weaver/asm/ReWriteMethod.java +++ b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/enhance/weaver/asm/ReWriteMethod.java @@ -6,7 +6,7 @@ import org.objectweb.asm.commons.AdviceAdapter; /** - * 方法重写
+ * 方法重写 * ReWriteJavaMethod * Created by luanjia@taobao.com on 16/5/20. */ diff --git a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/manager/ModuleLifeCycleEventBus.java b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/manager/ModuleLifeCycleEventBus.java index 3ddb286e..af3940b0 100755 --- a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/manager/ModuleLifeCycleEventBus.java +++ b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/manager/ModuleLifeCycleEventBus.java @@ -9,7 +9,7 @@ public interface ModuleLifeCycleEventBus { /** - * 添加模块生命周期监听器
+ * 添加模块生命周期监听器 *

被添加的监听器将按顺序完成生命周期的通知

* * @param lifeCycleEventListener 模块生命周期监听 diff --git a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/manager/ModuleResourceManager.java b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/manager/ModuleResourceManager.java index b9edce0e..60d6002a 100755 --- a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/manager/ModuleResourceManager.java +++ b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/manager/ModuleResourceManager.java @@ -5,7 +5,7 @@ import java.lang.ref.WeakReference; /** - * 模块可释放资源管理
+ * 模块可释放资源管理 * 通常用来管理围绕Module所展开的http/websocket连接 * Created by luanjia@taobao.com on 2017/2/4. */ diff --git a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/manager/impl/DefaultCoreModuleManager.java b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/manager/impl/DefaultCoreModuleManager.java index 09df0740..f805d9bb 100755 --- a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/manager/impl/DefaultCoreModuleManager.java +++ b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/manager/impl/DefaultCoreModuleManager.java @@ -551,7 +551,7 @@ private boolean isChecksumCRC32Existed(long checksumCRC32) { } /** - * 软刷新
+ * 软刷新 * 找出有变动的模块文件,有且仅有改变这些文件所对应的模块 * * @throws ModuleException 模块操作失败 @@ -617,7 +617,7 @@ private void softFlush() throws ModuleException { } /** - * 强制刷新
+ * 强制刷新 * 对所有已经加载的用户模块进行强行卸载并重新加载 * * @throws ModuleException 模块操作失败 diff --git a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/manager/impl/ModuleJarLoader.java b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/manager/impl/ModuleJarLoader.java index 774366fa..c21d1e39 100755 --- a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/manager/impl/ModuleJarLoader.java +++ b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/manager/impl/ModuleJarLoader.java @@ -17,7 +17,7 @@ import static org.apache.commons.io.FileUtils.listFiles; /** - * 模块加载器
+ * 模块加载器 * 用于从${module.lib}中加载所有的沙箱模块 * Created by luanjia@taobao.com on 2016/11/17. */ diff --git a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/server/jetty/servlet/ModuleHttpServlet.java b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/server/jetty/servlet/ModuleHttpServlet.java index 85270837..8cf07b7b 100755 --- a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/server/jetty/servlet/ModuleHttpServlet.java +++ b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/server/jetty/servlet/ModuleHttpServlet.java @@ -143,7 +143,7 @@ public void release() { /** - * 提取模块ID
+ * 提取模块ID * 模块ID应该在PATH的第一个位置 * * @param path servlet访问路径 @@ -158,7 +158,7 @@ private String parseUniqueId(final String path) { /** - * 匹配模块中复合HTTP请求路径的方法
+ * 匹配模块中复合HTTP请求路径的方法 * 匹配方法的方式是:HttpMethod和HttpPath全匹配 * * @param path HTTP请求路径 @@ -186,7 +186,7 @@ private Method matchingModuleMethod(final String path, /** - * 生成方法请求参数数组
+ * 生成方法请求参数数组 * 主要用于填充HttpServletRequest和HttpServletResponse * * @param method 模块Java方法 diff --git a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/server/jetty/servlet/WebSocketAcceptorServlet.java b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/server/jetty/servlet/WebSocketAcceptorServlet.java index a6311790..46bca6e6 100755 --- a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/server/jetty/servlet/WebSocketAcceptorServlet.java +++ b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/server/jetty/servlet/WebSocketAcceptorServlet.java @@ -38,7 +38,7 @@ public WebSocketAcceptorServlet(final CoreModuleManager coreModuleManager, /** - * 构造模块的WebSocket通讯连接
+ * 构造模块的WebSocket通讯连接 *

对应的模块必须实现了{@link WebSocketAcceptor}接口

*

访问的路径为/sandbox/module/websocket/MODULE_NAME

* diff --git a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/util/FeatureCodec.java b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/util/FeatureCodec.java index f29cfcf7..56ab7432 100755 --- a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/util/FeatureCodec.java +++ b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/util/FeatureCodec.java @@ -14,14 +14,14 @@ public class FeatureCodec { /** - * KV片段分割符
+ * KV片段分割符 * KV片段定义为一个完整的KV对,例如字符串;k1=v1;k2=v2; * 其中;即为KV片段分隔符 */ private final char kvSegmentSeparator; /** - * KV分割符
+ * KV分割符 * KV定义为一个KV对区分K和V的分割符号,例如字符串k1=v1 * 其中=即为KV分隔符 */ @@ -33,7 +33,7 @@ public class FeatureCodec { private final char ESCAPE_PREFIX_CHAR = '\\'; /** - * 使用指定的KV分割符构造FeatureParser
+ * 使用指定的KV分割符构造FeatureParser * * @param kvSegmentSeparator KV对之间的分隔符 * @param kvSeparator K与V之间的分隔符 @@ -177,7 +177,7 @@ public Map toMap(final String featureString) { /** - * 是否特殊字符
+ * 是否特殊字符 * 特殊字符是指需要被转义的,用于features内部字段控制的字符 */ private boolean isSpecialChar(final char c) { diff --git a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/util/Initializer.java b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/util/Initializer.java index f1b42b4a..bb205e10 100755 --- a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/util/Initializer.java +++ b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/util/Initializer.java @@ -4,7 +4,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock; /** - * 初始化工具
+ * 初始化工具 * 线程安全 * Created by luanjia@taobao.com on 15/11/20. */ @@ -123,13 +123,13 @@ public final void destroyProcess(final Processor processor) throws Throwable { } /** - * 状态枚举
+ * 状态枚举 *

- * 非循环状态
+ * 非循环状态 * NEW -> INITIALIZED -> DESTROYED *

*

- * 循环状态
+ * 循环状态 * NEW -> INITIALIZED -> NEW *

*/ diff --git a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/util/NetworkUtils.java b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/util/NetworkUtils.java index 0dc80087..775c90cb 100644 --- a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/util/NetworkUtils.java +++ b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/util/NetworkUtils.java @@ -16,6 +16,7 @@ public class NetworkUtils { * 测试主机Host的port端口是否被使用 * @param host 指定IP * @param port 指定端口 + * @return TRUE:端口已经被占用;FALSE:端口尚未被占用 */ public static boolean isPortInUsing(String host, int port) { Socket socket = null; diff --git a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/util/ObjectIDs.java b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/util/ObjectIDs.java index 427eae31..1e38ea81 100644 --- a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/util/ObjectIDs.java +++ b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/util/ObjectIDs.java @@ -164,9 +164,7 @@ public T getObject(final int objectID) { } - /** - * 带ObjectID标记的弱对象引用 - */ + // 带ObjectID标记的弱对象引用 private class IdentityWeakReference extends WeakReference { // 对应的对象ID diff --git a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/util/SandboxReflectUtils.java b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/util/SandboxReflectUtils.java index d6c97543..7a628f93 100755 --- a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/util/SandboxReflectUtils.java +++ b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/util/SandboxReflectUtils.java @@ -13,7 +13,7 @@ public class SandboxReflectUtils { /** - * 获取Java类的方法
+ * 获取Java类的方法 * 该方法不会抛出任何声明式异常 * * @param clazz 类 @@ -92,8 +92,8 @@ public static void unCaughtSetClassDeclaredJavaFieldValue(final Class clazz, * @param javaClassName 类名称 * @param classByteArray 类字节码数组 * @return 定义的类 - * @throws InvocationTargetException - * @throws IllegalAccessException + * @throws InvocationTargetException 目标方法调用发生异常 + * @throws IllegalAccessException 目标方法不可进入 */ public static Class defineClass(final ClassLoader loader, final String javaClassName, diff --git a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/util/Sequencer.java b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/util/Sequencer.java index 6c23ed0d..c1ea19be 100755 --- a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/util/Sequencer.java +++ b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/util/Sequencer.java @@ -3,7 +3,7 @@ import java.util.concurrent.atomic.AtomicInteger; /** - * 序列发生器
+ * 序列发生器 * 序列发生器用途非常广泛,主要用于圈定全局唯一性标识 * Created by luanjia@taobao.com on 16/5/20. */ diff --git a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/util/collection/GaStack.java b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/util/collection/GaStack.java index 4ded0c27..9ae9de25 100755 --- a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/util/collection/GaStack.java +++ b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/util/collection/GaStack.java @@ -4,7 +4,7 @@ * 堆栈 * Created by luanjia@taobao.com on 15/6/21. * - * @param + * @param 堆栈元素类型 */ public interface GaStack { diff --git a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/util/collection/ThreadUnsafeGaStack.java b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/util/collection/ThreadUnsafeGaStack.java index 520b555c..e5140bcd 100755 --- a/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/util/collection/ThreadUnsafeGaStack.java +++ b/sandbox-core/src/main/java/com/alibaba/jvm/sandbox/core/util/collection/ThreadUnsafeGaStack.java @@ -5,11 +5,11 @@ import static java.lang.System.arraycopy; /** - * 线程不安全不固定栈深的堆栈实现
+ * 线程不安全不固定栈深的堆栈实现 * 比默认的实现带来3倍的性能提升 * Created by luanjia@taobao.com on 15/6/21. * - * @param + * @param 堆栈元素类型 */ public class ThreadUnsafeGaStack implements GaStack { @@ -29,7 +29,7 @@ public ThreadUnsafeGaStack(int stackSize) { /** - * 自动扩容
+ * 自动扩容 * 当前堆栈最大深度不满足期望时会自动扩容(2倍扩容) * * @param expectDeep 期望堆栈深度 diff --git a/sandbox-debug-module/pom.xml b/sandbox-debug-module/pom.xml index d40cf50c..9dc4f8a3 100755 --- a/sandbox-debug-module/pom.xml +++ b/sandbox-debug-module/pom.xml @@ -9,22 +9,11 @@ 1.0.0-SNAPSHOT sandbox-debug-module - 1.0.0-SNAPSHOT - sandbox-debug-module - http://maven.apache.org + sandbox-debug-module ${project.version} + sandbox-debug-module-${project.version} - - org.apache.maven.plugins - maven-compiler-plugin - - 1.6 - 1.6 - UTF-8 - true - - org.apache.maven.plugins maven-assembly-plugin @@ -84,13 +73,13 @@ commons-collections commons-collections + + ognl ognl 3.0.8 + - - UTF-8 - diff --git a/sandbox-mgr-module/pom.xml b/sandbox-mgr-module/pom.xml index 2b749690..de0d5836 100755 --- a/sandbox-mgr-module/pom.xml +++ b/sandbox-mgr-module/pom.xml @@ -9,22 +9,11 @@ 1.0.0-SNAPSHOT sandbox-mgr-module - 1.0.0-SNAPSHOT - sandbox-mgr-module - http://maven.apache.org + sandbox-mgr-module ${project.version} + sandbox-mgr-module-${project.version} - - org.apache.maven.plugins - maven-compiler-plugin - - 1.6 - 1.6 - UTF-8 - true - - org.apache.maven.plugins maven-assembly-plugin @@ -73,7 +62,5 @@ commons-lang3 - - UTF-8 - + diff --git a/sandbox-mgr-provider/pom.xml b/sandbox-mgr-provider/pom.xml index a603683b..fc6fb9e7 100644 --- a/sandbox-mgr-provider/pom.xml +++ b/sandbox-mgr-provider/pom.xml @@ -9,20 +9,10 @@ 1.0.0-SNAPSHOT sandbox-mgr-provider - 1.0.0-SNAPSHOT - sandbox-mgr-provider + sandbox-mgr-provider ${project.version} + sandbox-mgr-provider-${project.version} - - org.apache.maven.plugins - maven-compiler-plugin - - 1.6 - 1.6 - UTF-8 - true - - org.apache.maven.plugins maven-assembly-plugin @@ -42,11 +32,11 @@ + junit junit - 3.8.1 test @@ -54,7 +44,5 @@ sandbox-provider-api - - UTF-8 - + diff --git a/sandbox-provider-api/pom.xml b/sandbox-provider-api/pom.xml index fa08069c..9148bf98 100644 --- a/sandbox-provider-api/pom.xml +++ b/sandbox-provider-api/pom.xml @@ -10,54 +10,8 @@ sandbox-provider-api ${sandbox.provider.api.version} - sandbox-provider-api - - UTF-8 - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.0.0-M1 - - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.6 - 1.6 - UTF-8 - true - - - - org.apache.maven.plugins - maven-source-plugin - 3.0.1 - - - - jar-no-fork - - - - - - + sandbox-provider-api ${sandbox.provider.api.version} + com.alibaba.jvm.sandbox diff --git a/sandbox-spy/pom.xml b/sandbox-spy/pom.xml index d93d0c53..0deb4fe8 100755 --- a/sandbox-spy/pom.xml +++ b/sandbox-spy/pom.xml @@ -9,25 +9,11 @@ 1.0.0-SNAPSHOT sandbox-spy - 1.0.0-SNAPSHOT - sandbox-spy - - - UTF-8 - + sandbox-spy ${project.version} + sandbox-spy-${project.version} - - org.apache.maven.plugins - maven-compiler-plugin - - 1.6 - 1.6 - UTF-8 - true - - org.apache.maven.plugins maven-assembly-plugin diff --git a/sandbox-spy/src/main/java/java/com/alibaba/jvm/sandbox/spy/Spy.java b/sandbox-spy/src/main/java/java/com/alibaba/jvm/sandbox/spy/Spy.java index bf713dd4..7de59a64 100755 --- a/sandbox-spy/src/main/java/java/com/alibaba/jvm/sandbox/spy/Spy.java +++ b/sandbox-spy/src/main/java/java/com/alibaba/jvm/sandbox/spy/Spy.java @@ -3,9 +3,7 @@ import java.lang.reflect.Method; /** - * 间谍类
- * 藏匿在各个ClassLoader中 - *

+ * 间谍类,藏匿在各个ClassLoader中 *

* 从{@code 0.0.0.v}版本之后,因为要考虑能在alipay的CloudEngine环境中使用,这个环境只能向上查找java.开头的包路径. * 所以这里只好把Spy的包路径前缀中增加了java.开头 @@ -26,6 +24,14 @@ public class Spy { /** * 初始化间谍 + * + * @param ON_BEFORE_METHOD ON_BEFORE 回调 + * @param ON_RETURN_METHOD ON_RETURN 回调 + * @param ON_THROWS_METHOD ON_THROWS 回调 + * @param ON_LINE_METHOD ON_LINE 回调 + * @param ON_CALL_BEFORE_METHOD ON_CALL_BEFORE 回调 + * @param ON_CALL_RETURN_METHOD ON_CALL_RETURN 回调 + * @param ON_CALL_THROWS_METHOD ON_CALL_THROWS 回调 */ public static void init(final Method ON_BEFORE_METHOD, final Method ON_RETURN_METHOD, diff --git a/sandbox-util/pom.xml b/sandbox-util/pom.xml index 905d38ff..dc45d02e 100755 --- a/sandbox-util/pom.xml +++ b/sandbox-util/pom.xml @@ -9,23 +9,7 @@ 1.0.0-SNAPSHOT sandbox-util - 1.0.0-SNAPSHOT - sandbox-util - - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.6 - 1.6 - UTF-8 - true - - - - + sandbox-util ${project.version} @@ -33,7 +17,5 @@ commons-lang3 - - UTF-8 - +