Package org.hibernate.service.classloading.spi

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


    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


      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 );
        Dialect dialect = serviceRegistry.getService( JdbcServices.class ).getDialect();
    // 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

    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

    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

   *
   * @param indexer the jandex indexer
   * @param className the fully qualified name of the class
   */
  private void indexClass(Indexer indexer, String className) {
    ClassLoaderService classLoaderService = serviceRegistry.getService( ClassLoaderService.class );
    InputStream stream = classLoaderService.locateResourceStream( className );
    try {
      indexer.index( stream );
    }
    catch ( IOException e ) {
      throw new HibernateException( "Unable to open input stream for class " + className, e );
View Full Code Here

  private ConfiguredClassHierarchy(List<ClassInfo> classes, ServiceRegistry serviceRegistry) {
    defaultAccessType = determineDefaultAccessType( classes );
    inheritanceType = determineInheritanceType( classes );

    ClassLoaderService classLoaderService = serviceRegistry.getService( ClassLoaderService.class );
    Class<?> clazz = classLoaderService.classForName( classes.get( classes.size() - 1 ).name().toString() );
    ResolvedTypeWithMembers resolvedMembers = ReflectionHelper.resolveMemberTypes( clazz );

    configuredClasses = new ArrayList<ConfiguredClass>();
    ConfiguredClass parent = null;
    for ( ClassInfo info : classes ) {
View Full Code Here

    }
    else if ( EntityCopyAllowedLoggedObserver.SHORT_NAME.equals( entityCopyObserverStrategyString ) ) {
      return EntityCopyAllowedLoggedObserver.class;
    }
    else {
      final ClassLoaderService classLoaderService = serviceRegistry.getService( ClassLoaderService.class );
      try {
        return classLoaderService.classForName( entityCopyObserverStrategyString );
      }
      catch (ClassLoadingException e) {
        throw new HibernateException(
            "Unable resolve strategy [" +
                entityCopyObserverStrategyString +
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

    }

    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

  /**
   * {@inheritDoc}
   */
  public ConnectionProvider initiateService(Map configurationValues, ServiceRegistry registry) {
    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

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.