Package org.hibernate.boot.registry.classloading.spi

Examples of org.hibernate.boot.registry.classloading.spi.ClassLoaderService


   * Build the bootstrap registry.
   *
   * @return The built bootstrap registry
   */
  public BootstrapServiceRegistry build() {
    final ClassLoaderService classLoaderService;
    if ( providedClassLoaderService == null ) {
      // Use a set.  As an example, in JPA, OsgiClassLoader may be in both
      // the providedClassLoaders and the overridenClassLoader.
      final Set<ClassLoader> classLoaders = new HashSet<ClassLoader>();

View Full Code Here


      Map configurationValues,
      ServiceRegistryImplementor registry) {
    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 {
          resolver.addResolver(
              (DatabaseInfoDialectResolver) classLoaderService.classForName( resolverImplName ).newInstance()
          );
        }
        catch (HibernateException e) {
          throw e;
        }
View Full Code Here

      if ( Class.class.isInstance( configValue ) ) {
        implClass = (Class) configValue;
      }
      else {
        final String className = configValue.toString();
        final ClassLoaderService classLoaderService = registry.getService( ClassLoaderService.class );
        try {
          implClass = classLoaderService.classForName( className );
        }
        catch (ClassLoadingException cle) {
          log.warn( "Unable to locate specified class [" + className + "]", cle );
          throw new ServiceException( "Unable to locate specified multi-tenant connection provider [" + className + "]" );
        }
View Full Code Here

    if ( strategy == MultiTenancyStrategy.DATABASE || strategy == MultiTenancyStrategy.SCHEMA ) {
      // nothing to do, but given the separate hierarchies have to handle this here.
      return null;
    }

    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

  }

  @Override
  public void configure(Map configurationValues) {
    OptionsService optionsService = serviceRegistry.getService( OptionsService.class );
    ClassLoaderService classLoaderService = serviceRegistry.getService( ClassLoaderService.class );
    ConfigurationPropertyReader propertyReader = new ConfigurationPropertyReader( configurationValues, classLoaderService );

    this.config = new MongoDBConfiguration( propertyReader, optionsService.context().getGlobalOptions() );
  }
View Full Code Here

      ServiceRegistryImplementor registry,
      Map configurationValues) {
    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 {
          resolver.addResolver(
              (DialectResolver) classLoaderService.classForName( resolverImplName ).newInstance()
          );
        }
        catch (HibernateException e) {
          throw e;
        }
View Full Code Here

      Map configurationValues,
      ServiceRegistryImplementor registry) {
    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 {
          resolver.addResolver(
              (DatabaseInfoDialectResolver) classLoaderService.classForName( resolverImplName ).newInstance()
          );
        }
        catch (HibernateException e) {
          throw e;
        }
View Full Code Here

    // 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

  }

  // todo : remove this once the state objects are cleaned up

  public static Class classForName(String className, ServiceRegistry serviceRegistry) {
    ClassLoaderService classLoaderService = serviceRegistry.getService( ClassLoaderService.class );
    try {
      return classLoaderService.classForName( className );
    }
    catch ( ClassLoadingException e ) {
      throw new MappingException( "Could not find class: " + className );
    }
  }
View Full Code Here

    if ( modes.size() == 1 && modes.contains( ValidationMode.NONE ) ) {
      // we have nothing to do; just return
      return;
    }

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

    // see if the Bean Validation API is available on the classpath
    if ( isBeanValidationApiAvailable( classLoaderService ) ) {
      // and if so, call out to the TypeSafeActivator
      try {
View Full Code Here

TOP

Related Classes of org.hibernate.boot.registry.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.