Search in sources :

Example 6 with Jndi

use of org.apache.openejb.jee.oejb2.Jndi in project tomee by apache.

the class MappedNameBuilder method deploy.

public AppModule deploy(final AppModule appModule) throws OpenEJBException {
    for (final EjbModule ejbModule : appModule.getEjbModules()) {
        final OpenejbJar openejbJar = ejbModule.getOpenejbJar();
        if (openejbJar == null) {
            return appModule;
        }
        final Map<String, EjbDeployment> ejbDeployments = openejbJar.getDeploymentsByEjbName();
        for (final EnterpriseBean enterpriseBean : ejbModule.getEjbJar().getEnterpriseBeans()) {
            final EjbDeployment ejbDeployment = ejbDeployments.get(enterpriseBean.getEjbName());
            if (ejbDeployment == null) {
                continue;
            }
            final String mappedName = enterpriseBean.getMappedName();
            if (mappedName != null && mappedName.length() > 0) {
                ejbDeployment.getJndi().add(new Jndi(mappedName, "Remote"));
            }
        }
    }
    return appModule;
}
Also used : OpenejbJar(org.apache.openejb.jee.oejb3.OpenejbJar) EnterpriseBean(org.apache.openejb.jee.EnterpriseBean) EjbDeployment(org.apache.openejb.jee.oejb3.EjbDeployment) Jndi(org.apache.openejb.jee.oejb3.Jndi)

Aggregations

EjbDeployment (org.apache.openejb.jee.oejb3.EjbDeployment)5 Jndi (org.apache.openejb.jee.oejb3.Jndi)4 EjbJar (org.apache.openejb.jee.EjbJar)3 OpenejbJar (org.apache.openejb.jee.oejb3.OpenejbJar)3 InitialContext (javax.naming.InitialContext)2 Assembler (org.apache.openejb.assembler.classic.Assembler)2 ProxyFactoryInfo (org.apache.openejb.assembler.classic.ProxyFactoryInfo)2 SecurityServiceInfo (org.apache.openejb.assembler.classic.SecurityServiceInfo)2 StatelessSessionContainerInfo (org.apache.openejb.assembler.classic.StatelessSessionContainerInfo)2 TransactionServiceInfo (org.apache.openejb.assembler.classic.TransactionServiceInfo)2 InitContextFactory (org.apache.openejb.core.ivm.naming.InitContextFactory)2 EnterpriseBean (org.apache.openejb.jee.EnterpriseBean)2 StatelessBean (org.apache.openejb.jee.StatelessBean)2 SessionBeanType (org.apache.openejb.jee.oejb2.SessionBeanType)2 TreeSet (java.util.TreeSet)1 JndiNameInfo (org.apache.openejb.assembler.classic.JndiNameInfo)1 EjbRef (org.apache.openejb.jee.EjbRef)1 SessionBean (org.apache.openejb.jee.SessionBean)1 EjbLocalRefType (org.apache.openejb.jee.oejb2.EjbLocalRefType)1 EjbRefType (org.apache.openejb.jee.oejb2.EjbRefType)1