Skip to content

Commit

Permalink
Merge pull request alibaba#61 from alibaba/develop-for-spine
Browse files Browse the repository at this point in the history
Develop for spine
  • Loading branch information
dongchenxu authored Feb 26, 2018
2 parents abb9eba + a9d9885 commit 8b559b6
Show file tree
Hide file tree
Showing 102 changed files with 7,384 additions and 2,476 deletions.
21 changes: 21 additions & 0 deletions bin/set-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

while getopts "sr" ARG
do
case ${ARG} in
s)
OP_SNAPSHOT=1;
shift $((OPTIND-1))
;;
r)
OP_RELEASE=1;
shift $((OPTIND-1))
;;
esac
done

[[ ${OP_SNAPSHOT} ]] && NEW_VERSION=${1}-"SNAPSHOT"
[[ ${OP_RELEASE} ]] && NEW_VERSION=${1}

echo "set project to new version: ${NEW_VERSION}"
mvn -f ../pom.xml versions:set -DoldVersion=* -DnewVersion=${NEW_VERSION} -DprocessAllModules=true -DallowSnapshots=true
94 changes: 52 additions & 42 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,29 @@

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

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

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<sandbox.api.version>1.0.9</sandbox.api.version>
<sandbox.provider.api.version>1.0.1</sandbox.provider.api.version>
<sandbox.common.api.version>1.0.2</sandbox.common.api.version>
</properties>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-5</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -85,37 +95,40 @@
</plugins>
</build>

<modules>
<module>sandbox-agent</module>
<module>sandbox-core</module>
<module>sandbox-api</module>
<module>sandbox-spy</module>
<module>sandbox-mgr-module</module>
<module>sandbox-provider-api</module>
<module>sandbox-common-api</module>
<module>sandbox-mgr-provider</module>
<module>sandbox-module-starter</module>
<module>sandbox-debug-module</module>
</modules>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.9</version>
</dependency>
<dependency>
<groupId>com.alibaba.jvm.sandbox</groupId>
<artifactId>sandbox-api</artifactId>
<version>${sandbox.api.version}</version>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba.jvm.sandbox</groupId>
<artifactId>sandbox-provider-api</artifactId>
<version>${sandbox.provider.api.version}</version>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba.jvm.sandbox</groupId>
<artifactId>sandbox-common-api</artifactId>
<version>${sandbox.common.api.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba.jvm.sandbox</groupId>
<artifactId>sandbox-util</artifactId>
<version>1.0.0</version>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba.jvm.sandbox</groupId>
<artifactId>sandbox-spy</artifactId>
<version>1.0.0</version>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down Expand Up @@ -160,17 +173,17 @@
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>8.0.4.v20111024</version>
<version>8.2.0.v20160908</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
<version>8.0.4.v20111024</version>
<version>8.2.0.v20160908</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-websocket</artifactId>
<version>8.0.4.v20111024</version>
<version>8.2.0.v20160908</version>
</dependency>

<!-- asm -->
Expand Down Expand Up @@ -208,24 +221,17 @@
<version>1.2</version>
</dependency>

<dependency>
<groupId>org.kohsuke.metainf-services</groupId>
<artifactId>metainf-services</artifactId>
<version>1.7</version>
<scope>compile</scope>
</dependency>

</dependencies>
</dependencyManagement>


<modules>
<module>sandbox-agent</module>
<module>sandbox-core</module>
<module>sandbox-api</module>
<module>sandbox-spy</module>
<module>sandbox-util</module>
<module>sandbox-debug-module</module>
<module>sandbox-mgr-module</module>
<module>sandbox-provider-api</module>
<module>sandbox-common-api</module>
<module>sandbox-mgr-provider</module>
</modules>


<!-- 这里是为了发布到MAVEN中央仓库所做的配置 -->
<distributionManagement>
<snapshotRepository>
Expand All @@ -238,8 +244,8 @@
</repository>
</distributionManagement>

<description>Alibaba JVM-Sandbox OpenSource Project</description>
<url>https://github.com/alibaba/JVM-Sandbox</url>
<description>Alibaba jvm-sandbox OpenSource Project</description>
<url>https://github.com/alibaba/jvm-Sandbox</url>

<licenses>
<license>
Expand All @@ -248,6 +254,11 @@
</license>
</licenses>

<organization>
<name>Alibaba Open Source</name>
<url>https://github.com/alibaba</url>
</organization>

<developers>
<developer>
<name>luanjia</name>
Expand All @@ -262,11 +273,10 @@
</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>



</project>
</project>
9 changes: 8 additions & 1 deletion sandbox-agent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.alibaba.jvm.sandbox</groupId>
<artifactId>sandbox</artifactId>
<version>1.0.0</version>
<version>1.0.11</version>
</parent>
<artifactId>sandbox-agent</artifactId>
<name>sandbox-agent ${project.version}</name>
Expand Down Expand Up @@ -39,6 +39,13 @@
</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
14 changes: 6 additions & 8 deletions sandbox-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,20 @@
<parent>
<groupId>com.alibaba.jvm.sandbox</groupId>
<artifactId>sandbox</artifactId>
<version>1.0.0</version>
<version>1.0.11</version>
</parent>
<artifactId>sandbox-api</artifactId>
<version>${sandbox.api.version}</version>
<name>sandbox-api ${sandbox.api.version}</name>
<name>sandbox-api ${project.version}</name>

<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.alibaba.jvm.sandbox</groupId>
<artifactId>sandbox-common-api</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.alibaba.jvm.sandbox.api;

/**
* 模块加载完成回调
* <p>
* 因{@link #loadCompleted()}方法比较常用,所以单独出来成为一个接口,
* 原有方法语意、触发时机保持不变
* </p>
*
* @author luanjia@taobao.com
* @since {@code sandbox-api:1.0.10}
*/
public interface LoadCompleted {

/**
* 模块加载完成,模块完成加载后调用!
* <p>
* 模块完成加载是在模块完成所有资源加载、分配之后的回调,在模块生命中期中有且只会调用一次。
* 这里抛出异常不会影响模块被加载成功的结果。
* </p>
* <p>
* 模块加载完成之后,所有的基于模块的操作都可以在这个回调中进行
* </p>
*/
void loadCompleted();

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* @author luanjia@taobao.com
*/
public interface ModuleLifecycle {
public interface ModuleLifecycle extends LoadCompleted {

/**
* 模块加载,模块开始加载之前调用!
Expand All @@ -18,18 +18,6 @@ public interface ModuleLifecycle {
*/
void onLoad() throws Throwable;

/**
* 模块加载完成,模块完成加载后调用!
* <p>
* 模块完成加载是在模块完成所有资源加载、分配之后的回调,在模块生命中期中有且只会调用一次。
* 这里抛出异常不会影响模块被加载成功的结果。
* </p>
* <p>
* 模块加载完成之后,所有的基于模块的操作都可以在这个回调中进行
* </p>
*/
void loadCompleted();

/**
* 模块卸载,模块开始卸载之前调用!
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public Object getRespond() {
}

@Override
public synchronized Throwable fillInStackTrace() {
public Throwable fillInStackTrace() {
return null;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.alibaba.jvm.sandbox.api;

import static com.alibaba.jvm.sandbox.api.ProcessControlException.throwReturnImmediately;

/**
* 流程控制
* <p>
* 用于控制事件处理器处理事件走向
* </p>
* <p>
* 之前写的{@link ProcessControlException}进行流程控制,但命名不太规范,所以这里重命名一个类
* </p>
*
* @author luanjia@taobao.com
* @since {@code sandbox-api:1.0.10}
*/
public final class ProcessController {

/**
* 中断当前代码处理流程,并立即返回指定对象
*
* @param object 返回对象
* @throws ProcessControlException 抛出立即返回流程控制异常
*/
public static void returnImmediately(final Object object) throws ProcessControlException {
throwReturnImmediately(object);
}

/**
* 中断当前代码处理流程,并抛出指定异常
*
* @param throwable 指定异常
* @throws ProcessControlException 抛出立即抛出异常流程控制异常
*/
public static void throwsImmediately(final Throwable throwable) throws ProcessControlException {
ProcessControlException.throwThrowsImmediately(throwable);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.alibaba.jvm.sandbox.api.annotation;

import com.alibaba.jvm.sandbox.api.filter.Filter;

import java.lang.annotation.*;

/**
* 拥有此标记的{@link Filter},
* 将能匹配到来自{@code BootstrapClassLoader}所加载的类
*
* @author luanjia@taobao.com
* @since {@code sandbox-api:1.0.10}
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Inherited
public @interface IncludeBootstrap {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.alibaba.jvm.sandbox.api.annotation;

import com.alibaba.jvm.sandbox.api.filter.Filter;

import java.lang.annotation.*;

/**
* 拥有此标注的{@link Filter}将能匹配到目标类的子类
*
* @author luanjia@taobao.com
* @since {@code sandbox-api:1.0.10}
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Inherited
public @interface IncludeSubClasses {
}
Loading

0 comments on commit 8b559b6

Please sign in to comment.