Search in sources :

Example 6 with ASURLClassLoader

use of com.sun.enterprise.loader.ASURLClassLoader in project Payara by payara.

the class WebVerifier method createClassLoader.

/**
 * Creates the ClassLoader for the war archive.
 *
 * @return ClassLoader
 * @throws IOException
 */
protected ClassLoader createClassLoader() throws IOException {
    ASURLClassLoader ASURLClassLoader = new ASURLClassLoader(webd.getClassLoader());
    ASURLClassLoader.appendURL(jspOutDir);
    return ASURLClassLoader;
}
Also used : ASURLClassLoader(com.sun.enterprise.loader.ASURLClassLoader)

Example 7 with ASURLClassLoader

use of com.sun.enterprise.loader.ASURLClassLoader in project Payara by payara.

the class JaxRpcRICodegen method createNoMetadataModelInfo.

private NoMetadataModelInfo createNoMetadataModelInfo(ServiceReferenceDescriptor serviceRef, JaxrpcMappingDescriptor mappingDesc) throws Exception {
    NoMetadataModelInfo modelInfo = rpcFactory.createNoMetadataModelInfo();
    URL wsdlFile = serviceRef.hasWsdlOverride() ? serviceRef.getWsdlOverride() : serviceRef.getWsdlFileUrl();
    modelInfo.setLocation(wsdlFile.toExternalForm());
    // Service endpoint interface is required.  Parse generated
    // service interface for it since we can't count on SEI
    // having been listed in standard deployment information.
    WsUtil wsUtil = new WsUtil();
    String serviceInterfaceName = serviceRef.getServiceInterface();
    ClassLoader cl = context.getModuleMetaData(Application.class).getClassLoader();
    if (cl instanceof ASURLClassLoader) {
        String modClassPath = ASClassLoaderUtil.getModuleClassPath(habitat, context);
        List<URL> moduleList = ASClassLoaderUtil.getURLsFromClasspath(modClassPath, File.pathSeparator, null);
        for (Iterator<URL> itr = moduleList.iterator(); itr.hasNext(); ) {
            ((ASURLClassLoader) cl).appendURL(itr.next());
        }
    }
    Class serviceInterface = cl.loadClass(serviceInterfaceName);
    Collection seis = wsUtil.getSEIsFromGeneratedService(serviceInterface);
    if (seis.size() == 0) {
        throw new Exception("Invalid Generated Service Interface " + serviceInterfaceName + " . ");
    } else if (seis.size() > 1) {
        throw new Exception("Deployment error : If no " + "jaxrpc-mapping file is provided, " + "Generated Service Interface must have" + " only 1 Service Endpoint Interface");
    }
    String serviceEndpointInterface = (String) seis.iterator().next();
    modelInfo.setInterfaceName(serviceEndpointInterface);
    addNamespaceMappingRegistry(modelInfo, mappingDesc);
    return modelInfo;
}
Also used : ASURLClassLoader(com.sun.enterprise.loader.ASURLClassLoader) ASURLClassLoader(com.sun.enterprise.loader.ASURLClassLoader) Collection(java.util.Collection) NoMetadataModelInfo(com.sun.xml.rpc.spi.tools.NoMetadataModelInfo) WsUtil(org.glassfish.webservices.WsUtil) URL(java.net.URL) IOException(java.io.IOException)

Aggregations

ASURLClassLoader (com.sun.enterprise.loader.ASURLClassLoader)7 URL (java.net.URL)3 PermsArchiveDelegate (com.sun.enterprise.security.perms.PermsArchiveDelegate)2 MalformedURLException (java.net.MalformedURLException)2 PrivilegedActionException (java.security.PrivilegedActionException)2 DeploymentContext (org.glassfish.api.deployment.DeploymentContext)2 NoMetadataModelInfo (com.sun.xml.rpc.spi.tools.NoMetadataModelInfo)1 File (java.io.File)1 IOException (java.io.IOException)1 Collection (java.util.Collection)1 XMLStreamException (javax.xml.stream.XMLStreamException)1 WsUtil (org.glassfish.webservices.WsUtil)1