Package com.sun.enterprise.deployment.deploy.shared

Examples of com.sun.enterprise.deployment.deploy.shared.InputJarArchive


     * @param file the deployed file
     * @return the moduleID derived from this file using the dd's display name
     */
    public String getModuleIDFromDD (File file) throws Exception {
        Archivist source = ArchivistFactory.getArchivistForArchive(file);
        InputJarArchive archive = new InputJarArchive();
        archive.open(file.getAbsolutePath());
        Descriptor descriptor = null;
        String moduleID = null;
        String displayName = null;
        try {
            descriptor = source.readStandardDeploymentDescriptor(archive);
View Full Code Here


        for (File subModule : files) {
            AbstractArchive subArchive = null;
            try {
                try {
                    if (!directory) {
                        subArchive = new InputJarArchive();
                        ((InputJarArchive)subArchive).open(subModule.getAbsolutePath());
                    } else {
                        subArchive = new FileArchive();
                        ((FileArchive)subArchive).open(subModule.getAbsolutePath());
                    }
View Full Code Here

        super(isJWS, logger, archive, archivist, mainClassFromCommandLine);
    }

    protected AbstractArchive expand(File file)
        throws IOException, Exception {
        InputJarArchive  appArchive = new InputJarArchive ();
        appArchive.open(file.getAbsolutePath());
        return appArchive;
    }
View Full Code Here

                        AbstractArchive archive;
                        if (appClientFile.isDirectory()) {
                            archive = new FileArchive();
                            ((FileArchive) archive).open(appClientFile.getAbsolutePath());
                        } else {
                            archive = new InputJarArchive();
                            ((InputJarArchive) archive).open(appClientFile.getAbsolutePath());
                        }

                        if (appDesc.getMainClassName()==null || appDesc.getMainClassName().length()==0) {
                            appDesc.setMainClassName(className);
                            arch.processAnnotations(appDesc, archive);
                           
                            // let's remove our appArgs first element since it was the app client class name
                            //...but only if this is not a Java Web Start launch.
                            if (mainClass==null && ! isJWS) {
                                appArgs.removeElementAt(0);
                            }
                        }
                    }
                   
                } catch (Throwable t) {
                    _logger.log(Level.WARNING,
                            "main.appclient_descriptors_failed", (displayName == null) ? mainClass : displayName);
                    throw t;
                }
                container = new AppContainer(appDesc, guiAuth);
            }
            if(container == null) {
                _logger.log(Level.WARNING, "acc.no_client_desc",
                            (displayName == null) ? mainClass : displayName);

                System.exit(1);
            }
            // Set the authenticator which is called back when a
            // protected web resource is requested and authentication data is
            // needed.
            Authenticator.setDefault(new HttpAuthenticator(container));

            // log a machine name, port number per Jagadesh's request
      _logger.log(Level.INFO, "acc.orb_host_name", host);
            _logger.log(Level.INFO, "acc.orb_port_number", port);
                     
      Properties props = new Properties();
      props.put("org.omg.CORBA.ORBInitialHost", host);
      props.put("org.omg.CORBA.ORBInitialPort", port);

            String appMainClass = container.preInvoke(props);
            cleanup.setAppContainer(container);

            // load and invoke the real main of the application.
            Class cl = null;
            try {
                cl = jcl.loadClass(appMainClass);
            } catch (java.lang.ClassNotFoundException cnf) {
                String errorMessage = localStrings.getString
                    ("appclient.mainclass.not.found", appMainClass);
                _logger.log(Level.WARNING, errorMessage);
                throw cnf;
            }

            _logger.log(Level.INFO, "acc.load_app_class", appMainClass);          

            String[] applicationArgs = new String[appArgs.size()];
            for(int sz = 0; sz < applicationArgs.length; sz++) {
                applicationArgs[sz] = (String) appArgs.elementAt(sz);
            }

            // check if we are dealing with an application client containing
            // service references... if this is the case, I need to explode
            // the appclient jar file to be able to access its wsdl files
            // with a URL (so that imports can work)
            if (appDesc.hasWebServiceClients()) {
                File moduleFile;
                if (appDesc.getApplication()==null
                      || appDesc.getApplication().isVirtual()) {
                    // this is a standalone module, I can do Wsdl file
                    // resolution directly on it.
                    moduleFile = appClientFile;
                } else {
                    InputJarArchive earFile = new InputJarArchive();
                    earFile.open(appClientFile.getAbsolutePath());
                    String moduleName = appDesc.getModuleDescriptor().getArchiveUri();
                    InputStream is = earFile.getEntry(moduleName);
                    moduleFile = File.createTempFile("appclient", ".jar");
                    moduleFile.deleteOnExit();
                    OutputStream os = new FileOutputStream(moduleFile);                   
                    ArchivistUtils.copy(new BufferedInputStream(is), new BufferedOutputStream(os));
                    earFile.close();
                }
                // now perform wsdl file resolution
                for (Iterator itr = appDesc.getServiceReferenceDescriptors().iterator();
                    itr.hasNext();) {
                       
View Full Code Here

            originalArchive = new FileArchive();
            ((FileArchive)originalArchive).open(jarFile.getAbsolutePath());
        }
        else
        {
            originalArchive = new InputJarArchive();
            ((InputJarArchive)originalArchive).open(jarFile.getAbsolutePath());
        }
  Application application = openArchive(archivist, originalArchive, handleRuntimeInfo);
  originalArchive.close();
  return application;
View Full Code Here

        AbstractArchive archive;
        if (f.isDirectory()) {
            archive = new FileArchive();
            ((FileArchive) archive).open(path);
        } else {
            archive = new InputJarArchive();
            ((InputJarArchive) archive).open(path);
        }
        Archivist archivist=null;
        try {           
            archivist = getArchivistForArchive(archive);
View Full Code Here

         * creates the generated client JAR it does not overwrite the existing
         * file created by the app client deployer.
         */
        final File movedGeneratedFile = File.createTempFile(generatedClientJARFile.getName(), ".tmp", generatedClientJARFile.getParentFile());
        FileUtils.renameFile(generatedClientJARFile, movedGeneratedFile);
        final ReadableArchive existingGeneratedJAR = new InputJarArchive();
        existingGeneratedJAR.open(movedGeneratedFile.toURI());
        try {
            for (Enumeration e = existingGeneratedJAR.entries(); e.hasMoreElements();) {
                final String entryName = (String) e.nextElement();
                final URI entryURI = new URI("jar", movedGeneratedFile.toURI().toASCIIString() + "!/" + entryName, null);
                final Artifacts.FullAndPartURIs uris = new Artifacts.FullAndPartURIs(entryURI, entryName);
                clientArtifactsManager.add(uris);
            }
            /*
             * Handle the manifest explicitly because the Archive entries()
             * method consciously omits it.
             */
            final Artifacts.FullAndPartURIs manifestURIs = new Artifacts.FullAndPartURIs(
                    new URI("jar", movedGeneratedFile.toURI().toASCIIString() + "!/" + JarFile.MANIFEST_NAME, null), JarFile.MANIFEST_NAME);
            clientArtifactsManager.add(manifestURIs);
            return movedGeneratedFile;
        } finally {
            existingGeneratedJAR.close();
        }
    }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.deployment.deploy.shared.InputJarArchive

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.