Examples of PersistenceProviderAdaptor


Examples of org.jboss.as.jpa.spi.PersistenceProviderAdaptor

        if (adapterModule == null) {
            return noopAdaptor;
        }

        PersistenceProviderAdaptor persistenceProviderAdaptor=null;

        Module module = moduleLoader.loadModule(ModuleIdentifier.fromString(adapterModule));
        final ServiceLoader<PersistenceProviderAdaptor> serviceLoader =
            module.loadService(PersistenceProviderAdaptor.class);
        if (serviceLoader != null) {
            for (PersistenceProviderAdaptor adaptor : serviceLoader) {
                if (persistenceProviderAdaptor != null) {
                    throw MESSAGES.multipleAdapters(adapterModule);
                }
                persistenceProviderAdaptor = adaptor;
                JPA_LOGGER.debugf("loaded persistence provider adapter %s", adapterModule);
            }
            if (persistenceProviderAdaptor != null) {
                persistenceProviderAdaptor.injectJtaManager(JtaManagerImpl.getInstance());
            }
        }

        return persistenceProviderAdaptor;
    }
View Full Code Here

Examples of org.jboss.as.jpa.spi.PersistenceProviderAdaptor

        return dataSourceName;
    }

    private void addProviderProperties(PersistenceUnitMetadata pu, Map properties) {
        PersistenceProviderAdaptor adaptor = PersistenceProviderAdapterRegistry.getPersistenceProviderAdaptor(pu.getPersistenceProviderClassName());
        adaptor.addProviderProperties(properties, pu);
    }
View Full Code Here

Examples of org.jboss.as.jpa.spi.PersistenceProviderAdaptor

        PersistenceProviderAdaptor adaptor = PersistenceProviderAdapterRegistry.getPersistenceProviderAdaptor(pu.getPersistenceProviderClassName());
        adaptor.addProviderProperties(properties, pu);
    }

    private Iterable<ServiceName> getProviderDependencies(PersistenceUnitMetadata pu) {
        PersistenceProviderAdaptor adaptor = PersistenceProviderAdapterRegistry.getPersistenceProviderAdaptor(pu.getPersistenceProviderClassName());
        Iterable<ServiceName> providerDependencies = adaptor.getProviderDependencies(pu);
        return providerDependencies;
    }
View Full Code Here

Examples of org.jboss.as.jpa.spi.PersistenceProviderAdaptor

     * @param provider
     * @return EntityManagerFactory
     */
    private EntityManagerFactory createContainerEntityManagerFactory(PersistenceProvider provider) {

        PersistenceProviderAdaptor adaptor = PersistenceProviderAdapterRegistry.getPersistenceProviderAdaptor(pu.getPersistenceProviderClassName());
        adaptor.beforeCreateContainerEntityManagerFactory(pu);
        try {
            return provider.createContainerEntityManagerFactory(pu, properties.getValue());
        } finally {
            try {
                adaptor.afterCreateContainerEntityManagerFactory(pu);
            } finally {
                pu.setAnnotationIndex(null);    // close reference to Annotation Index (only needed during call to createContainerEntityManagerFactory)
                pu.setTempClassloader(null);    // close reference to temp classloader (only needed during call to createEntityManagerFactory)
            }
        }
View Full Code Here

Examples of org.jipijapa.plugin.spi.PersistenceProviderAdaptor

                    boolean deployPU = (jpaContainerManaged == null? true : Boolean.parseBoolean(jpaContainerManaged));

                    if (deployPU) {
                        final PersistenceProviderDeploymentHolder persistenceProviderDeploymentHolder = getPersistenceProviderDeploymentHolder(deploymentUnit);
                        final PersistenceProvider provider = lookupProvider(pu, persistenceProviderDeploymentHolder, deploymentUnit);
                        final PersistenceProviderAdaptor adaptor = getPersistenceProviderAdaptor(pu, persistenceProviderDeploymentHolder, deploymentUnit, provider, platform);
                        final boolean twoPhaseBootStrapCapable = (adaptor instanceof TwoPhaseBootstrapCapable) && Configuration.allowTwoPhaseBootstrap(pu);

                        if (startEarly) {
                            if (twoPhaseBootStrapCapable) {
                                deployPersistenceUnitPhaseOne(phaseContext, deploymentUnit, eeModuleDescription, components, serviceTarget, classLoader, pu, adaptor);
View Full Code Here

Examples of org.jipijapa.plugin.spi.PersistenceProviderAdaptor

                }
            }
        }

        String adaptorModule = pu.getProperties().getProperty(Configuration.ADAPTER_MODULE);
        PersistenceProviderAdaptor adaptor;
        adaptor = getPerDeploymentSharedPersistenceProviderAdaptor(deploymentUnit, adaptorModule, provider);
        if (adaptor == null) {
            try {
                // will load the persistence provider adaptor (integration classes).  if adaptorModule is null
                // the noop adaptor is returned (can be used against any provider but the integration classes
View Full Code Here

Examples of org.jipijapa.plugin.spi.PersistenceProviderAdaptor

                key = adaptorModule;  // handle legacy adapter module
            }
            else {
                key = provider.getClass().getName();
            }
            PersistenceProviderAdaptor current = map.get(key);

            // saved if not already set by another thread
            if (current == null) {
                map.put(key, adaptor);
                current = adaptor;
View Full Code Here

Examples of org.jipijapa.plugin.spi.PersistenceProviderAdaptor

                    final ServiceName puServiceName = PersistenceUnitServiceImpl.getPUServiceName(pu);
                    final PersistenceProviderDeploymentHolder persistenceProviderDeploymentHolder = getPersistenceProviderDeploymentHolder(phaseContext.getDeploymentUnit());

                    final PersistenceProvider provider = lookupProvider(pu, persistenceProviderDeploymentHolder, phaseContext.getDeploymentUnit());

                    final PersistenceProviderAdaptor adaptor = getPersistenceProviderAdaptor(pu, persistenceProviderDeploymentHolder, phaseContext.getDeploymentUnit(), provider, platform);
                    final boolean twoPhaseBootStrapCapable = (adaptor instanceof TwoPhaseBootstrapCapable) && Configuration.allowTwoPhaseBootstrap(pu);
                    // only add the next phase dependency, if the persistence unit service is starting early.
                    if( Configuration.needClassFileTransformer(pu)) {
                        // wait until the persistence unit service is started before starting the next deployment phase
                        phaseContext.addToAttachmentList(Attachments.NEXT_PHASE_DEPS, twoPhaseBootStrapCapable ? puServiceName.append(FIRST_PHASE) : puServiceName);
View Full Code Here

Examples of org.jipijapa.plugin.spi.PersistenceProviderAdaptor

        if (adapterModule == null) {
            return noopAdaptor;
        }

        PersistenceProviderAdaptor persistenceProviderAdaptor=null;

        Module module = moduleLoader.loadModule(ModuleIdentifier.fromString(adapterModule));
        final ServiceLoader<PersistenceProviderAdaptor> serviceLoader =
            module.loadService(PersistenceProviderAdaptor.class);
        if (serviceLoader != null) {
            for (PersistenceProviderAdaptor adaptor : serviceLoader) {
                if (persistenceProviderAdaptor != null) {
                    throw JpaLogger.ROOT_LOGGER.multipleAdapters(adapterModule);
                }
                persistenceProviderAdaptor = adaptor;
                JPA_LOGGER.debugf("loaded persistence provider adapter %s", adapterModule);
            }
            if (persistenceProviderAdaptor != null) {
                persistenceProviderAdaptor.injectJtaManager(JtaManagerImpl.getInstance());
                persistenceProviderAdaptor.injectPlatform(platform);
            }
        }

        return persistenceProviderAdaptor;
    }
View Full Code Here

Examples of org.jipijapa.plugin.spi.PersistenceProviderAdaptor

     * @param persistenceProvider classloader will be used to load the persistence provider adapter
     * @return the persistence provider adaptor for the provider class
     */
    public static PersistenceProviderAdaptor loadPersistenceAdapter(final PersistenceProvider persistenceProvider, final Platform platform)
        {
        PersistenceProviderAdaptor persistenceProviderAdaptor=null;

        final ServiceLoader<PersistenceProviderAdaptor> serviceLoader =
                ServiceLoader.load(PersistenceProviderAdaptor.class, persistenceProvider.getClass().getClassLoader());

        if (serviceLoader != null) {
            for (PersistenceProviderAdaptor adaptor : serviceLoader) {
                if (persistenceProviderAdaptor != null) {
                    throw JpaLogger.ROOT_LOGGER.classloaderHasMultipleAdapters(persistenceProvider.getClass().getClassLoader().toString());
                }
                persistenceProviderAdaptor = adaptor;
                JPA_LOGGER.debugf("loaded persistence provider adapter %s from classloader %s",
                        persistenceProviderAdaptor.getClass().getName(),
                        persistenceProvider.getClass().getClassLoader().toString());
            }
            if (persistenceProviderAdaptor != null) {
                persistenceProviderAdaptor.injectJtaManager(JtaManagerImpl.getInstance());
                persistenceProviderAdaptor.injectPlatform(platform);
            }
        }

        return persistenceProviderAdaptor == null ?
                noopAdaptor:
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.