use of com.alipay.sofa.ark.container.service.classloader.BizClassLoader in project sofa-ark by alipay.
the class BizFactoryServiceImpl method createBiz.
@Override
public Biz createBiz(BizArchive bizArchive) throws IOException {
AssertUtils.isTrue(isArkBiz(bizArchive), "Archive must be a ark biz!");
BizModel bizModel = new BizModel();
Attributes manifestMainAttributes = bizArchive.getManifest().getMainAttributes();
bizModel.setBizState(BizState.RESOLVED).setBizName(manifestMainAttributes.getValue(ARK_BIZ_NAME)).setBizVersion(manifestMainAttributes.getValue(ARK_BIZ_VERSION)).setMainClass(manifestMainAttributes.getValue(MAIN_CLASS_ATTRIBUTE)).setPriority(manifestMainAttributes.getValue(PRIORITY_ATTRIBUTE)).setWebContextPath(manifestMainAttributes.getValue(WEB_CONTEXT_PATH)).setDenyImportPackages(manifestMainAttributes.getValue(DENY_IMPORT_PACKAGES)).setDenyImportClasses(manifestMainAttributes.getValue(DENY_IMPORT_CLASSES)).setDenyImportResources(manifestMainAttributes.getValue(DENY_IMPORT_RESOURCES)).setInjectPluginDependencies(getInjectDependencies(manifestMainAttributes.getValue(INJECT_PLUGIN_DEPENDENCIES))).setInjectExportPackages(manifestMainAttributes.getValue(INJECT_EXPORT_PACKAGES)).setClassPath(bizArchive.getUrls()).setClassLoader(new BizClassLoader(bizModel.getIdentity(), getBizUcp(bizModel.getClassPath()), bizArchive instanceof ExplodedBizArchive));
return bizModel;
}
use of com.alipay.sofa.ark.container.service.classloader.BizClassLoader in project sofa-ark by alipay.
the class HandleArchiveStage method transformBizArchives.
private Biz transformBizArchives(BizArchive bizArchive) throws Exception {
BizModel bizModel = new BizModel();
Attributes manifestMainAttributes = bizArchive.getManifest().getMainAttributes();
return bizModel.setBizName(manifestMainAttributes.getValue(ARK_BIZ_NAME)).setMainClass(manifestMainAttributes.getValue(MAIN_CLASS_ATTRIBUTE)).setPriority(manifestMainAttributes.getValue(PRIORITY_ATTRIBUTE)).setClassPath(bizArchive.getUrls()).setClassLoader(new BizClassLoader(bizModel.getBizName(), bizModel.getClassPath()));
}
Aggregations