/** * Set the name of my context root. */ public void setContextRoot(String contextRoot) { if (getModuleDescriptor() != null) { getModuleDescriptor().setContextRoot(contextRoot); } this.contextRoot = contextRoot; }
/** * return the name of my context root */ public String getContextRoot() { if (getModuleDescriptor() != null && getModuleDescriptor().getContextRoot() != null) { return getModuleDescriptor().getContextRoot(); } if (contextRoot == null) { contextRoot = ""; } return contextRoot; }
/** * 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; } }
public void setElementValue(XMLElement element, String value) { if (TagNames.MODULE_NAME.equals(element.getQName())) { WebBundleDescriptor bundleDesc = getDescriptor(); bundleDesc.getModuleDescriptor().setModuleName(value); } else { super.setElementValue(element, value); } }
private String getWebDir(String baseDir) { if (baseDir == null) { return null; } StringBuilder dir = new StringBuilder(baseDir); dir.append(File.separator); com.sun.enterprise.deployment.Application app = _wbd.getApplication(); if (app != null && !app.isVirtual()) { dir.append(FileUtils.makeFriendlyFilename( app.getRegistrationName())); dir.append(File.separator); dir.append(FileUtils.makeFriendlyFilename( _wbd.getModuleDescriptor().getArchiveUri())); } else { dir.append(FileUtils.makeLegalNoBlankFileName( _wbd.getModuleID())); } return dir.toString(); } }
private SecurityRoleMapper getRoleMapper(){ Habitat habitat = Globals.getDefaultHabitat(); SecurityRoleMapper srm = null; if(habitat != null){ SecurityRoleMapperFactory srmf = habitat.getComponent(SecurityRoleMapperFactory.class); if(srmf != null){ srm = srmf.getRoleMapper(descriptor.getModuleDescriptor().getModuleName()); } } return srm; } public void addDescriptor(Object newDescriptor) {
String webUri = wbd.getModuleDescriptor().getArchiveUri(); String contextRoot = wbd.getModuleDescriptor().getContextRoot(); if (moduleID.equals(webUri)) { StringBuilder dir = new StringBuilder(location);
wbd.getModuleDescriptor().getAlternateDescriptor(); if (altDDName == null) { return;
contextRoot = wbd.getModuleDescriptor().getModuleName(); if(contextRoot==null) contextRoot = dc.getSource().getName();
/** * Translate Web Bundle Policy * @param webBD * @param remove boolean indicated whether any existing policy statements * are removed form context before translation * @throws DeploymentException */ private void loadPolicy(WebBundleDescriptor webBD, boolean remove) throws DeploymentException { try { if (webBD != null) { if (remove) { String cid = SecurityUtil.getContextID(webBD); WebSecurityManager wsm = wsmf.getManager(cid, null, true); if (wsm != null) { wsm.release(); } } wsmf.createManager(webBD, true, serverContext); } } catch (Exception se) { String msg = "Error in generating security policy for " + webBD.getModuleDescriptor().getModuleName(); throw new DeploymentException(msg, se); } }
/** * Translate Web Bundle Policy * @param webBD * @param remove boolean indicated whether any existing policy statements * are removed form context before translation * @throws DeploymentException */ private void loadPolicy(WebBundleDescriptor webBD, boolean remove) throws DeploymentException { try { if (webBD != null) { if (remove) { String cid = SecurityUtil.getContextID(webBD); WebSecurityManager wsm = wsmf.getManager(cid, null, true); if (wsm != null) { wsm.release(); } } wsmf.createManager(webBD, true, serverContext); } } catch (Exception se) { String msg = "Error in generating security policy for " + webBD.getModuleDescriptor().getModuleName(); throw new DeploymentException(msg, se); } }
/** * puts Web Bundle Policy In Service, repeats translation is Descriptor * indicate policy was changed by ContextListener. * @param webBD * @throws DeploymentException */ private void commitPolicy(WebBundleDescriptor webBD) throws DeploymentException { try { if (webBD != null) { if (webBD.isPolicyModified()) { // redo policy translation for web module loadPolicy(webBD, true); } String cid = SecurityUtil.getContextID(webBD); websecurityProbeProvider.policyCreationStartedEvent(cid); SecurityUtil.generatePolicyFile(cid); websecurityProbeProvider.policyCreationEndedEvent(cid); websecurityProbeProvider.policyCreationEvent(cid); } } catch (Exception se) { String msg = "Error in generating security policy for " + webBD.getModuleDescriptor().getModuleName(); throw new DeploymentException(msg, se); } }
/** * puts Web Bundle Policy In Service, repeats translation is Descriptor * indicate policy was changed by ContextListener. * @param webBD * @throws DeploymentException */ private void commitPolicy(WebBundleDescriptor webBD) throws DeploymentException { try { if (webBD != null) { if (webBD.isPolicyModified()) { // redo policy translation for web module loadPolicy(webBD, true); } String cid = SecurityUtil.getContextID(webBD); websecurityProbeProvider.policyCreationStartedEvent(cid); SecurityUtil.generatePolicyFile(cid); websecurityProbeProvider.policyCreationEndedEvent(cid); websecurityProbeProvider.policyCreationEvent(cid); } } catch (Exception se) { String msg = "Error in generating security policy for " + webBD.getModuleDescriptor().getModuleName(); throw new DeploymentException(msg, se); } }
} else { moduleName = wbd.getModuleDescriptor().getArchiveUri(); StringBuilder sb = new StringBuilder(); sb.append(app.getRegistrationName()).