/** * Remove a web bundle descriptor from this application. * * @param bundleDescriptor the web bundle descriptor to remove */ public void removeBundleDescriptor(BundleDescriptor bundleDescriptor) { bundleDescriptor.setApplication(null); getWebBundleDescriptors().remove(bundleDescriptor); }
/** * The number of Web Components in this application. * Current implementation only return the number of servlets * inside the application, and not the JSPs since we cannot * get that information from deployment descriptors. * * @return the number of Web Components */ public int getWebComponentCount() { int count = 0; for (WebBundleDescriptor wbd : getWebBundleDescriptors()) { count = count + wbd.getWebComponentDescriptors().size(); } return count; }
/** * Obtain the full set of all the subcomponents of this application that use * a JNDI name environment.. * * @return the Set of JndiNameEnvironment objects. */ public Set<JndiNameEnvironment> getJndiNameEnvironments() { Set<JndiNameEnvironment> jndiNameEnvironments = new HashSet<JndiNameEnvironment>(); jndiNameEnvironments.add(this); jndiNameEnvironments.addAll(getWebBundleDescriptors()); jndiNameEnvironments.addAll(getApplicationClientDescriptors()); jndiNameEnvironments.addAll(getEjbDescriptors()); return jndiNameEnvironments; }
/** * Archivist read XML deployment descriptors and keep the * parsed result in the DOL descriptor instances. Sets the descriptor * for a particular Archivst type */ public void setDescriptor(Application descriptor) { java.util.Set webBundles = descriptor.getWebBundleDescriptors(); if (webBundles.size()>0) { this.descriptor = (WebBundleDescriptor) webBundles.iterator().next(); if (this.descriptor.getModuleDescriptor().isStandalone()) return; else this.descriptor=null; } }
/** * Return a set of all com.sun.enterprise.deployment.WebService * descriptors in the application. */ public Set<WebService> getWebServiceDescriptors() { Set<WebService> webServiceDescriptors = new HashSet<WebService>(); Set<BundleDescriptor> bundles = new HashSet<BundleDescriptor>(); bundles.addAll(getEjbBundleDescriptors()); bundles.addAll(getWebBundleDescriptors()); for (BundleDescriptor next : bundles) { WebServicesDescriptor webServicesDesc = next.getWebServices(); webServiceDescriptors.addAll(webServicesDesc.getWebServices()); } return webServiceDescriptors; }
/** * Return the set of roles used in this application. Currently, for release 1.0, it is an * * aggregation of all the roles in the sub-modules of the application. * * @return the Set of roles in the application. */ public Set<Role> getRoles() { Set<Role> roles = new HashSet<Role>(); for (WebBundleDescriptor wbd : getWebBundleDescriptors()) { if (wbd != null) { roles.addAll(wbd.getRoles()); } } for (EjbBundleDescriptor ejbd : getEjbBundleDescriptors()) { if (ejbd != null) { roles.addAll(ejbd.getRoles()); } } return roles; }
/** * Removes the given role. */ public void removeRole(Role role) { getAppRoles().remove(role); for (WebBundleDescriptor wbd : getWebBundleDescriptors()) { wbd.removeRole(role); } for (EjbBundleDescriptor ejbd : getEjbBundleDescriptors()) { ejbd.removeRole(role); } }
/** * Adds a new abstract role */ public void addRole(Role role) { for (WebBundleDescriptor wbd : getWebBundleDescriptors()) { wbd.addRole(role); } for (EjbBundleDescriptor ejbd : getEjbBundleDescriptors()) { ejbd.addRole(role); } }
/** * A formatted String representing my state. */ public void print(StringBuffer toStringBuffer) { toStringBuffer.append("Application"); toStringBuffer.append("\n"); super.print(toStringBuffer); toStringBuffer.append("\n smallIcon ").append(super.getSmallIconUri()); for (ModuleDescriptor<BundleDescriptor> aModule : getModules()) { toStringBuffer.append("\n Module : "); aModule.print(toStringBuffer); } toStringBuffer.append("\n EjbBundles: \n"); if (this.getEjbBundleDescriptors() != null) printDescriptorSet(this.getEjbBundleDescriptors(), toStringBuffer); toStringBuffer.append("\n WebBundleDescriptors "); if (this.getWebBundleDescriptors() != null) printDescriptorSet(this.getWebBundleDescriptors(), toStringBuffer); toStringBuffer.append("\n applicationClientDescriptors "); if (this.getApplicationClientDescriptors() != null) printDescriptorSet(this.getApplicationClientDescriptors(), toStringBuffer); toStringBuffer.append("\n roles ").append(getRoles()); toStringBuffer.append("\n RoleMapper ").append(this.getRoleMapper()); toStringBuffer.append("\n Realm ").append(realm); }
Set webDescriptorSet = app.getWebBundleDescriptors() ;
Collection<WebBundleDescriptor> webModules = app.getWebBundleDescriptors(); Collection<EjbBundleDescriptor> ejbModules = app.getEjbBundleDescriptors();
@Override protected void generateArtifacts(DeploymentContext dc) throws DeploymentException { OpsParams params = dc.getCommandParameters(OpsParams.class); if (params.origin != OpsParams.Origin.deploy) { return; } String appName = params.name(); try { Application app = dc.getModuleMetaData(Application.class); Set<WebBundleDescriptor> webDesc = app.getWebBundleDescriptors(); if (webDesc == null) { return; } for (WebBundleDescriptor webBD : webDesc) { loadPolicy(webBD, false); } } catch (Exception se) { String msg = "Error in generating security policy for " + appName; throw new DeploymentException(msg, se); } }
Set<WebBundleDescriptor> webDesc = app.getWebBundleDescriptors(); linkPolicies(app, webDesc); commitEjbs(app);