public String getIdentifier() { return getEjbName(); }
public void setInjectionManager(InjectionManager injectionManager) { if (injectionManager == null) { throw new IllegalArgumentException("Cannot set null InjectionManager for container of bean " + this.getEjbName()); } this.injectionManager = injectionManager; }
@Override protected EJBContainer searchDeploymentInternally(String ejbLink, Class businessIntf) { for (EJBContainer container : ejbContainers.values()) { if (container.getEjbName().equals(ejbLink)) { return container; } } return null; }
if (container.getEjbName().equals(ejbLink))
public Object createPerClass(Advisor advisor) { // Must be a separate line (EJBContainer cannot be dereferenced) EJBContainer container = EJBContainer.getEJBContainer(advisor); SecurityDomain securityAnnotation = (SecurityDomain) advisor.resolveAnnotation(SecurityDomain.class); //If there is no annotation, return a null action interceptor if(securityAnnotation == null) return new NullInterceptor(); CodeSource ejbCS = advisor.getClazz().getProtectionDomain().getCodeSource(); String ejbName = container.getEjbName(); return new RoleBasedAuthorizationInterceptorv2(container, ejbCS, ejbName); } }
if (container.getEjbName().equals(ejbLink))
+ " annotations without 'value' attribute on " + this.getEjbName() + ". " + issue); + " and " + Remote.class.getName() + " on " + this.getEjbName() + ". " + issue);
private static void checkForJndiNamingConflict(EJBContainer container) { if (container.getAnnotation(Local.class) != null) { JBossSessionBeanMetaData smd = (JBossSessionBeanMetaData)container.getXml(); String localJndiName = smd.getLocalJndiName(); String remoteJndiName = smd.getJndiName(); String ejbName = container.getEjbName(); if (localJndiName != null) { if (localJndiName.equals(remoteJndiName) || localJndiName.startsWith(remoteJndiName + "/")) throw new javax.ejb.EJBException("Conflict between default jndi name " + remoteJndiName + " for both remote and local for ejb-name:" + ejbName + ", bean class=" + container.getBeanClass() + "\nLocal JNDI Name: " + localJndiName + "\nRemote JNDI Name: " + remoteJndiName); } } }
throw new RuntimeException("Unable to create annotation for method/field " + methodName + " for EJB " + container.getEjbName(), e);
log.debug("JNDI name has not been explicitly set for EJB " + container.getEjbName() + ", interface " + businessInterface.getName());
/** * @see EJBContext#isCallerInRole(String) */ public boolean isCallerInRole(String roleName) { EJBContainer ejbc = (EJBContainer)container; //Take care of Policy Context ID for callbacks SecurityActions.setContextID(ejbc.getJaccContextId()); return ejbContextHelper.isCallerInRole(SecurityActions.getSecurityContext(), ejbc.getAnnotation(SecurityDomain.class), rm, ejbc.getXml(), roleName, ejbc.getEjbName()); }
@Override public Deployment createDeployment(DeploymentUnit unit) { ArchiveDeployment dep = newDeployment(unit); dep.setRootFile(new VirtualFileAdaptor(((VFSDeploymentUnit)unit).getRoot())); dep.setRuntimeClassLoader(unit.getClassLoader()); dep.setType(getDeploymentType()); Service service = dep.getService(); Ejb3Deployment ejb3Deployment = unit.getAttachment(Ejb3Deployment.class); if (ejb3Deployment == null) throw new IllegalStateException("Deployment unit does not contain ejb3 deployment"); // Copy the attachments dep.addAttachment(Ejb3Deployment.class, ejb3Deployment); Iterator it = ejb3Deployment.getEjbContainers().values().iterator(); while (it.hasNext()) { EJBContainer container = (EJBContainer)it.next(); if (isWebServiceBean(container)) { String ejbName = container.getEjbName(); String epBean = container.getBeanClassName(); // Create the endpoint Endpoint ep = newEndpoint(epBean); ep.setShortName(ejbName); service.addEndpoint(ep); } } return dep; }
log = Logger.getLogger(getClass().getName() + "." + container.getEjbName()); log.debug("Initializing SimpleStatefulCache with maxSize: " +maxSize + " timeout: " +sessionTimeout + " for " +container.getObjectName().getCanonicalName() );
JavaEEApplication app = module.getApplication(); String appName = app != null ? stripSuffix(app.getName()) : null; String scopedBeanName = "application=" + (appName != null ? appName : moduleName) + ",module=" + moduleName + ",component=" + container.getEjbName(); String encFactoryBeanName = "jboss.ejb3:" + scopedBeanName + ",service=EjbEncFactory"; String beanInstantiatorMcName = BeanInstantiatorRegistration.getInstantiatorRegistrationName(appName, moduleName, container.getEjbName()); builder.addPropertyMetaData("beanInstantiator", new AbstractInjectionValueMetaData(beanInstantiatorMcName));
String injectorMCBeanName = this.getInjectorMCBeanNamePrefix() + ",bean=" + ejbContainer.getEjbName(); BeanMetaData injectorBMD = this.createInjectorBMD(injectorMCBeanName, eeInjector, switchBoard); this.jbossUnit.addAttachment(BeanMetaData.class + ":" + injectorMCBeanName, injectorBMD); log.debug("Added Injector dependency: " + injectorMCBeanName + " for EJB: " + ejbContainer.getEjbName() + " in unit " + this.jbossUnit); String interceptorInjectorMCBeanName = this.getInjectorMCBeanNamePrefix() + ",bean=" + ejbContainer.getEjbName() + ",interceptor=" + interceptor.getName(); BeanMetaData injectorBMD = this.createInjectorBMD(interceptorInjectorMCBeanName, lazyEEInjector, switchBoard); this.jbossUnit.addAttachment(BeanMetaData.class + ":" + interceptorInjectorMCBeanName, injectorBMD); dependsPolicy.addDependency(interceptorInjectorMCBeanName); log.debug("Added Injector dependency: " + interceptorInjectorMCBeanName + " for interceptor " + interceptor.getName() + " of EJB: " + ejbContainer.getEjbName() + " in unit " + this.jbossUnit);
ejbMetaData.setEjbName(container.getEjbName()); ejbMetaData.setEjbClass(container.getBeanClassName());
@Override public Deployment createDeployment(DeploymentInfo di) { ArchiveDeployment dep = newDeployment(di); dep.setRootFile(new URLLoaderAdapter(di.localUrl)); dep.setRuntimeClassLoader(di.ucl); dep.setType(getDeploymentType()); Service service = dep.getService(); Ejb3ModuleMBean ejb3Module = EJBArchiveMetaDataAdapterEJB3.getEJB3Module(di.deployedObject); for (Object manager : ejb3Module.getContainers().values()) { if (manager instanceof EJBContainer) { EJBContainer container = (EJBContainer)manager; if (isWebServiceBean(container)) { String ejbName = container.getEjbName(); String epBean = container.getBeanClassName(); // Create the endpoint Endpoint ep = newEndpoint(epBean); ep.setShortName(ejbName); service.addEndpoint(ep); } } } return dep; }
@Override public Deployment createDeployment(DeploymentInfo di) { ArchiveDeployment dep = newDeployment(di); dep.setRootFile(new URLLoaderAdapter(di.localUrl)); dep.setRuntimeClassLoader(di.ucl); dep.setType(getDeploymentType()); Service service = dep.getService(); Ejb3ModuleMBean ejb3Module = EJBArchiveMetaDataAdapterEJB3.getEJB3Module(di.deployedObject); for (Object manager : ejb3Module.getContainers().values()) { if (manager instanceof EJBContainer) { EJBContainer container = (EJBContainer)manager; if (isWebServiceBean(container)) { String ejbName = container.getEjbName(); String epBean = container.getBeanClassName(); // Create the endpoint Endpoint ep = newEndpoint(epBean); ep.setShortName(ejbName); service.addEndpoint(ep); } } } return dep; }
@Override public Deployment createDeployment(DeploymentInfo di) { ArchiveDeployment dep = newDeployment(di); dep.setRootFile(new URLLoaderAdapter(di.localUrl)); dep.setRuntimeClassLoader(di.ucl); dep.setType(getDeploymentType()); Service service = dep.getService(); Ejb3ModuleMBean ejb3Module = EJBArchiveMetaDataAdapterEJB3.getEJB3Module(di.deployedObject); for (Object manager : ejb3Module.getContainers().values()) { if (manager instanceof EJBContainer) { EJBContainer container = (EJBContainer)manager; if (isWebServiceBean(container)) { String ejbName = container.getEjbName(); String epBean = container.getBeanClassName(); // Create the endpoint Endpoint ep = newEndpoint(epBean); ep.setShortName(ejbName); service.addEndpoint(ep); } } } return dep; }
method.setEjbName(container.getEjbName());