use of org.glassfish.api.deployment.archive.ArchiveType in project Payara by payara.
the class WebServiceEngineImpl method createEndpointInfo.
private EndpointImpl createEndpointInfo(WebServiceEndpoint endpoint) {
try {
String endpointURL = endpoint.getEndpointAddressUri();
EndpointType endpointType;
ArchiveType moduleType = endpoint.getWebService().getWebServicesDescriptor().getModuleType();
if (moduleType != null && moduleType.equals(DOLUtils.ejbType())) {
endpointType = EndpointType.EJB_ENDPOINT;
} else {
endpointType = EndpointType.SERVLET_ENDPOINT;
}
EndpointImpl newEndpoint;
// service
if (endpoint.getWebService().hasMappingFile()) {
newEndpoint = new JAXRPCEndpointImpl(endpointURL, endpointType);
} else {
newEndpoint = new JAXWSEndpointImpl(endpointURL, endpointType);
}
newEndpoint.setDescriptor(endpoint);
return newEndpoint;
} catch (Exception e) {
sLogger.log(Level.SEVERE, LogUtils.EXCEPTION_CREATING_ENDPOINT, e);
}
return null;
}
use of org.glassfish.api.deployment.archive.ArchiveType 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;
}
use of org.glassfish.api.deployment.archive.ArchiveType 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.api.deployment.archive.ArchiveType in project Payara by payara.
the class WebServiceCheckMgrImpl method check.
/**
* Check Ejb for spec. conformance
*
* @param descriptor WebServices descriptor
*/
public void check(Descriptor descriptor) throws Exception {
WebServicesDescriptor rootDescriptor = (WebServicesDescriptor) descriptor;
ArchiveType moduleType = rootDescriptor.getBundleDescriptor().getModuleType();
if (moduleType != null && moduleType.equals(DOLUtils.ejbType()))
moduleName = Result.EJB;
else if (moduleType != null && moduleType.equals(DOLUtils.warType()))
moduleName = Result.WEB;
for (Iterator itr = rootDescriptor.getWebServices().iterator(); itr.hasNext(); ) {
WebService wsDescriptor = (WebService) itr.next();
// need to pass WebServiceEndpoint's to check
for (Iterator endPtItr = wsDescriptor.getEndpoints().iterator(); endPtItr.hasNext(); ) {
super.check((WebServiceEndpoint) endPtItr.next());
}
}
}
use of org.glassfish.api.deployment.archive.ArchiveType in project Payara by payara.
the class PersistenceUnitCheckMgrImpl method check.
@Override
protected void check(Descriptor descriptor) throws Exception {
PersistenceUnitDescriptor pu = PersistenceUnitDescriptor.class.cast(descriptor);
RootDeploymentDescriptor rootDD = pu.getParent().getParent();
if (rootDD.isApplication()) {
moduleName = Result.APP;
} else {
ModuleDescriptor mdesc = BundleDescriptor.class.cast(rootDD).getModuleDescriptor();
final ArchiveType moduleType = mdesc.getModuleType();
if (moduleType != null && moduleType.equals(DOLUtils.ejbType())) {
moduleName = Result.EJB;
} else if (moduleType != null && moduleType.equals(DOLUtils.warType())) {
moduleName = Result.WEB;
} else if (moduleType != null && moduleType.equals(DOLUtils.carType())) {
moduleName = Result.APPCLIENT;
} else {
throw new RuntimeException(// NOI18N
smh.getLocalString(// NOI18N
getClass().getName() + ".exception", // NOI18N
"Unknown module type : {0}", new Object[] { moduleType }));
}
}
super.check(descriptor);
}
Aggregations