use of org.glassfish.javaee.core.deployment.ApplicationHolder in project Payara by payara.
the class WeldCompositeSniffer method handles.
public boolean handles(DeploymentContext context) {
ArchiveType archiveType = habitat.getService(ArchiveType.class, context.getArchiveHandler().getArchiveType());
if (archiveType != null && !supportsArchiveType(archiveType)) {
return false;
}
boolean isWeldApplication = false;
ApplicationHolder holder = context.getModuleMetaData(ApplicationHolder.class);
ReadableArchive appRoot = context.getSource();
if ((holder != null) && (holder.app != null)) {
isWeldApplication = scanLibDir(appRoot, holder.app.getLibraryDirectory(), context);
}
return isWeldApplication;
}
use of org.glassfish.javaee.core.deployment.ApplicationHolder in project Payara by payara.
the class JPACompositeSniffer method handles.
/**
* 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;
}
Aggregations