Package com.sun.enterprise.deployment.util

Examples of com.sun.enterprise.deployment.util.ModuleDescriptor


   /**
     * @return the module descriptor for this bundle
     */
    public ModuleDescriptor getModuleDescriptor() {
        if (moduleDescriptor==null) {
            moduleDescriptor = new ModuleDescriptor();
            moduleDescriptor.setModuleType(getModuleType());
            moduleDescriptor.setDescriptor(this);
        }
        return moduleDescriptor;
    }
View Full Code Here


     * @param the abstract archive
     */
    public void write(Application application, ReadableArchive in,
        WritableArchive out) throws IOException {
        if (application.isVirtual()) {
            ModuleDescriptor aModule = (ModuleDescriptor) application.getModules().iterator().next();
            Archivist moduleArchivist = archivistFactory.getArchivist(aModule.getModuleType());
            write((BundleDescriptor)aModule.getDescriptor(), moduleArchivist, in, out);
        } else {
            // this is a real application.
           
            // let's start by writing out all submodules deployment descriptors
            for (ModuleDescriptor aModule : application.getModules()) {
                Archivist moduleArchivist = archivistFactory.getArchivist(aModule.getModuleType());
                if (aModule.getAlternateDescriptor()!=null) {
                    // the application is using alternate deployment descriptors

                    // write or copy standard deployment descriptor
                    String ddPath = aModule.getAlternateDescriptor();
                    DeploymentDescriptorFile ddFile =
                        moduleArchivist.getStandardDDFile();           
                    
                    BundleDescriptor bundle =
                            (BundleDescriptor)aModule.getDescriptor();
                    if (!bundle.isFullFlag()) {
                        if (ddFile != null) {
                            OutputStream os = out.putNextEntry(ddPath);
                            ddFile.write(bundle, os);
                            out.closeEntry();
                        }
                    } else {
                        if (aModule.getModuleType().equals(XModuleType.WAR)) {
                            WebBundleDescriptor webBundle =
                                (WebBundleDescriptor) aModule.getDescriptor();
                            if (webBundle.hasWebServices()) {
                                if (ddFile != null) {
                                    OutputStream os = out.putNextEntry(ddPath);
                                    ddFile.write(webBundle, os);
                                    out.closeEntry();
                                }
                            } else {
                                moduleArchivist.copyAnEntry(in, out, ddPath);
                            }
                        } else {
                            moduleArchivist.copyAnEntry(in, out, ddPath);
                        }
                    }

                    String runtimeDDPath = "glasfish-" + ddPath;
                    DeploymentDescriptorFile confDDFile = moduleArchivist.getConfigurationDDFile();
                    if (confDDFile!=null) {
                        OutputStream os = out.putNextEntry(runtimeDDPath);
                        confDDFile.write(aModule.getDescriptor(), os);
                        out.closeEntry();
                    }
                } else {
                    WritableArchive moduleArchive = out.createSubArchive(aModule.getArchiveUri());
                    ReadableArchive moduleArchive2 = in.getSubArchive(aModule.getArchiveUri());
                    write((BundleDescriptor)aModule.getDescriptor(),  moduleArchivist, moduleArchive2, moduleArchive);
                }
            }
           
            // now let's write the application descriptor
            ApplicationArchivist archivist =
View Full Code Here

  if (element.getQName().equals(RuntimeTagNames.WEB_URI)) {
      currentWebUri=value;
  } else
  if (element.getQName().equals(RuntimeTagNames.CONTEXT_ROOT)) {
      if (currentWebUri!=null) {
    ModuleDescriptor md = descriptor.getModuleDescriptorByUri(currentWebUri);
                if (md==null) {
                    throw new RuntimeException("No bundle in application with uri " + currentWebUri);
                }
    currentWebUri=null;
    if (md.getModuleType().equals(XModuleType.WAR)) {
        md.setContextRoot(value);
    } else {
        throw new RuntimeException(currentWebUri + " uri does not point to a web bundle");
    }
      } else {
    throw new RuntimeException("No uri provided for this context-root " + value);
View Full Code Here

     *
     * @param element the xml element
     * @param value it's associated value
     */   
    public void setElementValue(XMLElement element, String value) {
        ModuleDescriptor descriptor = (ModuleDescriptor) getDescriptor();
         if (element.getQName().equals(ApplicationTagNames.WEB_URI)) {           
            descriptor.setModuleType(XModuleType.WAR);
            descriptor.setArchiveUri(value);               
        } else if (element.getQName().equals(ApplicationTagNames.EJB)) {
            descriptor.setModuleType(XModuleType.EJB);
            descriptor.setArchiveUri(value);
        } else if (element.getQName().equals(ApplicationTagNames.CONNECTOR)) {
            descriptor.setModuleType(XModuleType.RAR);
            descriptor.setArchiveUri(value);
        } else if (element.getQName().equals(ApplicationTagNames.APPLICATION_CLIENT)) {
            descriptor.setModuleType(XModuleType.CAR);
            descriptor.setArchiveUri(value);
        } else if (element.getQName().equals(ApplicationTagNames.WEB)) {
            descriptor.setModuleType(XModuleType.WAR);
        } else super.setElementValue(element, value);
    }   
View Full Code Here

            // Get portion of request uri representing location within a module
            String wsdlPath = endpoint.getWsdlContentPath(requestUri);

            if( wsdlPath != null) {
                ModuleDescriptor module =
                    webService.getBundleDescriptor().getModuleDescriptor();

                if( wsdlPath.equals(webService.getWsdlFileUri())){
                    // If the request is for the main wsdl document, return
                    // the final wsdl instead of the wsdl from the module.
View Full Code Here

                isEJBModule = true;
                EjbDeploymentDescriptorFile eddf =
                        new EjbDeploymentDescriptorFile();
                eddf.setXMLValidation(false);
                EjbBundleDescriptor bundleDesc =  (EjbBundleDescriptor) eddf.read(is);
                ModuleDescriptor moduleDesc = bundleDesc.getModuleDescriptor();
                moduleDesc.setArchiveUri(fileName);
                moduleName = moduleDesc.getModuleName();
            } else {
                GenericAnnotationDetector detector =
                    new GenericAnnotationDetector(ejbAnnotations);
                isEJBModule = detector.hasAnnotationInArchive(archive);
            }
View Full Code Here

                    }
                    loader = null;
                }
            }
            ConnectorRuntime connectorRuntime = ConnectorRuntime.getRuntime();
            ModuleDescriptor moduleDescriptor = null;
            Application application = null;
            if(_logger.isLoggable(Level.FINE)) {
                _logger.fine("ResourceAdapterAdminServiceImpl :: createActiveRA "
                    + moduleName + " at " + moduleDir + " loader :: " + loader);
            }
View Full Code Here

                isEJBModule = true;
                EjbDeploymentDescriptorFile eddf =
                        new EjbDeploymentDescriptorFile();
                eddf.setXMLValidation(false);
                EjbBundleDescriptor bundleDesc =  (EjbBundleDescriptor) eddf.read(is);
                ModuleDescriptor moduleDesc = bundleDesc.getModuleDescriptor();
                moduleDesc.setArchiveUri(fileName);
                moduleName = moduleDesc.getModuleName();
            } else {
                GenericAnnotationDetector detector =
                    new GenericAnnotationDetector(ejbAnnotations);
                isEJBModule = detector.hasAnnotationInArchive(archive);
            }
View Full Code Here

        JndiNameEnvironment env = compEnvManager.getCurrentJndiNameEnvironment();

        BundleDescriptor webBundle = (BundleDescriptor) env;

        ModuleDescriptor moduleDesc = webBundle.getModuleDescriptor();

        // Register interceptor for EJB components
        if( EjbContainerUtilImpl.isInitialized() ) {

            Collection<EjbBundleDescriptor> ejbBundles =
                    moduleDesc.getDescriptor().getExtensionsDescriptors(EjbBundleDescriptor.class);

            if( ejbBundles.size() == 1) {

                EjbBundleDescriptor ejbBundle = ejbBundles.iterator().next();
                for(EjbDescriptor ejb : ejbBundle.getEjbs()) {
View Full Code Here

    }   

    protected String getAbstractArchiveUri(EjbDescriptor desc) {
        String archBase = getVerifierContext().getAbstractArchive().
                getURI().toString();
        final ModuleDescriptor moduleDescriptor = desc.getEjbBundleDescriptor().
                getModuleDescriptor();
        if (moduleDescriptor.isStandalone()) {
            return archBase; // it must be a stand-alone module; no such physical dir exists
        } else {
            return archBase + "/" +
                    FileUtils.makeFriendlyFilename(moduleDescriptor.getArchiveUri());
        }
    }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.deployment.util.ModuleDescriptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.