Examples of ArchiveFactory


Examples of com.sun.enterprise.deploy.shared.ArchiveFactory

    public boolean hasAnnotationInArchive(ReadableArchive archive) {
        scanArchive(archive);
        if (found) {
            return found;
        }     
        ArchiveFactory archiveFactory = null;
        if (Globals.getDefaultHabitat() != null) {
            archiveFactory = Globals.getDefaultHabitat().getComponent(ArchiveFactory.class);
        }

        if (archiveFactory != null) {
            List<URI> externalLibs = DeploymentUtils.getExternalLibraries(archive);
            for (URI externalLib : externalLibs) {
                try {
                    scanArchive(archiveFactory.openArchive(new File(externalLib.getPath())));
                } catch(FileNotFoundException fnfe) {
                    logger.log(Level.WARNING, "Cannot find archive " + externalLib.getPath()
                            + " referenced from archive " + archive.getName()
                            + ", it will be ignored for annotation scanning");
                } catch (Exception e) {
View Full Code Here

Examples of com.sun.enterprise.deploy.shared.ArchiveFactory

    public boolean hasAnnotationInArchive(ReadableArchive archive) {
        scanArchive(archive);
        if (found) {
            return found;
        }     
        ArchiveFactory archiveFactory = null;
        if (Globals.getDefaultHabitat() != null) {
            archiveFactory = Globals.getDefaultHabitat().getService(ArchiveFactory.class);
        }

        if (archiveFactory != null) {
            List<URI> externalLibs = DeploymentUtils.getExternalLibraries(archive);
            for (URI externalLib : externalLibs) {
                try {
                    scanArchive(archiveFactory.openArchive(new File(externalLib.getPath())));
                } catch(FileNotFoundException fnfe) {
                    Object args[] = { externalLib.getPath(), archive.getName() };
                    deplLogger.log(Level.WARNING, ARCHIVE_NOT_FOUND, args);
                } catch (Exception e) {
                    LogRecord lr = new LogRecord(Level.WARNING, EXCEPTION_CAUGHT);
View Full Code Here

Examples of com.sun.enterprise.deploy.shared.ArchiveFactory

         *Create archives for the module file and, if present, the deployment plan file, and
         *then delegate to the variant of deploy that accepts archives as arguments.
         */
        ReadableArchive appArchive = null;
        ReadableArchive planArchive = null;
        ArchiveFactory archiveFactory = getArchiveFactory();
       
        try {
            appArchive = archiveFactory.openArchive(moduleArchive);
       
            if(deploymentPlan != null && deploymentPlan.length() != 0) {
                planArchive = archiveFactory.openArchive(deploymentPlan);
                if (planArchive == null) {
                    throw new IllegalArgumentException(localStrings.getLocalString(
                        "enterprise.deployapi.spi.noarchivisthandlesplan",
                        "No archivist is able to handle the deployment plan {0}",
                        new Object [] {deploymentPlan.getAbsolutePath()}
View Full Code Here

Examples of com.sun.enterprise.deploy.shared.ArchiveFactory

        if (path==null) {
            // no particular path was provided, using tmp jar file
            File root = File.createTempFile(name,".jar")//NOI18N
            path = root.toURI();
        }
        ArchiveFactory factory = getArchiveFactory();
        boolean exists = false;
        if ((path.getScheme().equals("file")) ||  //NOI18N
            (path.getScheme().equals("jar"))) { //NOI18N
       
            File target = new File(path);
            exists = target.exists();                   
        } else {
            return null;
        }
        if (exists) {
            return factory.openArchive(path);           
        } else {
            return factory.createArchive(path);
        }
    }
View Full Code Here

Examples of com.sun.enterprise.deploy.shared.ArchiveFactory

     */
    public static final void createClientJar(
        DeploymentContext dc, File clientJar, ZipItem[] clientStubs,
        String clientJarChoice) throws DeploymentException {
        try {        
            ArchiveFactory archiveFactory = Globals.
                getDefaultHabitat().getComponent(ArchiveFactory.class);

            // client jar naming convension is <app-name>Client.jar
            WritableArchive target = archiveFactory.createArchive(clientJar);
           
            RootDeploymentDescriptor descriptor;

            Application app = dc.getModuleMetaData(Application.class);
            if (app.isVirtual()) {
                descriptor = app.getStandaloneBundleDescriptor();
            } else {
                descriptor = app;
            }

            ReadableArchive source = archiveFactory.openArchive(
                dc.getSourceDir());

            PEDeploymentFactoryImpl pe = new PEDeploymentFactoryImpl();
            Properties props = getPropertiesForClientJarMaker(
                CLIENT_JAR_CHOICES.getClientJarChoice(clientJarChoice),
                dc, descriptor);
            ClientJarMaker jarMaker = pe.getClientJarMaker(props);

            // copy xml files from generated directory archive to original
            // directory archive so the created client jar contain
            // processed xml files.
            if (FileUtils.safeIsDirectory(dc.getScratchDir("xml"))) {
                ReadableArchive source2 = archiveFactory.openArchive(
                    dc.getScratchDir("xml"));
                jarMaker.create(descriptor, source, source2, target,
                    clientStubs, null);
                source2.close();
            } else {
View Full Code Here

Examples of com.sun.enterprise.deploy.shared.ArchiveFactory

                ApplicationClientDescriptor acd = (ApplicationClientDescriptor) md.getDescriptor();

                final String displayName = acd.getDisplayName();
                final String appName = acd.getModuleID();

                ArchiveFactory archiveFactory = Util.getArchiveFactory();
                ReadableArchive clientRA = archiveFactory.openArchive(ra.getURI().resolve(md.getArchiveUri()));

                /*
                 * Choose this nested app client if the caller-supplied name
                 * matches, or if the caller-supplied main class matches, or
                 * if neither was provided. 
View Full Code Here

Examples of com.sun.enterprise.deploy.shared.ArchiveFactory

                final String callerSuppliedAppName,
                final ServiceLocator habitat) throws IOException, BootException, URISyntaxException, XMLStreamException, SAXParseException, UserError {
            /*
             * Make sure the requested URI exists and is readable.
             */
            ArchiveFactory af = ACCModulesManager.getService(ArchiveFactory.class);
            ReadableArchive ra = null;
            try {
                ra = af.openArchive(uri);
            } catch (IOException e) {
                final String msg = localStrings.getLocalString(
                        Launchable.class,
                        "appclient.cannotFindJarFile",
                        "Could not locate the requested client JAR file {0}; please try again with an existing, valid client JAR",
View Full Code Here

Examples of com.sun.enterprise.deploy.shared.ArchiveFactory

         *Create archives for the module file and, if present, the deployment plan file, and
         *then delegate to the variant of deploy that accepts archives as arguments.
         */
        ReadableArchive appArchive = null;
        ReadableArchive planArchive = null;
        ArchiveFactory archiveFactory = getArchiveFactory();
       
        try {
            appArchive = archiveFactory.openArchive(moduleArchive);
       
            if(deploymentPlan != null && deploymentPlan.length() != 0) {
                planArchive = archiveFactory.openArchive(deploymentPlan);
                if (planArchive == null) {
                    throw new IllegalArgumentException(localStrings.getLocalString(
                        "enterprise.deployapi.spi.noarchivisthandlesplan",
                        "No archivist is able to handle the deployment plan {0}",
                        new Object [] {deploymentPlan.getAbsolutePath()}
View Full Code Here

Examples of com.sun.enterprise.deploy.shared.ArchiveFactory

        if (path==null) {
            // no particular path was provided, using tmp jar file
            File root = File.createTempFile(name,".jar")//NOI18N
            path = root.toURI();
        }
        ArchiveFactory factory = getArchiveFactory();
        boolean exists = false;
        if ((path.getScheme().equals("file")) ||  //NOI18N
            (path.getScheme().equals("jar"))) { //NOI18N
       
            File target = new File(path);
            exists = target.exists();                   
        } else {
            return null;
        }
        if (exists) {
            return factory.openArchive(path);           
        } else {
            return factory.createArchive(path);
        }
    }
View Full Code Here

Examples of com.sun.enterprise.deploy.shared.ArchiveFactory

                final String callerSuppliedAppName,
                final Habitat habitat) throws IOException, BootException, URISyntaxException, XMLStreamException, SAXParseException, UserError {
            /*
             * Make sure the requested URI exists and is readable.
             */
            ArchiveFactory af = ACCModulesManager.getComponent(ArchiveFactory.class);
            ReadableArchive ra = null;
            try {
                ra = af.openArchive(uri);
            } catch (IOException e) {
                final String msg = localStrings.getLocalString(
                        Launchable.class,
                        "appclient.cannotFindJarFile",
                        "Could not locate the requested client JAR file {0}; please try again with an existing, valid client JAR",
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.