Package com.sun.enterprise.deployment

Examples of com.sun.enterprise.deployment.Application


            if (bd != null) {
                md = bd.getModuleDescriptor();
            }

            Application a = bd.getApplication();
            if (a != null) {
                if (a.isVirtual()) {
                    rvalue = a.getRegistrationName();
                } else if (md != null) {
                    rvalue = FileUtils.makeFriendlyFileName(md.getArchiveUri());
                }
            } else if (md != null) {
                rvalue = FileUtils.makeFriendlyFileName(md.getArchiveUri());
View Full Code Here


        if (selectedAppClientDescriptor != null) {
            return selectedAppClientDescriptor;
        }

        Application app = Application.class.cast(archivist.getDescriptor());

        /*
         *There could be one or more app clients embedded in the enterprise app
         *in the archive.  Choose which one to run based on the user's
         *command-line input.
         */
        Set<ApplicationClientDescriptor> embeddedAppClients =
            (Set<ApplicationClientDescriptor>)
                app.getApplicationClientDescriptors();

        /*
         *Make sure the application module contains at least one app client.
         */
        if (embeddedAppClients.size() == 0) {
View Full Code Here

      {
        return;
      }
      else
      {
        Application app = request.getDescriptor();
        EjbBundleDescriptor ejbBundleDesc =
          (EjbBundleDescriptor)
          app.getStandaloneBundleDescriptor();
                                Iterator<EjbDescriptor> ejbIT = ejbBundleDesc.getEjbs().iterator();
                                while (ejbIT.hasNext()) {
                                    EJBSecurityManager.createManager(ejbIT.next(),true);
                                }
        //For standalone ejbs, the RoleMapper should be constructed by now
View Full Code Here

            }
        }
        Vector moduleNames = new Vector();
       
        if (descriptor.isApplication()) {
            Application app = (Application) descriptor;
            for (Iterator modules = app.getModules();modules.hasNext();) {
                ModuleDescriptor md = (ModuleDescriptor) modules.next();
                Archivist moduleArchivist = ArchivistFactory.getArchivistForType(md.getModuleType());
               
                AbstractArchive subSource = source.getEmbeddedArchive(md.getArchiveUri());
                AbstractArchive subSource2 = source2.getEmbeddedArchive(md.getArchiveUri());
View Full Code Here

                "wbd = {0} for {1}", new Object[]{wbd, webModule.getName()});
        if(wbd == null) {
            // for some system app like adminGUI, wbd is null
            return;
        }
        final Application application  = wbd.getApplication();
        // load PUs only for standaalone wars.
        // embedded wars are taken care of in ApplicationLoader.
        if(application != null && application.isVirtual()) {
            try{
                new PersistenceUnitLoaderImpl().load(new ApplicationInfoImpl(
                        explodedLocation, wbd, webModule));
            } catch(Exception e){
                throw new RuntimeException(e);
View Full Code Here

                "wbd = {0} for {1}", new Object[]{wbd, webModule.getName()});
        if(wbd == null) {
            // for some system app like adminGUI, wbd is null
            return true;
        }
        final Application application  = wbd.getApplication();
        // unload PUs only for standaalone wars.
        // embedded wars are taken care of in ApplicationLoader.
        if(application != null && application.isVirtual()) {
            try{
                new PersistenceUnitLoaderImpl().unload(new ApplicationInfoImpl(
                        explodedLocation, wbd, webModule));
            } catch(Exception e){
                _logger.log(Level.WARNING, e.getMessage(), e);
View Full Code Here

                // processing
                ClassLoader origContextClassLoader =
                    Thread.currentThread().getContextClassLoader();
                Thread.currentThread().setContextClassLoader(ejbClassLoader);

                Application application = request.getDescriptor();
                if (application!=null && ModuleType.EAR.equals(archivist.getModuleType())) {
                    archivist.readPersistenceDeploymentDescriptors(in, application);
                    // Now process standard DDs, do this before runtime DDs
                    archivist.setHandleRuntimeInfo(false);
                    boolean modulesReadSuccess = ((ApplicationArchivist) archivist).readModulesDescriptors(application, in);
                    if (modulesReadSuccess ) {
                        // now process runtime DDs
                        archivist.setHandleRuntimeInfo(true);
                        archivist.readRuntimeDeploymentDescriptor(in, application);
                    } else {
                        // it failed reading sub modules, I null our application which will trigger
                        // deployment failure handling
                        application=null;
                    }
                } else {
                    application = ApplicationArchivist.openArchive(archivist, in, true);
                }
                if (application==null) {
                    throw new IASDeploymentException(localStrings.getString(
                            "enterprise.deployment.backend.error_loading_dds",
                            new Object[] { request.getName(), " " }));
                }
    application.setRegistrationName(request.getName());
   
    application.setClassLoader(ejbClassLoader);
                archivist.setDescriptor(application);
 
                // let's check for optional dependencies
                if (!archivist.performOptionalPkgDependenciesCheck(in)) {
                    throw new IASDeploymentException(localStrings.getString("enterprise.deployment.backend.archive_opt_dep_not_satisfied", new Object[] {in.getArchiveUri()}));
                }
                               
    archivist.validate(ejbClassLoader);
   
    if (!application.getWebServiceDescriptors().isEmpty()) {
        ModuleContentLinker visitor = new ModuleContentLinker(in);
        application.visit((com.sun.enterprise.deployment.util.ApplicationVisitor) visitor);
    }     
    request.setDescriptor(application)
               
                // restore the original context class loader
                Thread.currentThread().setContextClassLoader(
View Full Code Here

         * to be included in the app client JAR
         */
        ArrayList<String> libraries = new ArrayList<String>();
        URI appURI = new File(source.getArchiveUri()).toURI();
       
        Application app = Application.class.cast(descriptor);
        for (Iterator modules = app.getModules(); modules.hasNext();) {
            ModuleDescriptor md = ModuleDescriptor.class.cast(modules.next());

            //ignore the war and rar modules, include both appclient and ejb
            if ( ! (md.getModuleType().equals(ModuleType.WAR)
                || md.getModuleType().equals(ModuleType.RAR)) ){
View Full Code Here

        // create appclient format for standalone appclient module
        if (request.getDescriptor().isVirtual()) {
            return true;
        }

        Application app = Application.class.cast(descriptor);
        Set appClients = app.getApplicationClientDescriptors();
        if (appClients != null) {
   
            // create ear format of appclient if there are more than
            // one appclients in the ear file
            if (appClients.size() > 1) {
                return false;
            }

            if (!appClients.isEmpty()) {
                ApplicationClientDescriptor ac =
                ApplicationClientDescriptor.class.cast(appClients.iterator().next());

                // checks to see if this appclient has entries for
                // message-destination-ref.  if so, use ear format
                Set msgDestRefs = ac.getMessageDestinationReferenceDescriptors();
                if (msgDestRefs != null && !msgDestRefs.isEmpty()) {
                    return false;
                }

                // checks to see if this appclient depends on a PU.
                // if so, use ear format
                Set entityMgrFacRefs = ac.getEntityManagerFactoryReferenceDescriptors();
                if (entityMgrFacRefs != null && !entityMgrFacRefs.isEmpty()) {
                    return false;
                }
            }
        }

        for (Iterator modules = app.getModules(); modules.hasNext();) {
            ModuleDescriptor md = ModuleDescriptor.class.cast(modules.next());

            // checks to see if any of the sub modules uses altDD
            // if so, use the application package format.  we could
            // also choose to override the original dd with the altDD,
View Full Code Here

  protected void deploy() throws IASDeploymentException
  {
    try
    {

            Application app;
      if(isArchive()) {                 
                app = explodeArchive();
      } else { //directory deploy
                //create the generated/xml directory for directory deploy
                getXMLDir().mkdirs();
                getJWSDir().mkdirs();
                getStubsDir().mkdirs();

                // construct the standard application.xml if omitted
                ApplicationArchivist appArchivist = new ApplicationArchivist();
            String dir = request.getDeployedDirectory().getAbsolutePath();
                FileArchive appArchive = new FileArchive();
                appArchive.open(dir);
                if (!appArchivist.hasStandardDeploymentDescriptor(appArchive)) {
                    Application appDesc =
                        Application.createApplication(appArchive,true,true);
                    request.setDescriptor(appDesc);
                }

                // load deployment descriptors
View Full Code Here

TOP

Related Classes of com.sun.enterprise.deployment.Application

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.