Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
68 changed files
with
3,005 additions
and
400 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,4 @@ | |
/.classpath | ||
/.idea | ||
/.DS_Store | ||
*.iml | ||
/bin/ | ||
*.iml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
@echo off | ||
echo -------------------------------------------- | ||
echo Create Titan Module Batch | ||
for /f "tokens=2 delims==" %%a in ('wmic path win32_operatingsystem get LocalDateTime /value') do ( | ||
set t=%%a | ||
) | ||
set Today=%t:~0,4%-%t:~4,2%-%t:~6,2% | ||
echo @version 1.0.%Today% | ||
echo @author Administrator | ||
echo -------------------------------------------- | ||
set /p systemName=Please insert your Titan Module English name£º | ||
echo -------------------------------------------- | ||
echo Titan Module creating£¬Please wait... | ||
echo -------------------------------------------- | ||
md %systemName%\src\main\java\com\mybank\bkcommon\collector\%systemName%\collector | ||
md %systemName%\src\main\java\com\mybank\bkcommon\collector\%systemName%\model | ||
md %systemName%\src\main\resources\META-INF\spring | ||
md %systemName%\src\main\resources\view | ||
md %systemName%\src\test\java\com\mybank\bkcommon\collector\%systemName% | ||
md %systemName%\src\test\resources\ | ||
copy project-template\helloworld.vm %systemName%\src\main\resources\view\helloworld.vm | ||
copy project-template\HelloWorld.java %systemName%\src\main\java\com\mybank\bkcommon\collector\%systemName%\model\HelloWorld.java | ||
copy project-template\HelloWorldCollector.java %systemName%\src\main\java\com\mybank\bkcommon\collector\%systemName%\collector\HelloWorldCollector.java | ||
copy project-template\pom-template.xml %systemName%\pom.xml | ||
copy project-template\integration.xml %systemName%\src\main\resources\META-INF\spring\integration.xml | ||
copy project-template\QuickStarter-template.java %systemName%\src\test\java\com\mybank\bkcommon\collector\%systemName%\QuickStarter.java | ||
copy project-template\integration-test.xml %systemName%\src\test\resources\integration-test.xml | ||
copy project-template\spring-template.xml %systemName%\src\main\resources\META-INF\spring\%systemName%.xml | ||
copy project-template\log4j-template.xml %systemName%\src\test\resources\log4j.xml | ||
copy project-template\log4j-main-template.xml %systemName%\src\main\resources\log4j.xml | ||
setlocal Enabledelayedexpansion | ||
call:changePath %systemName%\src\test\java\com\mybank\bkcommon\collector\%systemName%\QuickStarter.java | ||
call:changePath %systemName%\pom.xml | ||
call:changePath %systemName%\src\test\resources\integration-test.xml | ||
call:changePath %systemName%\src\main\resources\META-INF\spring\%systemName%.xml | ||
call:changePath %systemName%\src\main\java\com\mybank\bkcommon\collector\%systemName%\model\HelloWorld.java | ||
call:changePath %systemName%\src\main\java\com\mybank\bkcommon\collector\%systemName%\collector\HelloWorldCollector.java | ||
call:changePath %systemName%\src\main\resources\log4j.xml | ||
endlocal | ||
echo "Create Titan Module %systemName% Finish" | ||
pause | ||
|
||
:changePath | ||
set pacStr=${package_name} | ||
set proStr=${project_name} | ||
set targetStr=%systemName% | ||
for /f "tokens=* delims=£¥" %%i in (%1) do ( | ||
set var=%%i | ||
set var=!var:%pacStr%=%targetStr%! | ||
set var=!var:%proStr%=%targetStr%! | ||
echo !var!>>$ | ||
) | ||
move $ %1 | ||
goto:eof |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name=$1 | ||
|
||
if [ -z "$name" ]; then | ||
echo "need name" | ||
exit 2 | ||
fi | ||
|
||
URL="https://private-alipayobjects.alipay.com/alipay-rmsdeploy-image/rmsportal/xJXQkCxicEVnAvkHWXgI.gz" | ||
installer_file="project-template.tar.gz" | ||
|
||
function download { | ||
echo "Downloading Titan project template: $URL" | ||
curl -# $URL > $installer_file || exit | ||
} | ||
|
||
function unzip { | ||
echo "unzip $installer_file" | ||
tar -zxvf $installer_file | ||
} | ||
|
||
function createProject | ||
{ | ||
mkdir -p $name/src/main | ||
mkdir -p $name/src/main/java/com/mybank/bkcommon/collector/$name | ||
mkdir -p $name/src/main/java/com/mybank/bkcommon/collector/$name/collector | ||
mkdir -p $name/src/main/java/com/mybank/bkcommon/collector/$name/model | ||
mkdir -p $name/src/main/resources/META-INF/spring | ||
mkdir -p $name/src/main/resources/view | ||
|
||
mkdir -p $name/src/test | ||
mkdir -p $name/src/test/java/com/mybank/bkcommon/collector/$name/util | ||
mkdir -p $name/src/test/resources/ | ||
|
||
cp project-template/helloworld.vm $name/src/main/resources/view/helloworld.vm | ||
cp project-template/HelloWorld.java $name/src/main/java/com/mybank/bkcommon/collector/$name/model/HelloWorld.java | ||
cp project-template/HelloWorldCollector.java $name/src/main/java/com/mybank/bkcommon/collector/$name/collector/HelloWorldCollector.java | ||
cp project-template/pom-template.xml $name/pom.xml | ||
cp project-template/integration.xml $name/src/main/resources/META-INF/spring/integration.xml | ||
cp project-template/QuickStarter-template.java $name/src/test/java/com/mybank/bkcommon/collector/$name/QuickStarter.java | ||
cp project-template/integration-test.xml $name/src/test/resources/integration-test.xml | ||
cp project-template/spring-template.xml $name/src/main/resources/META-INF/spring/$name.xml | ||
cp project-template/log4j-template.xml $name/src/test/resources/log4j.xml | ||
cp project-template/log4j-main-template.xml $name/src/main/resources/log4j.xml | ||
|
||
sed -i '' 's/${package_name}/'$name'/g' $name/src/test/java/com/mybank/bkcommon/collector/$name/QuickStarter.java | ||
sed -i '' 's/${project_name}/'$name'/g' $name/pom.xml | ||
sed -i '' 's/${project_name}/'$name'/g' $name/src/test/resources/integration-test.xml | ||
sed -i '' 's/${project_name}/'$name'/g' $name/src/main/resources/META-INF/spring/$name.xml | ||
sed -i '' 's/${package_name}/'$name'/g' $name/src/main/java/com/mybank/bkcommon/collector/$name/model/HelloWorld.java | ||
sed -i '' 's/${package_name}/'$name'/g' $name/src/main/java/com/mybank/bkcommon/collector/$name/collector/HelloWorldCollector.java | ||
sed -i '' 's/${project_name}/'$name'/g' $name/src/main/resources/log4j.xml | ||
echo "Create Titan Module $name Finish" | ||
} | ||
|
||
download | ||
unzip | ||
createProject |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
/target | ||
/.project | ||
/.settings | ||
/.classpath | ||
/.idea | ||
/.DS_Store | ||
*.iml | ||
/target | ||
/.project | ||
/.settings/* | ||
/.classpath | ||
/.idea | ||
/.DS_Store | ||
*.iml | ||
/bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
mvn clean deploy | ||
mvn clean deploy -P deploy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
jarslink-api/src/main/java/com/alipay/jarslink/api/ApplicationContextAware.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.alipay.jarslink.api; | ||
|
||
import org.springframework.context.ConfigurableApplicationContext; | ||
|
||
/** | ||
* 加载模块时在创建完模块的spring-context后刷新spring-context前调用,用于做一些拦截处理 | ||
* | ||
* @author joe | ||
* @version 2018.04.04 10:54 | ||
*/ | ||
public interface ApplicationContextAware extends JarslinkAware{ | ||
/** | ||
* 加载模块时在创建完模块的spring-context后刷新spring-context前调用 | ||
* | ||
* @param context 当前加载的模块对应的configurableApplicationContext | ||
* @param moduleConfig 当前加载的模块对应的配置 | ||
*/ | ||
void setConfigurableApplicationContext(ConfigurableApplicationContext context, ModuleConfig moduleConfig); | ||
} |
19 changes: 19 additions & 0 deletions
19
jarslink-api/src/main/java/com/alipay/jarslink/api/ApplicationContextPostProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.alipay.jarslink.api; | ||
|
||
import org.springframework.context.ConfigurableApplicationContext; | ||
|
||
/** | ||
* 加载模块时在创建完模块的spring-context并且刷新spring-context后调用,用于做一些拦截处理 | ||
* | ||
* @author joe | ||
* @version 2018.04.04 10:53 | ||
*/ | ||
public interface ApplicationContextPostProcessor extends JarslinkPostProcessor { | ||
/** | ||
* 加载模块时在创建完模块的spring-context并且刷新spring-context后调用 | ||
* | ||
* @param context 当前加载的模块对应的configurableApplicationContext | ||
* @param moduleConfig 当前加载的模块对应的配置 | ||
*/ | ||
void setConfigurableApplicationContext(ConfigurableApplicationContext context, ModuleConfig moduleConfig); | ||
} |
10 changes: 10 additions & 0 deletions
10
jarslink-api/src/main/java/com/alipay/jarslink/api/JarslinkAware.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.alipay.jarslink.api; | ||
|
||
/** | ||
* 所有Aware的顶级接口 | ||
* | ||
* @author joe | ||
* @version 2018.04.04 11:05 | ||
*/ | ||
public interface JarslinkAware { | ||
} |
Oops, something went wrong.