/** * 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(); }
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; }
try { Class<?> remoteClass = sessionDesc.getEjbBundleDescriptor().getClassLoader().loadClass(remote); @SuppressWarnings({ "rawtypes", "unchecked" }) BusinessInterfaceDescriptor<?> busIntfDesc =
void addSingletonContainer(EjbApplication ejbApp, AbstractSingletonContainer c) { c.setSingletonLifeCycleManager(this); EjbSessionDescriptor sdesc = (EjbSessionDescriptor) c.getEjbDescriptor(); String modName = sdesc.getEjbBundleDescriptor().getName(); //System.out.println("BundleName: " + modName); String src = normalizeSingletonName(sdesc.getName(), sdesc); String[] depends = sdesc.getDependsOn(); String[] newDepends = new String[depends.length]; StringBuilder sb = new StringBuilder("Partial order of dependent(s). " + src + " => {"); for(int i=0; i < depends.length; i++) { newDepends[i] = normalizeSingletonName(depends[i], sdesc); sb.append(newDepends[i] + " "); } sb.append("}"); if (_logger.isLoggable(Level.FINE)) { _logger.log(Level.FINE, sb.toString()); } this.addDependency(src, newDepends); name2Container.put(src, c); name2EjbApp.put(src, ejbApp); }
try { Class<?> localClass = sessionDesc.getEjbBundleDescriptor().getClassLoader().loadClass(local); @SuppressWarnings({ "rawtypes", "unchecked" }) BusinessInterfaceDescriptor<?> busIntfDesc =
Application app = sessionDesc.getEjbBundleDescriptor().getApplication(); String relativeJarPath = next.substring(0, indexOfHash); BundleDescriptor bundle = app.getRelativeBundle(sessionDesc.getEjbBundleDescriptor(), relativeJarPath);
public Vector getPossibleTransactionAttributes() { Vector txAttributes = super.getPossibleTransactionAttributes(); // Session beans that implement SessionSynchronization interface // have a limited set of possible transaction attributes. if( isStateful() ) { try { EjbBundleDescriptor ejbBundle = getEjbBundleDescriptor(); ClassLoader classLoader = ejbBundle.getClassLoader(); Class ejbClass = classLoader.loadClass(getEjbClassName()); AnnotationTypesProvider provider = Globals.getDefaultHabitat().getComponent(AnnotationTypesProvider.class, "EJB"); if (provider!=null) { Class sessionSynchClass = provider.getType("javax.ejb.SessionSynchronization"); if( sessionSynchClass.isAssignableFrom(ejbClass) ) { txAttributes = new Vector(); txAttributes.add(new ContainerTransaction (ContainerTransaction.REQUIRED, "")); txAttributes.add(new ContainerTransaction (ContainerTransaction.REQUIRES_NEW, "")); txAttributes.add(new ContainerTransaction (ContainerTransaction.MANDATORY, "")); } } } catch(Exception e) { // Don't treat this as a fatal error. Just return full // set of possible transaction attributes. } } return txAttributes; }
descriptor.getHomeClassName(); ClassLoader cl = descriptor.getEjbBundleDescriptor().getClassLoader();