Search in sources :

Example 6 with ArchiveType

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;
}
Also used : ArchiveType(org.glassfish.api.deployment.archive.ArchiveType)

Example 7 with ArchiveType

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;
}
Also used : ApplicationHolder(org.glassfish.javaee.core.deployment.ApplicationHolder) ArchiveType(org.glassfish.api.deployment.archive.ArchiveType) ReadableArchive(org.glassfish.api.deployment.archive.ReadableArchive)

Example 8 with ArchiveType

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;
}
Also used : ApplicationHolder(org.glassfish.javaee.core.deployment.ApplicationHolder) ArchiveType(org.glassfish.api.deployment.archive.ArchiveType) ReadableArchive(org.glassfish.api.deployment.archive.ReadableArchive)

Example 9 with ArchiveType

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());
        }
    }
}
Also used : ArchiveType(org.glassfish.api.deployment.archive.ArchiveType) Iterator(java.util.Iterator)

Example 10 with ArchiveType

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);
}
Also used : ModuleDescriptor(org.glassfish.deployment.common.ModuleDescriptor) BundleDescriptor(com.sun.enterprise.deployment.BundleDescriptor) ArchiveType(org.glassfish.api.deployment.archive.ArchiveType) RootDeploymentDescriptor(org.glassfish.deployment.common.RootDeploymentDescriptor) PersistenceUnitDescriptor(com.sun.enterprise.deployment.PersistenceUnitDescriptor)

Aggregations

ArchiveType (org.glassfish.api.deployment.archive.ArchiveType)15 ReadableArchive (org.glassfish.api.deployment.archive.ReadableArchive)4 Application (com.sun.enterprise.deployment.Application)2 BundleDescriptor (com.sun.enterprise.deployment.BundleDescriptor)2 Iterator (java.util.Iterator)2 ModuleDescriptor (org.glassfish.deployment.common.ModuleDescriptor)2 RootDeploymentDescriptor (org.glassfish.deployment.common.RootDeploymentDescriptor)2 ApplicationHolder (org.glassfish.javaee.core.deployment.ApplicationHolder)2 ArchiveFactory (com.sun.enterprise.deploy.shared.ArchiveFactory)1 FileArchive (com.sun.enterprise.deploy.shared.FileArchive)1 ApplicationClientDescriptor (com.sun.enterprise.deployment.ApplicationClientDescriptor)1 EjbBundleDescriptor (com.sun.enterprise.deployment.EjbBundleDescriptor)1 EjbDescriptor (com.sun.enterprise.deployment.EjbDescriptor)1 PersistenceUnitDescriptor (com.sun.enterprise.deployment.PersistenceUnitDescriptor)1 ServiceReferenceDescriptor (com.sun.enterprise.deployment.ServiceReferenceDescriptor)1 WebServiceEndpoint (com.sun.enterprise.deployment.WebServiceEndpoint)1 AppClientArchivist (com.sun.enterprise.deployment.archivist.AppClientArchivist)1 Archivist (com.sun.enterprise.deployment.archivist.Archivist)1 ArchivistFactory (com.sun.enterprise.deployment.archivist.ArchivistFactory)1 Method (java.lang.reflect.Method)1