Search in sources :

Example 1 with EjbLocalReferenceInfo

use of org.apache.openejb.assembler.classic.EjbLocalReferenceInfo in project tomee by apache.

the class TomcatJndiBuilder method mergeJndi.

public void mergeJndi() throws OpenEJBException {
    final NamingResourcesImpl naming = standardContext.getNamingResources();
    final URI moduleUri = URLs.uri(webAppInfo.moduleId);
    for (final EnvEntryInfo ref : webAppInfo.jndiEnc.envEntries) {
        mergeRef(naming, ref);
    }
    for (final EjbReferenceInfo ref : webAppInfo.jndiEnc.ejbReferences) {
        mergeRef(naming, ref);
    }
    for (final EjbLocalReferenceInfo ref : webAppInfo.jndiEnc.ejbLocalReferences) {
        mergeRef(naming, ref);
    }
    for (final PersistenceContextReferenceInfo ref : webAppInfo.jndiEnc.persistenceContextRefs) {
        mergeRef(naming, ref, moduleUri);
    }
    for (final PersistenceUnitReferenceInfo ref : webAppInfo.jndiEnc.persistenceUnitRefs) {
        mergeRef(naming, ref, moduleUri);
    }
    for (final ResourceReferenceInfo ref : webAppInfo.jndiEnc.resourceRefs) {
        mergeRef(naming, ref);
    }
    for (final ResourceEnvReferenceInfo ref : webAppInfo.jndiEnc.resourceEnvRefs) {
        mergeRef(naming, ref);
    }
    for (final ServiceReferenceInfo ref : webAppInfo.jndiEnc.serviceRefs) {
        mergeRef(naming, ref);
    }
    final ContextTransaction contextTransaction = new ContextTransaction();
    contextTransaction.setProperty(Constants.FACTORY, UserTransactionFactory.class.getName());
    naming.setTransaction(contextTransaction);
}
Also used : ResourceReferenceInfo(org.apache.openejb.assembler.classic.ResourceReferenceInfo) PersistenceContextReferenceInfo(org.apache.openejb.assembler.classic.PersistenceContextReferenceInfo) EjbReferenceInfo(org.apache.openejb.assembler.classic.EjbReferenceInfo) UserTransactionFactory(org.apache.tomee.common.UserTransactionFactory) NamingResourcesImpl(org.apache.catalina.deploy.NamingResourcesImpl) EnvEntryInfo(org.apache.openejb.assembler.classic.EnvEntryInfo) EjbLocalReferenceInfo(org.apache.openejb.assembler.classic.EjbLocalReferenceInfo) ResourceEnvReferenceInfo(org.apache.openejb.assembler.classic.ResourceEnvReferenceInfo) ContextTransaction(org.apache.tomcat.util.descriptor.web.ContextTransaction) URI(java.net.URI) ServiceReferenceInfo(org.apache.openejb.assembler.classic.ServiceReferenceInfo) PersistenceUnitReferenceInfo(org.apache.openejb.assembler.classic.PersistenceUnitReferenceInfo)

Example 2 with EjbLocalReferenceInfo

use of org.apache.openejb.assembler.classic.EjbLocalReferenceInfo in project tomee by apache.

the class JndiEncInfoBuilder method toLocal.

private EjbLocalReferenceInfo toLocal(final EjbReferenceInfo referenceInfo) {
    final EjbLocalReferenceInfo local = new EjbLocalReferenceInfo();
    local.ejbDeploymentId = referenceInfo.ejbDeploymentId;
    local.externalReference = referenceInfo.externalReference;
    local.homeClassName = referenceInfo.homeClassName;
    local.interfaceClassName = referenceInfo.interfaceClassName;
    local.referenceName = referenceInfo.referenceName;
    local.link = referenceInfo.link;
    local.location = referenceInfo.location;
    local.targets.addAll(referenceInfo.targets);
    local.localbean = referenceInfo.localbean;
    return local;
}
Also used : EjbLocalReferenceInfo(org.apache.openejb.assembler.classic.EjbLocalReferenceInfo)

Aggregations

EjbLocalReferenceInfo (org.apache.openejb.assembler.classic.EjbLocalReferenceInfo)2 URI (java.net.URI)1 NamingResourcesImpl (org.apache.catalina.deploy.NamingResourcesImpl)1 EjbReferenceInfo (org.apache.openejb.assembler.classic.EjbReferenceInfo)1 EnvEntryInfo (org.apache.openejb.assembler.classic.EnvEntryInfo)1 PersistenceContextReferenceInfo (org.apache.openejb.assembler.classic.PersistenceContextReferenceInfo)1 PersistenceUnitReferenceInfo (org.apache.openejb.assembler.classic.PersistenceUnitReferenceInfo)1 ResourceEnvReferenceInfo (org.apache.openejb.assembler.classic.ResourceEnvReferenceInfo)1 ResourceReferenceInfo (org.apache.openejb.assembler.classic.ResourceReferenceInfo)1 ServiceReferenceInfo (org.apache.openejb.assembler.classic.ServiceReferenceInfo)1 ContextTransaction (org.apache.tomcat.util.descriptor.web.ContextTransaction)1 UserTransactionFactory (org.apache.tomee.common.UserTransactionFactory)1