Package org.hibernate.service.classloading.spi

Examples of org.hibernate.service.classloading.spi.ClassLoaderService


    // add Dialect contributed types
    final Dialect dialect = serviceRegistry.getService( JdbcServices.class ).getDialect();
    dialect.contributeTypes( typeContributions, serviceRegistry );

    // add TypeContributor contributed types.
    ClassLoaderService classLoaderService = serviceRegistry.getService( ClassLoaderService.class );
    for ( TypeContributor contributor : classLoaderService.loadJavaServices( TypeContributor.class ) ) {
      contributor.contribute( typeContributions, serviceRegistry );
    }
    // from app registrations
    for ( TypeContributor contributor : typeContributorRegistrations ) {
      contributor.contribute( typeContributions, serviceRegistry );
View Full Code Here


                eventListenerGroup.appendListener( instantiate( listenerImpl, serviceRegistry ) );
            }
        }

        final EntityCallbackHandler callbackHandler = new EntityCallbackHandler();
        ClassLoaderService classLoaderSvc = serviceRegistry.getService(ClassLoaderService.class);
        for (EntityBinding binding : metadata.getEntityBindings()) {
            String name = binding.getEntity().getName(); // Should this be getClassName()?
            if (name == null) {
                //we can have non java class persisted by hibernate
                continue;
            }
            try {
                callbackHandler.add(classLoaderSvc.classForName(name), classLoaderSvc, binding);
            } catch (ClassLoadingException error) {
                throw new MappingException( "entity class not found: " + name, error );
            }
        }
//
View Full Code Here

                eventListenerGroup.appendListener( instantiate( listenerImpl, serviceRegistry ) );
            }
        }

        final EntityCallbackHandler callbackHandler = new EntityCallbackHandler();
        ClassLoaderService classLoaderSvc = serviceRegistry.getService(ClassLoaderService.class);
        for (EntityBinding binding : metadata.getEntityBindings()) {
            String name = binding.getEntity().getName(); // Should this be getClassName()?
            if (name == null) {
                //we can have non java class persisted by hibernate
                continue;
            }
            try {
                callbackHandler.add(classLoaderSvc.classForName(name), classLoaderSvc, binding);
            } catch (ClassLoadingException error) {
                throw new MappingException( "entity class not found: " + name, error );
            }
        }
//
View Full Code Here

    if ( Class.class.isInstance( platform ) ) {
      jtaPlatformImplClass = (Class<JtaPlatform>) platform;
    }
    else {
      final String platformImplName = platform.toString();
      final ClassLoaderService classLoaderService = registry.getService( ClassLoaderService.class );
      try {
        jtaPlatformImplClass = classLoaderService.classForName( platformImplName );
      }
      catch ( Exception e ) {
        throw new HibernateException( "Unable to locate specified JtaPlatform class [" + platformImplName + "]", e );
      }
    }
View Full Code Here

  public ConnectionProvider initiateService(Map configurationValues, ServiceRegistryImplementor registry) {
    if ( MultiTenancyStrategy.determineMultiTenancyStrategy( configurationValues ) != MultiTenancyStrategy.NONE ) {
      // nothing to do, but given the separate hierarchies have to handle this here.
    }

    final ClassLoaderService classLoaderService = registry.getService( ClassLoaderService.class );

    ConnectionProvider connectionProvider = null;
    String providerClassName = getConfiguredConnectionProviderName( configurationValues );
    if ( providerClassName != null ) {
      connectionProvider = instantiateExplicitConnectionProvider( providerClassName, classLoaderService );
View Full Code Here

    else if ( StatisticsFactory.class.isInstance( configValue ) ) {
      statisticsFactory = (StatisticsFactory) configValue;
    }
    else {
      // assume it names the factory class
      final ClassLoaderService classLoaderService = registry.getService( ClassLoaderService.class );
      try {
        statisticsFactory = (StatisticsFactory) classLoaderService.classForName( configValue.toString() ).newInstance();
      }
      catch (HibernateException e) {
        throw e;
      }
      catch (Exception e) {
View Full Code Here

    }

    final String strategyClassName = mapLegacyNames( strategy.toString() );
    LOG.transactionStrategy( strategyClassName );

    ClassLoaderService classLoaderService = registry.getService( ClassLoaderService.class );
    try {
      return (TransactionFactory) classLoaderService.classForName( strategyClassName ).newInstance();
    }
    catch ( Exception e ) {
      throw new HibernateException( "Unable to instantiate specified TransactionFactory class [" + strategyClassName + "]", e );
    }
  }
View Full Code Here

   * Build the bootstrap registry.
   *
   * @return The built bootstrap registry
   */
  public BootstrapServiceRegistry build() {
    final ClassLoaderService classLoaderService;
    if ( providedClassLoaderService == null ) {
      classLoaderService = new ClassLoaderServiceImpl( providedClassLoaders );
    } else {
      classLoaderService = providedClassLoaderService;
    }
View Full Code Here

    final List<DialectResolver> resolvers = new ArrayList<DialectResolver>();

    final String resolverImplNames = (String) configurationValues.get( AvailableSettings.DIALECT_RESOLVERS );

    if ( StringHelper.isNotEmpty( resolverImplNames ) ) {
      final ClassLoaderService classLoaderService = registry.getService( ClassLoaderService.class );
      for ( String resolverImplName : StringHelper.split( ", \n\r\f\t", resolverImplNames ) ) {
        try {
          resolvers.add( (DialectResolver) classLoaderService.classForName( resolverImplName ).newInstance() );
        }
        catch (HibernateException e) {
          throw e;
        }
        catch (Exception e) {
View Full Code Here

  public ImportSqlCommandExtractor initiateService(Map configurationValues, ServiceRegistryImplementor registry) {
    String extractorClassName = (String) configurationValues.get( Environment.HBM2DDL_IMPORT_FILES_SQL_EXTRACTOR );
    if ( StringHelper.isEmpty( extractorClassName ) ) {
      return DEFAULT_EXTRACTOR;
    }
    final ClassLoaderService classLoaderService = registry.getService( ClassLoaderService.class );
    return instantiateExplicitCommandExtractor( extractorClassName, classLoaderService );
  }
View Full Code Here

TOP

Related Classes of org.hibernate.service.classloading.spi.ClassLoaderService

Copyright © 2018 www.massapicom. 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.