/** * Gives the text value to be used for the top-level element in the descriptor * corresponding to this bundle node type. * * @param descriptor descriptor data structure for the current node * @return */ protected String topLevelTagValue(T descriptor) { return descriptor.getModuleDescriptor().getModuleName(); }
public String getAppJndiName() { if (enclosingBundle == null) return null; String modName = enclosingBundle.getModuleDescriptor().getModuleName(); StringBuffer javaAppPrefix = new StringBuffer("java:app/"); javaAppPrefix.append(modName); javaAppPrefix.append("/"); // If the managed bean is named, use the name for the final component // of the managed bean global name. Otherwise, use a derived internal // name since we'll still need a way to register and lookup the bean // from within the container. String componentName = isNamed() ? name : "___internal_managed_bean_" + beanClassName; javaAppPrefix.append(componentName); return javaAppPrefix.toString(); }
appName = application.getAppName(); String moduleName = bd.getModuleDescriptor().getModuleName(); StringBuilder javaGlobalName = new StringBuilder("java:global/"); if (jndiName.startsWith(ResourceConstants.JAVA_APP_SCOPE_PREFIX)) {
module.getModuleName().equals(module2.getModuleName())) { conflicted.add(module2); foundConflictedModule = true; cModule.setModuleName(cModule.getModuleName() + cModule.getModuleType().toString());
private String getJavaGlobalJndiNamePrefix(EjbDescriptor ejbDescriptor) { String appName = null; Application app = ejbDescriptor.getApplication(); if ( ! app.isVirtual() ) { appName = ejbDescriptor.getApplication().getAppName(); } EjbBundleDescriptor ejbBundle = ejbDescriptor.getEjbBundleDescriptor(); String modName = ejbBundle.getModuleDescriptor().getModuleName(); String ejbName = ejbDescriptor.getName(); StringBuilder javaGlobalPrefix = new StringBuilder("java:global/"); if (appName != null) { javaGlobalPrefix.append(appName); javaGlobalPrefix.append("/"); } javaGlobalPrefix.append(modName); javaGlobalPrefix.append("/"); javaGlobalPrefix.append(ejbName); return javaGlobalPrefix.toString(); }
/** * Return the fully-qualified portable JNDI name for a given * client view (Remote, Local, or no-interface). */ public String getPortableJndiName(String clientViewType) { String appName = null; Application app = getEjbBundleDescriptor().getApplication(); if ( ! app.isVirtual() ) { appName = app.getAppName(); } String modName = getEjbBundleDescriptor().getModuleDescriptor().getModuleName(); StringBuffer javaGlobalPrefix = new StringBuffer("java:global/"); if (appName != null) { javaGlobalPrefix.append(appName); javaGlobalPrefix.append("/"); } javaGlobalPrefix.append(modName); javaGlobalPrefix.append("/"); javaGlobalPrefix.append(getName()); javaGlobalPrefix.append("!"); javaGlobalPrefix.append(clientViewType); return javaGlobalPrefix.toString(); }
protected String getJavaGlobalJndiNamePrefix() { String appName = null; Application app = ejbDescriptor.getApplication(); if ( ! app.isVirtual() ) { appName = ejbDescriptor.getApplication().getAppName(); } EjbBundleDescriptorImpl ejbBundle = ejbDescriptor.getEjbBundleDescriptor(); String modName = ejbBundle.getModuleDescriptor().getModuleName(); String ejbName = ejbDescriptor.getName(); StringBuffer javaGlobalPrefix = new StringBuffer("java:global/"); if (appName != null) { javaGlobalPrefix.append(appName); javaGlobalPrefix.append("/"); } javaGlobalPrefix.append(modName); javaGlobalPrefix.append("/"); javaGlobalPrefix.append(ejbName); return javaGlobalPrefix.toString(); }
public String getGlobalJndiName() { String appName = null; if (enclosingBundle == null) return null; Application app = enclosingBundle.getApplication(); if ( !app.isVirtual() ) { appName = enclosingBundle.getApplication().getAppName(); } String modName = enclosingBundle.getModuleDescriptor().getModuleName(); StringBuffer javaGlobalPrefix = new StringBuffer("java:global/"); if (appName != null) { javaGlobalPrefix.append(appName); javaGlobalPrefix.append("/"); } javaGlobalPrefix.append(modName); javaGlobalPrefix.append("/"); // If the managed bean is named, use the name for the final component // of the managed bean global name. Otherwise, use a derived internal // name since we'll still need a way to register and lookup the bean // from within the container. String componentName = isNamed() ? name : "___internal_managed_bean_" + beanClassName; javaGlobalPrefix.append(componentName); return javaGlobalPrefix.toString(); }
private String getModuleName() throws NamingException { ComponentEnvManager namingMgr = habitat.getService(ComponentEnvManager.class); String moduleName = null; if( namingMgr != null ) { JndiNameEnvironment env = namingMgr.getCurrentJndiNameEnvironment(); BundleDescriptor bd = null; if( env instanceof EjbDescriptor ) { bd = ((EjbDescriptor)env).getEjbBundleDescriptor(); } else if( env instanceof BundleDescriptor ) { bd = (BundleDescriptor) env; } if( bd != null ) { moduleName = bd.getModuleDescriptor().getModuleName(); } } if( moduleName == null ) { throw new NamingException("Could not resolve " + JAVA_MODULE_NAME); } return moduleName; }
public static String getModuleName(JndiNameEnvironment env) { String moduleName = null; if (env instanceof EjbDescriptor) { // EJB component EjbDescriptor ejbEnv = (EjbDescriptor) env; EjbBundleDescriptor ejbBundle = ejbEnv.getEjbBundleDescriptor(); moduleName = ejbBundle.getModuleDescriptor().getModuleName(); } else if (env instanceof EjbBundleDescriptor) { EjbBundleDescriptor ejbBundle = (EjbBundleDescriptor) env; moduleName = ejbBundle.getModuleDescriptor().getModuleName(); } else if (env instanceof WebBundleDescriptor) { WebBundleDescriptor webEnv = (WebBundleDescriptor) env; moduleName = webEnv.getModuleName(); } else if (env instanceof ApplicationClientDescriptor) { ApplicationClientDescriptor appEnv = (ApplicationClientDescriptor) env; moduleName = appEnv.getModuleName(); } else if (env instanceof ManagedBeanDescriptor) { ManagedBeanDescriptor mb = (ManagedBeanDescriptor) env; moduleName = mb.getBundle().getModuleName(); } else { throw new IllegalArgumentException("IllegalJndiNameEnvironment : env"); } return moduleName; }
public ObjectName registerAppClient( final ObjectName parentMBean, final MetadataImpl meta, final com.sun.enterprise.config.serverbeans.Application appConfig, final ApplicationClientDescriptor bundleDesc) { final String xmlDesc = getDeploymentDescriptor(bundleDesc); if ( xmlDesc != null ) { meta.setDeploymentDescriptor( xmlDesc ); } final String moduleName = bundleDesc.getModuleDescriptor().getModuleName(); return registerJ2EEChild(parentMBean, meta, AppClientModule.class, AppClientModuleImpl.class, moduleName); }
String moduleName = bd.getModuleDescriptor().getModuleName();
ModuleDescriptor moduleDesc = bundleDesc.getModuleDescriptor(); moduleDesc.setArchiveUri(fileName); moduleName = moduleDesc.getModuleName(); } else { GenericAnnotationDetector detector =
/** * This method creates an Application object from reading the * standard deployment descriptor. * @param archive the archive for the application */ public Application createApplicationFromStandardDD( ReadableArchive archive, String archiveType) throws IOException, SAXException { Archivist archivist = archivistFactory.getArchivist(archiveType, null); String xmlValidationLevel = dasConfig.getDeployXmlValidation(); archivist.setXMLValidationLevel(xmlValidationLevel); if (xmlValidationLevel.equals("none")) { archivist.setXMLValidation(false); } BundleDescriptor desc = archivist.readStandardDeploymentDescriptor(archive); Application application = null; if (desc instanceof Application) { application = (Application)desc; } else { ModuleDescriptor newModule = archivist.createModuleDescriptor(desc); newModule.setArchiveUri(archive.getURI().getSchemeSpecificPart()); String moduleName = newModule.getModuleName(); application = Application.createVirtualApplication(moduleName, newModule); } return application; }
/** * 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); } }
aModule.getArchiveUri()); aModule.setModuleName( descriptor.getModuleDescriptor().getModuleName()); aModule.setDescriptor(descriptor); descriptor.setApplication(app); aModule.setContextRoot(wbd.getContextRoot()); else aModule.setContextRoot(aModule.getModuleName());