Package com.sun.enterprise.deployment

Examples of com.sun.enterprise.deployment.Application


     */   
    public Node writeDescriptor(Node parent, Descriptor descriptor) {
        if (! (descriptor instanceof Application)) {
            throw new IllegalArgumentException(getClass() + " cannot handles descriptors of type " + descriptor.getClass());
        }           
        Application application = (Application) descriptor;
        Node appNode = super.writeDescriptor(parent, application);
       
        // module
        ModuleNode moduleNode = new ModuleNode();
        for (Iterator modules = application.getModules();modules.hasNext();) {
            ModuleDescriptor next = (ModuleDescriptor) modules.next();
            moduleNode.writeDescriptor(appNode, ApplicationTagNames.MODULE, next);
        }

        // security-role*
        // this information is not written out since it's already included
        // in the sub module deployment descriptors


        // library-directory
        if (application.getLibraryDirectoryRawValue() != null) {
            appendTextChild(appNode, ApplicationTagNames.LIBRARY_DIRECTORY,
                application.getLibraryDirectoryRawValue());
        }
        return appNode;
    }
View Full Code Here


        } else
        if (newDescriptor instanceof SecurityRoleMapping) {
            SecurityRoleMapping srm = (SecurityRoleMapping) newDescriptor;
            descriptor.getSunDescriptor().addSecurityRoleMapping(srm);
            // store it in the application using pure DOL descriptors...
            Application app = descriptor.getApplication();
            if (app!=null) {
                Role role = new Role(srm.getRoleName());
                SecurityRoleMapper rm = app.getRoleMapper();
                if (rm != null) {
                    List<PrincipalNameDescriptor> principals = srm.getPrincipalNames();
                    for (int i = 0; i < principals.size(); i++) {
                        rm.assignRole(principals.get(i).getPrincipal(),
                            role, descriptor);
View Full Code Here

    public void setElementValue(XMLElement element, String value) {
        if (element.getQName().equals(RuntimeTagNames.CONTEXT_ROOT)) {
            // only set the context root for standalone war;
            // for embedded war, the context root will be set
            // using the value in application.xml
            Application app = descriptor.getApplication();
            if ( (app == null) || (app!=null && app.isVirtual()) ) {
                descriptor.setContextRoot(value);
            }
        } else
  super.setElementValue(element, value);
    }
View Full Code Here

     */
    public void addDescriptor(Object newDescriptor) {
        if (newDescriptor instanceof SecurityRoleMapping) {
            SecurityRoleMapping roleMap = (SecurityRoleMapping)newDescriptor;
            descriptor.addSecurityRoleMapping(roleMap);
            Application app = descriptor.getApplication();
            if (app!=null) {
                Role role = new Role(roleMap.getRoleName());
                SecurityRoleMapper rm = app.getRoleMapper();
                if (rm != null) {
                    List<PrincipalNameDescriptor> principals = roleMap.getPrincipalNames();
                    for (int i = 0; i < principals.size(); i++) {
                        rm.assignRole(principals.get(i).getPrincipal(),
                            role, descriptor);
View Full Code Here

     */   
    public Node writeDescriptor(Node parent, String nodeName, Descriptor descriptor) {   
        if (! (descriptor instanceof Application)) {
            throw new IllegalArgumentException(getClass() + " cannot handles descriptors of type " + descriptor.getClass());
        }
        Application application = (Application) descriptor;
        Node appNode = super.writeDescriptor(parent, nodeName, descriptor);
 
        // web*
  for (Iterator modules=application.getModules();modules.hasNext();) {
      ModuleDescriptor module = (ModuleDescriptor) modules.next();
      if (module.getModuleType().equals(ModuleType.WAR)) {
    Node web = appendChild(appNode, RuntimeTagNames.WEB);
    appendTextChild(web, RuntimeTagNames.WEB_URI, module.getArchiveUri());
    appendTextChild(web, RuntimeTagNames.CONTEXT_ROOT, module.getContextRoot());
      }
  }
 
  // pass-by-reference ?
  if (application.isPassByReferenceDefined()) {
      appendTextChild(appNode, RuntimeTagNames.PASS_BY_REFERENCE, String.valueOf(application.getPassByReference()));
  }
 
  // unique-id
  appendTextChild(appNode, RuntimeTagNames.UNIQUE_ID, String.valueOf(application.getUniqueId()));
 
        // security-role-mapping*
        List<SecurityRoleMapping> roleMappings = application.getSecurityRoleMappings();
        for (int i = 0; i < roleMappings.size(); i++) {
            SecurityRoleMappingNode srmn = new SecurityRoleMappingNode();
            srmn.writeDescriptor(appNode, RuntimeTagNames.SECURITY_ROLE_MAPPING, roleMappings.get(i));
        }
       
        // realm?
        appendTextChild(appNode, RuntimeTagNames.REALM, application.getRealm());
       
        return appNode;
    }
View Full Code Here

        // create the application object.
        ApplicationArchivist archivist = new ApplicationArchivist();
        FileArchive appArchive = new FileArchive();
        appArchive.open(new File(explodedDir).getAbsolutePath());
        archivist.setManifest(appArchive.getManifest());
        Application application = null;
        if (archivist.hasStandardDeploymentDescriptor(appArchive)) {
            application = (Application)
                    archivist.readStandardDeploymentDescriptor(appArchive);
        } else {
            application = Application.createApplication(appArchive, true, true);
        }
        archivist.setDescriptor(application);

        Iterator<ModuleDescriptor> bundles = application.getModules();
        // archive all the modules first.
        while (bundles.hasNext()) {
            ModuleDescriptor bundle = bundles.next();
            String moduleName = bundle.getArchiveUri(); // eg., EJBImplementWSDL.jar
            String massagedModuleName = FileUtils.makeFriendlyFilename(moduleName); // eg., EJBImplementWSDL_jar
View Full Code Here

            // Get application descriptor

            AppsManager am = InstanceFactory.createAppsManager(
        ApplicationServer.getServerContext().getInstanceName());

            Application appD = (Application)
                DeploymentUtils.getDescriptor(standaloneModuleName, am);

            // Get the bundle descriptor for the given module
            // and determine its' type

            BundleDescriptor bd = null;
            java.util.Set bds = appD.getBundleDescriptors();
            for(Iterator it=bds.iterator(); it.hasNext(); ) {
                bd = (BundleDescriptor)it.next();
                if ((bd.getModuleDescriptor().getArchiveUri()).equals(subModuleName) ||
                     bd.getModuleID().equals(subModuleName) ||
         bd.getName().equals(subModuleName)) {
View Full Code Here

        try {
            final com.sun.enterprise.admin.target.Target target =
                getListTarget(targetName);
            final String[] apps = filterAppsByTargetAndAppName(target, appName);
            for (int i = 0; i < apps.length; i++) {
                final Application ad = getDescrForApplication(apps[i]);
                final String app_name = ad.getRegistrationName();
                final Set bds = ad.getRarDescriptors();
                for(Iterator it = bds.iterator(); it.hasNext(); ) {
                    final ConnectorDescriptor cd = (ConnectorDescriptor)it.next();
                    final String rarJndiName = app_name +
                        ConnectorConstants.EMBEDDEDRAR_NAME_DELIMITER +
                        FileUtils.makeFriendlyFilenameNoExtension(cd.getDeployName());
View Full Code Here

            } else if (j2eeType.equals("AppClientModule")) {
                BundleDescriptor bd = getDescrForStandAloneCarModule(standAloneModuleName);
                modComponents = getValidatedObjectNames(getCarModuleComponents(bd));
                return modComponents;
            } else if (j2eeType.equals("J2EEApplication")) {
                Application ad = getDescrForApplication(standAloneModuleName);
                modComponents = getValidatedObjectNames(getApplicationComponents(ad));
                return modComponents;
            } else {
                throw new ServerInstanceException(
      localStrings.getString("admin.mbeans.ssmb.invalid_app_or_module_name",
View Full Code Here

                appName + " and module = " + modName);

            // Get application descriptor

            AppsManager am = InstanceFactory.createAppsManager(getInstanceName());
      Application appD = null;
      try {
            appD = (Application) DeploymentUtils.getDescriptor(appName, am);
      } catch (java.lang.NullPointerException npe) {
                throw new ServerInstanceException(
      localStrings.getString("admin.mbeans.ssmb.invalid_appname", appName));
      }

            // Get the bundle descriptor for the given module
            // and determine its' type

            BundleDescriptor bd = null;
            ModuleType modType = null;
            java.util.Set bds = appD.getBundleDescriptors();
            for(Iterator it=bds.iterator(); it.hasNext(); ) {
                bd = (BundleDescriptor)it.next();
                if ((bd.getModuleDescriptor().getArchiveUri()).equals(modName) ||
                     bd.getModuleID().equals(modName) ||
         bd.getName().equals(modName)) {
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.