public void setDeployment(Ejb3Deployment deployment) { this.deployment = deployment; this.ejbContainers = deployment.getEjbContainers(); }
@Override public boolean isWebServiceDeployment(DeploymentUnit unit) { Ejb3Deployment ejb3Deployment = unit.getAttachment(Ejb3Deployment.class); if (ejb3Deployment == null) return false; boolean isWebServiceDeployment = false; Iterator it = ejb3Deployment.getEjbContainers().values().iterator(); while (it.hasNext()) { EJBContainer container = (EJBContainer)it.next(); if (isWebServiceBean(container)) { isWebServiceDeployment = true; break; } } return isWebServiceDeployment; }
public EJBContainer getEjbContainer(Ejb3Deployment deployment, Class businessIntf) throws NameNotFoundException { EJBContainer container = null; // search in myself for (Object obj : deployment.getEjbContainers().values()) { EJBContainer newContainer = (EJBContainer) obj; if (container == newContainer) continue; if (ProxyFactoryHelper.publishesInterface(newContainer, businessIntf)) { if (container != null) throw new NameNotFoundException("duplicated in " + errorName); container = newContainer; } } return container; }
public EJBContainer getEjbContainer(Ejb3Deployment deployment, Class businessIntf) throws NameNotFoundException { EJBContainer container = null; // search in myself for (Object obj : deployment.getEjbContainers().values()) { EJBContainer newContainer = (EJBContainer) obj; if (container == newContainer) continue; if (ProxyFactoryHelper.publishesInterface(newContainer, businessIntf)) { if (container != null) throw new NameNotFoundException("duplicated in " + errorName); container = newContainer; } } return container; }
public void addSecurityDomain(Element jbossWeb, Deployment dep) { String securityDomain = null; Ejb3Deployment ejb3Deployment = dep.getAttachment(Ejb3Deployment.class); if (ejb3Deployment != null) { Iterator it = ejb3Deployment.getEjbContainers().values().iterator(); while (it.hasNext()) { EJBContainer container = (EJBContainer)it.next(); SecurityDomain anSecurityDomain = (SecurityDomain)container.resolveAnnotation(SecurityDomain.class); if (anSecurityDomain != null) { if (securityDomain != null && !securityDomain.equals(anSecurityDomain.value())) throw new IllegalStateException("Multiple security domains not supported"); securityDomain = anSecurityDomain.value(); } } } if (securityDomain != null) { if (securityDomain.startsWith("java:/jaas/") == false) securityDomain = "java:/jaas/" + securityDomain; jbossWeb.addElement("security-domain").addText(securityDomain); } }
public void addSecurityRoles(Element webApp, Deployment dep) { Ejb3Deployment ejb3Deployment = dep.getAttachment(Ejb3Deployment.class); if (ejb3Deployment != null) { Iterator it = ejb3Deployment.getEjbContainers().values().iterator(); while (it.hasNext()) { EJBContainer container = (EJBContainer)it.next(); RolesAllowed anRolesAllowed = (RolesAllowed)container.resolveAnnotation(RolesAllowed.class); if (anRolesAllowed != null) { for (String role : anRolesAllowed.value()) { webApp.addElement("security-role").addElement("role-name").addText(role); } } } } } }
@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; }
private void buildEnterpriseBeansMetaData(EJBArchiveMetaData jarMetaData, Ejb3Deployment ejb3Deployment) Iterator<Container> it = ejb3Deployment.getEjbContainers().values().iterator(); while (it.hasNext())