Search in sources :

Example 1 with ServiceReferenceInfo

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

the class JndiEncInfoBuilder method buildServiceRefInfos.

private void buildServiceRefInfos(final JndiConsumer jndiConsumer, final JndiEncInfo moduleJndiEnc, final JndiEncInfo compJndiEnc) {
    for (final ServiceRef ref : jndiConsumer.getServiceRef()) {
        final ServiceReferenceInfo info = new ServiceReferenceInfo();
        info.referenceName = ref.getName();
        info.location = buildLocationInfo(ref);
        info.targets.addAll(buildInjectionInfos(ref));
        insert(info, appInfo.globalJndiEnc.serviceRefs, appInfo.appJndiEnc.serviceRefs, moduleJndiEnc.serviceRefs, compJndiEnc.serviceRefs);
        if (SystemInstance.get().hasProperty("openejb.geronimo")) {
            continue;
        }
        info.id = ref.getMappedName();
        info.serviceQName = ref.getServiceQname();
        info.serviceType = ref.getServiceInterface();
        info.referenceType = ref.getServiceRefType();
        info.wsdlFile = ref.getWsdlFile();
        info.jaxrpcMappingFile = ref.getJaxrpcMappingFile();
        info.handlerChains.addAll(ConfigurationFactory.toHandlerChainInfo(ref.getAllHandlers()));
        for (final PortComponentRef portComponentRef : ref.getPortComponentRef()) {
            final PortRefInfo portRefInfo = new PortRefInfo();
            portRefInfo.qname = portComponentRef.getQName();
            portRefInfo.serviceEndpointInterface = portComponentRef.getServiceEndpointInterface();
            portRefInfo.enableMtom = portComponentRef.isEnableMtom();
            portRefInfo.properties.putAll(portComponentRef.getProperties());
            info.portRefs.add(portRefInfo);
        }
    }
}
Also used : PortComponentRef(org.apache.openejb.jee.PortComponentRef) PortRefInfo(org.apache.openejb.assembler.classic.PortRefInfo) ServiceRef(org.apache.openejb.jee.ServiceRef) ServiceReferenceInfo(org.apache.openejb.assembler.classic.ServiceReferenceInfo)

Example 2 with ServiceReferenceInfo

use of org.apache.openejb.assembler.classic.ServiceReferenceInfo 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)

Aggregations

ServiceReferenceInfo (org.apache.openejb.assembler.classic.ServiceReferenceInfo)2 URI (java.net.URI)1 NamingResourcesImpl (org.apache.catalina.deploy.NamingResourcesImpl)1 EjbLocalReferenceInfo (org.apache.openejb.assembler.classic.EjbLocalReferenceInfo)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 PortRefInfo (org.apache.openejb.assembler.classic.PortRefInfo)1 ResourceEnvReferenceInfo (org.apache.openejb.assembler.classic.ResourceEnvReferenceInfo)1 ResourceReferenceInfo (org.apache.openejb.assembler.classic.ResourceReferenceInfo)1 PortComponentRef (org.apache.openejb.jee.PortComponentRef)1 ServiceRef (org.apache.openejb.jee.ServiceRef)1 ContextTransaction (org.apache.tomcat.util.descriptor.web.ContextTransaction)1 UserTransactionFactory (org.apache.tomee.common.UserTransactionFactory)1