Skip to content

Commit

Permalink
add biz jar url in biz module (#928)
Browse files Browse the repository at this point in the history
  • Loading branch information
lvjing2 authored May 17, 2024
1 parent 41d3cda commit e1f5872
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ public class BizModel implements Biz {

private URL[] urls;

private URL bizUrl;

private URL[] pluginUrls;

private ClassLoader classLoader;
Expand Down Expand Up @@ -138,6 +140,11 @@ public BizModel setClassPath(URL[] urls) {
return this;
}

public BizModel setBizUrl(URL url) {
this.bizUrl = url;
return this;
}

public BizModel setPluginClassPath(URL[] urls) {
this.pluginUrls = urls;
return this;
Expand Down Expand Up @@ -235,6 +242,11 @@ public URL[] getClassPath() {
return urls;
}

@Override
public URL getBizUrl() {
return bizUrl;
}

@Override
public int getPriority() {
return priority;
Expand Down Expand Up @@ -412,8 +424,9 @@ public List<BizStateRecord> getBizStateRecords() {

@Override
public String toString() {
return "Ark Biz: " + getIdentity() + ",\n classloader: " + classLoader
+ ",\n current state: " + bizState + ",\n history states: " + bizStateRecords;
return "Ark Biz: " + getIdentity() + ",\n biz url: " + bizUrl + ",\n classloader: "
+ classLoader + ",\n current state: " + bizState + ",\n history states: "
+ bizStateRecords;
}

private void resetProperties() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public Biz createBiz(BizArchive bizArchive) throws IOException {
.setBizName(manifestMainAttributes.getValue(ARK_BIZ_NAME))
.setBizVersion(manifestMainAttributes.getValue(ARK_BIZ_VERSION))
.setMainClass(!StringUtils.isEmpty(startClass) ? startClass : mainClass)
.setBizUrl(bizArchive.getUrl())
.setPriority(manifestMainAttributes.getValue(PRIORITY_ATTRIBUTE))
.setWebContextPath(manifestMainAttributes.getValue(WEB_CONTEXT_PATH))
.setDenyImportPackages(manifestMainAttributes.getValue(DENY_IMPORT_PACKAGES))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ public interface BizInfo {
*/
URL[] getClassPath();

/**
* get biz url
*/
URL getBizUrl();

/**
* get denied imported packages config
* @return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/
package com.alipay.sofa.ark.test;

import com.alipay.sofa.ark.springboot.runner.ArkBootEmbedRunner;
import com.alipay.sofa.ark.springboot.runner.ArkBootRunner;
import com.alipay.sofa.ark.test.springboot.BaseSpringApplication;
import org.junit.Test;
Expand All @@ -28,7 +29,7 @@
* @author qilong.zql
* @since 1.0.0
*/
@RunWith(ArkBootRunner.class)
@RunWith(ArkBootEmbedRunner.class)
@SpringBootTest(classes = BaseSpringApplication.class)
public class MultiArkBootRunnerTest {

Expand Down

0 comments on commit e1f5872

Please sign in to comment.