Refine search
/** * Return the Vector of ejb deployment objects. */ public Vector getEjbDescriptors() { Vector ejbDescriptors = new Vector(); for (EjbBundleDescriptor ejbBundleDescriptor : getBundleDescriptors(EjbBundleDescriptor.class)) { ejbDescriptors.addAll(ejbBundleDescriptor.getEjbs()); } return ejbDescriptors; }
/** Calculate module name from a bundle. * @return module name. */ public static String getModuleName(EjbBundleDescriptor bundle) { String moduleName = null; Application application = bundle.getApplication(); if (application.isVirtual()) { // Stand-alone module is deployed. moduleName = application.getRegistrationName(); } else { // Module is deployed as a part of an Application. String jarName = bundle.getModuleDescriptor().getArchiveUri(); int l = jarName.length(); // Remove ".jar" from the bundle's jar name. moduleName = jarName.substring(0, l - 4); } return moduleName; }
EjbInvocation(String compEnvId, Container container) { super.componentId = compEnvId; super.container = container; super.setComponentInvocationType(ComponentInvocation.ComponentInvocationType.EJB_INVOCATION); EjbBundleDescriptor ejbBundleDesc = container.getEjbDescriptor().getEjbBundleDescriptor(); moduleName = ejbBundleDesc.getModuleName(); appName = ejbBundleDesc.getApplication().getAppName(); //By default we enable TransactionOperationsManager checks. But EjbInvocation.clone() // clears transactionOperationsManager so that, be default, cloned invocations // doesn't enforce Transaction Operations checks. transactionOperationsManager = this; }
public static String getContextID(EjbBundleDescriptor ejbBundleDesc) { String cid = null; if (ejbBundleDesc != null) { /* detect special case of EJBs embedded in a war, * and make sure psuedo policy context id is unique within app */ Object root = ejbBundleDesc.getModuleDescriptor().getDescriptor(); if( (root != ejbBundleDesc) && (root instanceof WebBundleDescriptor ) ) { cid = createUniquePseudoModuleID(ejbBundleDesc); } else { cid = VersioningUtils.getRepositoryName(ejbBundleDesc.getApplication().getRegistrationName()) + '/' + ejbBundleDesc.getUniqueFriendlyId(); } } return cid; } public static String getContextID(WebBundleDescriptor wbd) {
if (!app.isVirtual()) { logger.finest("Summary for application: "+ app.getRegistrationName()); } else { logger.finest("Standalone module."); Set allRoles = app.getRoles(); if (allRoles == null) { logger.finest("- No roles present."); logger.finest("--[ EJB module: " + bundle.getName() + " ]--"); Set ejbs = bundle.getEjbs(); Iterator it = ejbs.iterator(); while (it.hasNext()) { ram.add(bundle.getName() + ":" + ejb.getEjbClassName() + "." + md.getFormattedString()); while (rksi.hasNext()) { HashSet ram = (HashSet)allRoleMap.get(rksi.next()); ram.add(bundle.getName() + ":" + ejb.getEjbClassName() + "." + md.getFormattedString());
if (!app.isVirtual()) { logger.finest("Summary for application: "+ app.getRegistrationName()); } else { logger.finest("Standalone module."); app.getEjbComponentCount()); logger.finest("Web components: " + app.getWebComponentCount()); logger.finest("--[ EJB module: " + bundle.getName() + " ]--"); Set ejbs = bundle.getEjbs(); Iterator it = ejbs.iterator(); while (it.hasNext()) { ram.add(bundle.getName() + ":" + ejb.getEjbClassName() + "." + md.getFormattedString()); while (rksi.hasNext()) { HashSet ram = (HashSet)allRoleMap.get(rksi.next()); ram.add(bundle.getName() + ":" + ejb.getEjbClassName() + "." + md.getFormattedString());
.getEnvironmentProperties() : null; if(environmentProperties != null) { for (EnvironmentProperty environmentProperty : environmentProperties) { .getBundleDescriptors(ApplicationClientDescriptor.class); Vector appClientLevel = new Vector(); for (ApplicationClientDescriptor acd : appClientDescs) { for (EjbBundleDescriptor ebd : ejbBundleDescs) { Set<ResourceDescriptor> resourceDescriptors = ebd .getAllResourcesDescriptors(); if (findExistingDescriptors(resourceDescriptors, EJBBUNDLE_LEVEL + ebd.getName())) { return false; ebdLevel.add(EJBBUNDLE_LEVEL + ebd.getName()); Set<EjbDescriptor> ejbDescriptors = (Set<EjbDescriptor>) ebd.getEjbs(); for (Iterator itr = ejbDescriptors.iterator(); itr.hasNext();) { EjbDescriptor ejbDescriptor = (EjbDescriptor) itr.next(); resourceDescriptors = ejbDescriptor.getAllResourcesDescriptors(); if (findExistingDescriptors(resourceDescriptors, EJB_LEVEL + ebd.getName() + "#" + ejbDescriptor.getName())) { return false; edLevel.add(EJB_LEVEL + ebd.getName() + "#" + ejbDescriptor.getName());
/** * 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(); }
Descriptor d = ejbBundle.getModuleDescriptor().getDescriptor(); id = webEnv.getApplication().getName() + ID_SEPARATOR + webEnv.getContextRoot(); if (deplLogger.isLoggable(Level.FINER)) { id = ejbEnv.getApplication().getName() + ID_SEPARATOR + ejbBundle.getModuleDescriptor().getArchiveUri() + ID_SEPARATOR + ejbEnv.getName() + ID_SEPARATOR + flattedJndiName + ejbEnv.getUniqueId(); id = webEnv.getApplication().getName() + ID_SEPARATOR + webEnv.getContextRoot(); } else if (env instanceof ApplicationClientDescriptor) { EjbBundleDescriptor ejbBundle = (EjbBundleDescriptor) env; id = "__ejbBundle__" + ID_SEPARATOR + ejbBundle.getApplication().getName() + ID_SEPARATOR + ejbBundle.getModuleName();
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(); }
/** * Create GeneratorException for this message key and bean name. * @param key the message key in the bundle. * @param bundle the ejb bundle. * @return GeneratorException. */ public static GeneratorException createGeneratorException( String key, String beanName, EjbBundleDescriptor bundle) { return new GeneratorException(I18NHelper.getMessage( messages, key, beanName, bundle.getApplication().getRegistrationName(), getModuleName(bundle))); }
private String normalizeSingletonName(String origName, EjbSessionDescriptor sessionDesc) { String normalizedName = origName; boolean fullyQualified = origName.contains("#"); Application app = sessionDesc.getEjbBundleDescriptor().getApplication(); if (fullyQualified) { int indexOfHash = origName.indexOf("#"); String ejbName = origName.substring(indexOfHash + 1); String relativeJarPath = origName.substring(0, indexOfHash); BundleDescriptor bundle = app.getRelativeBundle(sessionDesc.getEjbBundleDescriptor(), relativeJarPath); if (bundle == null) { throw new IllegalStateException("Invalid @DependOn value = " + origName + " for Singleton " + sessionDesc.getName()); } normalizedName = bundle.getModuleDescriptor().getArchiveUri() + "#" + ejbName; } else { normalizedName = sessionDesc.getEjbBundleDescriptor().getModuleDescriptor().getArchiveUri() + "#" + origName; } return normalizedName; }
CallFlowInfoImpl(BaseContainer container, EjbDescriptor descriptor, ComponentType compType) { this.container = container; this.ejbDescriptor = descriptor; this.appName = (ejbDescriptor.getApplication().isVirtual()) ? null : ejbDescriptor.getApplication().getRegistrationName(); String archiveuri = ejbDescriptor.getEjbBundleDescriptor() .getModuleDescriptor().getArchiveUri(); this.modName = com.sun.enterprise.util.io.FileUtils .makeFriendlyFilename(archiveuri); this.ejbName = ejbDescriptor.getName(); this.componentType = compType; }
module = (BundleDescriptor) ejbDesc.getEjbBundleDescriptor().getModuleDescriptor().getDescriptor(); app = module.getApplication(); break; app = module.getApplication(); app = module.getApplication(); if (emfUnitName != null) { emf = app.getEntityManagerFactory(emfUnitName, module); .getEntityManagerFactories(); if (emFactories.size() == 1) { emf = emFactories.iterator().next();
Descriptor d = ejbBundle.getModuleDescriptor().getDescriptor(); id = webEnv.getApplication().getName() + ID_SEPARATOR + webEnv.getContextRoot(); _logger.finer("ComponentEnvManagerImpl: " + "converting EJB to web bundle id " + id); } else { id = ejbEnv.getApplication().getName() + ID_SEPARATOR + ejbBundle.getModuleDescriptor().getArchiveUri() + ID_SEPARATOR + ejbEnv.getName() + ID_SEPARATOR + flattedJndiName + id = webEnv.getApplication().getName() + ID_SEPARATOR + webEnv.getContextRoot(); } else if (env instanceof ApplicationClientDescriptor) { } else if( env instanceof EjbBundleDescriptor ) { EjbBundleDescriptor ejbBundle = (EjbBundleDescriptor) env; id = "__ejbBundle__" + ID_SEPARATOR + ejbBundle.getApplication().getName() + ID_SEPARATOR + ejbBundle.getModuleName();
/** * Store all the resources before starting the validation. */ private void parseResources(AppResources appResources) { parseResources(application, appResources); for (BundleDescriptor bd : application.getBundleDescriptors()) { if (bd instanceof WebBundleDescriptor || bd instanceof ApplicationClientDescriptor) parseResources(bd, appResources); if (bd instanceof EjbBundleDescriptor) { // Resources from Java files in the ejb.jar which are neither an EJB nor a managed bean are stored here. // Skip validation for them, validate only Managed Beans. for (ManagedBeanDescriptor mbd: bd.getManagedBeans()) { parseResources(mbd, (JndiNameEnvironment) bd, appResources); } EjbBundleDescriptor ebd = (EjbBundleDescriptor) bd; for (EjbDescriptor ejb : ebd.getEjbs()) parseEJB(ejb, appResources); } } parseManagedBeans(appResources); // Parse AppScoped resources String appName = DOLUtils.getApplicationName(application); Map<String, List<String>> resourcesList = (Map<String, List<String>>) dc.getTransientAppMetadata().get(ResourceConstants.APP_SCOPED_RESOURCES_JNDI_NAMES); appResources.storeAppScopedResources(resourcesList, appName); }
bundle = (BundleDescriptor) ((EjbDescriptor) componentEnv).getEjbBundleDescriptor(). getModuleDescriptor().getDescriptor(); BeanDeploymentArchive bda = weldDeployer.getBeanDeploymentArchiveForBundle(bundle); if( bda != null ) { WeldBootstrap bootstrap = weldDeployer.getBootstrapForApp(bundle.getApplication());
Set<EjbDescriptor> ejbDescriptors = ejbDesc.getEjbs(); for (EjbDescriptor ejbDescriptor : ejbDescriptors) { for (DataSourceDefinitionDescriptor dsd : ejbDescriptor.getDataSourceDefinitionDescriptors()) { Set<EjbInterceptor> ejbInterceptors = ejbDesc.getInterceptors(); for (EjbInterceptor ejbInterceptor : ejbInterceptors) { for (DataSourceDefinitionDescriptor dsd : ejbInterceptor.getDataSourceDefinitionDescriptors()) { Set<ManagedBeanDescriptor> managedBeanDescriptors = ((BundleDescriptor)descriptor).getManagedBeans(); for (ManagedBeanDescriptor mbd : managedBeanDescriptors) { for (DataSourceDefinitionDescriptor dsd : mbd.getDataSourceDefinitionDescriptors()) {
public EjbApplication( EjbBundleDescriptor bundle, DeploymentContext dc, ClassLoader cl, Habitat habitat, EJBSecurityManagerFactory ejbSecMgrFactory) { this.ejbBundle = bundle; this.ejbs = bundle.getEjbs(); this.ejbAppClassLoader = cl; this.dc = dc; this.habitat = habitat; this.ejbContainerFactory = habitat.getByContract(ContainerFactory.class); this.ejbSMF = ejbSecMgrFactory; this.policyLoader = habitat.getComponent(PolicyLoader.class); Application app = ejbBundle.getApplication(); initializeInOrder = (app != null) && (app.isInitializeInOrder()); }