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

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


      log.debug( "No driver class specified" );
      return null;
    }

    if ( serviceRegistry != null ) {
      final ClassLoaderService classLoaderService = serviceRegistry.getService( ClassLoaderService.class );
      final Class<Driver> driverClass = classLoaderService.classForName( driverClassName );
      try {
        return driverClass.newInstance();
      }
      catch ( Exception e ) {
        throw new ServiceException( "Specified JDBC Driver " + driverClassName + " could not be loaded", 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

      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

    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

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

    }

    FullTextIndexEventListener fullTextIndexEventListener = new FullTextIndexEventListener();
    registerHibernateSearchEventListener( fullTextIndexEventListener, serviceRegistry );

    ClassLoaderService hibernateClassLoaderService = serviceRegistry.getService( ClassLoaderService.class );
    HibernateSearchSessionFactoryObserver observer = new HibernateSearchSessionFactoryObserver(
        configuration,
        fullTextIndexEventListener,
        hibernateClassLoaderService
    );
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

  @Override
  public void generateSchema() {
    processProperties();

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

    // IMPL NOTE : TCCL handling here is temporary.
    //    It is needed because this code still uses Hibernate Configuration and Hibernate commons-annotations
    //     in turn which relies on TCCL being set.
View Full Code Here

  @SuppressWarnings("unchecked")
  public EntityManagerFactory build() {
    processProperties();

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

    // IMPL NOTE : TCCL handling here is temporary.
    //    It is needed because this code still uses Hibernate Configuration and Hibernate commons-annotations
    //     in turn which relies on TCCL being set.
View Full Code Here

   * 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

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.