本文整理了Java中com.sun.enterprise.deployment.Application.getLibraryDirectory()
方法的一些代码示例,展示了Application.getLibraryDirectory()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Application.getLibraryDirectory()
方法的具体详情如下:
包路径:com.sun.enterprise.deployment.Application
类名称:Application
方法名:getLibraryDirectory
[英]Returns an "intelligent" value for the library directory setting, meaning the current value if it has been set to a non-null, non-empty value; the default value if the value has never been set, and null if the value has been set to empty.
[中]返回库目录设置的“智能”值,如果已设置为非空值,则表示当前值;如果从未设置该值,则为默认值;如果该值已设置为空,则为null。
代码示例来源:origin: org.glassfish.deployment/dol
@Override
String getPathOfSubArchiveToScan() {
/*
* Take advantage of the fact that the app's getLibraryDirectory
* method handles all the semantics of the <library-directory>
* element.
*/
return app.getLibraryDirectory();
}
代码示例来源:origin: org.glassfish.main.deployment/dol
@Override
String getPathOfSubArchiveToScan() {
/*
* Take advantage of the fact that the app's getLibraryDirectory
* method handles all the semantics of the <library-directory>
* element.
*/
return app.getLibraryDirectory();
}
代码示例来源:origin: org.glassfish.main.deployment/dol
public static List<URI> getLibraryJarURIs(Application app, ReadableArchive archive) throws Exception {
List<URL> libraryURLs = new ArrayList<URL>();
List<URI> libraryURIs = new ArrayList<URI>();
// add libraries referenced through manifest
libraryURLs.addAll(DeploymentUtils.getManifestLibraries(archive));
ReadableArchive parentArchive = archive.getParentArchive();
if (parentArchive == null) {
return Collections.emptyList();
}
File appRoot = new File(parentArchive.getURI());
// add libraries jars inside application lib directory
libraryURLs.addAll(ASClassLoaderUtil.getAppLibDirLibrariesAsList(
appRoot, app.getLibraryDirectory(), null));
for (URL url : libraryURLs) {
libraryURIs.add(Util.toURI(url));
}
return libraryURIs;
}
代码示例来源:origin: org.glassfish.main.web/weld-integration
ApplicationHolder holder = context.getModuleMetaData(ApplicationHolder.class);
if ((holder != null) && (holder.app != null)) {
String libDir = holder.app.getLibraryDirectory();
if (libDir != null && !libDir.isEmpty()) {
Enumeration<String> entries = archive.entries(libDir);
String libDir = holder.app.getLibraryDirectory();
for (ReadableArchive libJarArchive : libJars) {
createLibJarBda(libJarArchive, ejbs, libDir);
代码示例来源:origin: org.glassfish.deployment/dol
public static List<URL> getLibraryJars(BundleDescriptor bundleDesc, ReadableArchive archive) throws IOException {
List<URL> libraryURLs = new ArrayList<URL>();
// add libraries referenced through manifest
libraryURLs.addAll(DeploymentUtils.getManifestLibraries(archive));
ReadableArchive parentArchive = archive.getParentArchive();
if (parentArchive == null || bundleDesc == null) {
// ear level or standalone module
return libraryURLs;
}
File appRoot = new File(parentArchive.getURI());
ModuleDescriptor moduleDesc = ((BundleDescriptor)bundleDesc).getModuleDescriptor();
Application app = ((BundleDescriptor)moduleDesc.getDescriptor()).getApplication();
// add libraries jars inside application lib directory
libraryURLs.addAll(ASClassLoaderUtil.getAppLibDirLibrariesAsList(
appRoot, app.getLibraryDirectory(), null));
return libraryURLs;
}
代码示例来源:origin: org.glassfish.main.deployment/deployment-javaee-core
parentArchive.getURI()), app.getLibraryDirectory(),
compatProp);
代码示例来源:origin: org.glassfish.main.deployment/deployment-javaee-full
final URL[] earLibURLs = ASClassLoaderUtil.getAppLibDirLibraries(context.getSourceDir(), holder.app.getLibraryDirectory(), compatProp);
final EarLibClassLoader earLibCl = AccessController.doPrivileged(new PrivilegedAction<EarLibClassLoader>() {
@Override
代码示例来源:origin: org.glassfish.main.persistence/gf-jpa-connector
/**
* Decides whether we have any pu roots at ear level
*/
public boolean handles(DeploymentContext context) {
ArchiveType archiveType = habitat.getService(ArchiveType.class, context.getArchiveHandler().getArchiveType());
if (archiveType != null && !supportsArchiveType(archiveType)) {
return false;
}
// Scans for pu roots in the "lib" dir of an application.
// We do not scan for PU roots in root of .ear. JPA 2.0 spec will clarify that it is not a portable use case.
// It is not portable use case because JavaEE spec implies that jars in root of ears are not visible by default
// to components (Unless an explicit Class-Path manifest entry is present) and can potentially be loaded by
// different class loaders (corresponding to each component that refers to it) thus residing in different name
// space. It does not make sense to make them visible at ear level (and thus in a single name space)
boolean isJPAApplication = false;
ApplicationHolder holder = context.getModuleMetaData(ApplicationHolder.class);
ReadableArchive appRoot = context.getSource();
if (holder != null && holder.app != null) {
isJPAApplication = scanForPURootsInLibDir(appRoot, holder.app.getLibraryDirectory());
if(!isJPAApplication) {
if(DeploymentUtils.useV2Compatibility(context) ) {
//Scan for pu roots in root of ear
isJPAApplication = scanForPURRootsInEarRoot(context, holder.app.getModules());
}
}
}
return isJPAApplication;
}
内容来源于网络,如有侵权,请联系作者删除!