/** * Determine the jndi name for the proxy associated with iface. This calls * {@link #determineResolvedJndiName(String, null)} * * @param iface - the fully qualified class name of the interface, or one * of the {@linkplain KnownInterfaces}. May be null in which case the base * name as determined by {@link #getMappedName()} or * {@link #determineJndiName()} is used. * @return the resolved jndi name * @deprecated JBMETA-68 */ @XmlTransient @Deprecated public String determineResolvedJndiName(String iface) { return determineResolvedJndiName(iface, null); } /**
public <B> B createBusinessObject(SessionContainer container, Serializable sessionId, Class<B> intf) { assert sessionId == null : "sessionId is must be null for Stateless"; assert intf != null : "intf is null"; try { /* * Get all business interfaces */ Set<String> businessInterfaceNames = new HashSet<String>(); JBossSessionBeanMetaData smd= (JBossSessionBeanMetaData) container.getXml(); CollectionHelper.addAllIfSet(businessInterfaceNames, smd.getBusinessRemotes()); CollectionHelper.addAllIfSet(businessInterfaceNames, smd.getBusinessLocals()); String interfaceName = intf.getName(); if (!businessInterfaceNames.contains(interfaceName)) throw new IllegalStateException("Cannot find BusinessObject for interface: " + interfaceName); String jndiName = container.getXml().determineResolvedJndiName(interfaceName); return intf.cast(container.getInitialContext().lookup(jndiName)); } catch (NamingException e) { throw new RuntimeException("failed to invoke getBusinessObject", e); } } }
throw new IllegalStateException("Cannot find BusinessObject for interface: " + interfaceName); String jndiName = container.getXml().determineResolvedJndiName(interfaceName); return businessInterface.cast(container.getInitialContext().lookup(jndiName));