Examples of ArchivistFactory


Examples of com.sun.enterprise.deployment.archivist.ArchivistFactory

   

    private String getDeploymentDescriptor(
        final BundleDescriptor bundleDesc )
    {
        final ArchivistFactory archivistFactory = J2EEInjectedValues.getInstance().getArchivistFactory();
       
        String dd = "unavailable";
        ByteArrayOutputStream out = null;
        try
        {
            final Archivist moduleArchivist = archivistFactory.getArchivist(bundleDesc.getModuleDescriptor().getModuleType());
            final DeploymentDescriptorFile ddFile =  moduleArchivist.getStandardDDFile();
           
            out = new ByteArrayOutputStream();
            ddFile.write(bundleDesc, out);
            final String charsetName = "UTF-8";
View Full Code Here

Examples of com.sun.enterprise.deployment.archivist.ArchivistFactory

    }

    private String getDeploymentDescriptor(
        final BundleDescriptor bundleDesc )
    {
        final ArchivistFactory archivistFactory = J2EEInjectedValues.getInstance().getArchivistFactory();
       
        String dd = "unavailable";
        ByteArrayOutputStream out = null;
        try
        {
            final Archivist moduleArchivist = archivistFactory.getArchivist(bundleDesc.getModuleDescriptor().getModuleType());
            final DeploymentDescriptorFile ddFile =  moduleArchivist.getStandardDDFile();
           
            out = new ByteArrayOutputStream();
            ddFile.write(bundleDesc, out);
            final String charsetName = "UTF-8";
View Full Code Here

Examples of com.sun.enterprise.deployment.archivist.ArchivistFactory

    }

    private String getDeploymentDescriptor(
        final BundleDescriptor bundleDesc )
    {
        final ArchivistFactory archivistFactory = J2EEInjectedValues.getInstance().getArchivistFactory();
       
        String dd = "unavailable";
        ByteArrayOutputStream out = null;
        try
        {
            final Archivist moduleArchivist = archivistFactory.getArchivist(bundleDesc.getModuleDescriptor().getModuleType());
            final DeploymentDescriptorFile ddFile =  moduleArchivist.getStandardDDFile();
           
            out = new ByteArrayOutputStream();
            ddFile.write(bundleDesc, out);
            final String charsetName = "UTF-8";
View Full Code Here

Examples of com.sun.enterprise.deployment.archivist.ArchivistFactory


    public static void setExtensionArchivistForSubArchivist(ServiceLocator habitat, ReadableArchive archive, ModuleDescriptor md, Application app, Archivist subArchivist) {
        try {
            Collection<Sniffer> sniffers = getSniffersForModule(habitat, archive, md, app);
            ArchivistFactory archivistFactory = habitat.getService(ArchivistFactory.class);
            subArchivist.setExtensionArchivists(archivistFactory.getExtensionsArchivists(sniffers, subArchivist.getModuleType()));
        } catch (Exception e) {
            deplLogger.log(Level.WARNING,
                           EXCEPTION_CAUGHT,
                           new Object[] { e.getMessage(), e });
        }
View Full Code Here

Examples of com.sun.enterprise.deployment.archivist.ArchivistFactory

    }

    private String getDeploymentDescriptor(
        final BundleDescriptor bundleDesc )
    {
        final ArchivistFactory archivistFactory = J2EEInjectedValues.getInstance().getArchivistFactory();
       
        String dd = "unavailable";
        ByteArrayOutputStream out = null;
        try
        {
            final Archivist moduleArchivist = archivistFactory.getArchivist(bundleDesc.getModuleDescriptor().getModuleType());
            final DeploymentDescriptorFile ddFile =  moduleArchivist.getStandardDDFile();
           
            out = new ByteArrayOutputStream();
            ddFile.write(bundleDesc, out);
            final String charsetName = "UTF-8";
View Full Code Here

Examples of com.sun.enterprise.deployment.archivist.ArchivistFactory

        securityServicesUtilProvider.get();
        return containerCallbackHandlerProvider.get();
    }

    public ConnectorArchivist getConnectorArchvist() throws ConnectorRuntimeException {
        ArchivistFactory archivistFactory = archivistFactoryProvider.get();
        return (ConnectorArchivist) archivistFactory.getArchivist(archiveType);
    }
View Full Code Here

Examples of com.sun.enterprise.deployment.archivist.ArchivistFactory


    public static void setExtensionArchivistForSubArchivist(ServiceLocator habitat, ReadableArchive archive, ModuleDescriptor md, Application app, Archivist subArchivist) {
        try {
            Collection<Sniffer> sniffers = getSniffersForModule(habitat, archive, md, app);
            ArchivistFactory archivistFactory = habitat.getService(ArchivistFactory.class);
            subArchivist.setExtensionArchivists(archivistFactory.getExtensionsArchivists(sniffers, subArchivist.getModuleType()));
        } catch (Exception e) {
            deplLogger.log(Level.WARNING,
                           EXCEPTION_CAUGHT,
                           new Object[] { e.getMessage(), e });
        }
View Full Code Here

Examples of com.sun.enterprise.deployment.archivist.ArchivistFactory

   

    private String getDeploymentDescriptor(
        final BundleDescriptor bundleDesc )
    {
        final ArchivistFactory archivistFactory = J2EEInjectedValues.getInstance().getArchivistFactory();
       
        String dd = "unavailable";
        ByteArrayOutputStream out = null;
        try
        {
            final Archivist moduleArchivist = archivistFactory.getArchivist(bundleDesc.getModuleDescriptor().getModuleType());
            final DeploymentDescriptorFile ddFile =  moduleArchivist.getStandardDDFile();
           
            out = new ByteArrayOutputStream();
            ddFile.write(bundleDesc, out);
            final String charsetName = "UTF-8";
View Full Code Here

Examples of com.sun.enterprise.deployment.archivist.ArchivistFactory

     */
    public void create(RootDeploymentDescriptor descriptor, ReadableArchive source,
        ReadableArchive source2, WritableArchive target,ZipItem[] stubs,
        Properties props) throws IOException {
       
        ArchivistFactory archivistFactory = Globals.
            getDefaultHabitat().getComponent(ArchivistFactory.class);

        // in all cases we copy the stubs file in the target archive
        Set elements = new HashSet();
        for (int i=0; i<stubs.length;i++) {
            ZipItem item = stubs[i];
            if (elements.contains(item.getName())) {
                continue;
            }
            elements.add(item.getName());
            OutputStream os = null;
            InputStream is = null;
            try {
                os = target.putNextEntry(item.getName());
                is = new BufferedInputStream(new FileInputStream(item.getFile()));
                ArchivistUtils.copyWithoutClose(is, os);
            } finally {
                if (is != null) {
                    is.close();
                }
                if (os != null) {
                    target.closeEntry();
                }
            }
        }
        Vector moduleNames = new Vector();
       
        if (descriptor.isApplication()) {
            Application app = (Application) descriptor;
            for (ModuleDescriptor md : app.getModules()) {
                Archivist moduleArchivist = archivistFactory.getArchivist(md.getModuleType());
               
                ReadableArchive subSource = source.getSubArchive(md.getArchiveUri());
                ReadableArchive subSource2 = source2.getSubArchive(md.getArchiveUri());
                moduleNames.add(md.getArchiveUri());
               
                // any file that needs to be kept in the sub module should be
                // calculated here
                Vector subEntries = new Vector();
                // manifest file always stay in embedded jar
                subEntries.add(JarFile.MANIFEST_NAME);
  
                BundleDescriptor subBundleDesc =
                    (BundleDescriptor) md.getDescriptor();
                // all mapping file stay within the embedded jar
                WebServicesDescriptor wsd = subBundleDesc.getWebServices();
                if (wsd!=null) {
                    for (Iterator itr = wsd.getWebServices().iterator();itr.hasNext();) {
                        WebService ws = (WebService) itr.next();
                        subEntries.add(ws.getMappingFileUri());
                    }               
                }
               
                Set refs = subBundleDesc.getServiceReferenceDescriptors();
                for (Iterator itr = refs.iterator();itr.hasNext();) {
                    ServiceReferenceDescriptor srd = (ServiceReferenceDescriptor) itr.next();
                    subEntries.add(srd.getMappingFileUri());
                }
               
                // first copy original module files in the root on the target
                // except for .rar files contents.
                // We need to do it first so we save the list of files to be saved in the
                // embedded archive (for proper deployment descriptor loading)
                List embeddedFiles = new ArrayList();
                for (Enumeration e = subSource.entries();e.hasMoreElements();) {
                   
                    String entryName = (String) e.nextElement();
                   
                    // Deployment Descriptors (and associated) go in the embedded files
                    if (entryName.endsWith(".xml"||
                        subEntries.contains(entryName) ||
                        entryName.startsWith(subBundleDesc.getWsdlDir())) {
                       
                          embeddedFiles.add(entryName);
                    } else {
                        try {
                            copy(subSource, target, entryName);
                        } catch(IOException ioe) {
                            // dup, we ignore
                        }
                    }
                }
               
                // now we need to copy the files we saved inside the embedded
                // archive file
               
                WritableArchive subTarget = target.createSubArchive(md.getArchiveUri());
               
                // and copy the list of identified files inside it

                // copy deployment descriptor files from generated xml directory
                for (Iterator itr = embeddedFiles.iterator();itr.hasNext();) {
                    String entryName = (String) itr.next();
                    copyWithOverride(subSource, subSource2, subTarget, entryName);
                }

                copy(subSource, subSource2, subTarget,
                    moduleArchivist.getStandardDDFile().getDeploymentDescriptorPath(),
                    embeddedFiles);

                // every module may not have a sun descriptor, e.g. par file does not have one.
                if(moduleArchivist.getConfigurationDDFile()!=null) {
                    copy(subSource, subSource2, subTarget,
                        moduleArchivist.getConfigurationDDFile().getDeploymentDescriptorPath(),
                        embeddedFiles);
                }

                // and the manifest file since it does not appear in the list of files...
                copy(subSource, subTarget, JarFile.MANIFEST_NAME);
               
                // we do not need to copy anything else from the source embedded module
                // since all .class files and resources have moved at the top level of the target
                // application client container jar, so we can close out both subarchives
                target.closeEntry(subTarget);
                subSource.close();
                subSource2.close();
            }
        }
        // standalone modules and .ear file level entries fall back here, we
        // just need to copy the original archive file elements at the root level
        // of the target application client container jar file.
        Archivist archivist = archivistFactory.getArchivist(descriptor.getModuleType());

        // because of the backend layout, the appclient jar file appears in the list of files
        // in the source archive (which is the exploded directory where we started writing
        // the appclient file... this is also true when doing deploydir deployment
        String appClientFileName = target.getURI().getSchemeSpecificPart().substring(target.getURI().getSchemeSpecificPart().lastIndexOf(File.separatorChar)+1);
View Full Code Here

Examples of com.sun.enterprise.deployment.archivist.ArchivistFactory


    public static void setExtensionArchivistForSubArchivist(ServiceLocator habitat, ReadableArchive archive, ModuleDescriptor md, Application app, Archivist subArchivist) {
        try {
            Collection<Sniffer> sniffers = getSniffersForModule(habitat, archive, md, app);
            ArchivistFactory archivistFactory = habitat.getService(ArchivistFactory.class);
            subArchivist.setExtensionArchivists(archivistFactory.getExtensionsArchivists(sniffers, subArchivist.getModuleType()));
        } catch (Exception e) {
            deplLogger.log(Level.WARNING,
                           EXCEPTION_CAUGHT,
                           new Object[] { e.getMessage(), e });
        }
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.