Package org.hibernate.service.classloading.spi

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


  }

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


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

  }

  public Settings buildSettings(Properties props, ServiceRegistry serviceRegistry) {
    final boolean debugEnabled =  LOG.isDebugEnabled();
    final JdbcServices jdbcServices = serviceRegistry.getService( JdbcServices.class );
    final ClassLoaderService classLoaderService = serviceRegistry.getService( ClassLoaderService.class );

    Settings settings = new Settings();

    //SessionFactory name:
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

      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

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

    }

    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

      SessionFactoryImplementor sessionFactory,
      SessionFactoryServiceRegistry serviceRegistry) {
    // determine requested validation modes.
    final Set<ValidationMode> modes = ValidationMode.getModes( configuration.getProperties().get( MODE_PROPERTY ) );

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

    // try to locate a BV class to see if it is available on the classpath
    boolean isBeanValidationAvailable;
    try {
      classLoaderService.classForName( BV_CHECK_CLASS );
      isBeanValidationAvailable = true;
    }
    catch ( Exception e ) {
      isBeanValidationAvailable = false;
    }
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

      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 );
          return null;
        }
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.