Package org.hibernate.search.engine.service.classloading.spi

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


    if ( criteria instanceof CriteriaImpl ) {
      String targetEntity = ( (CriteriaImpl) criteria ).getEntityOrClassName();
      if ( entityType == null ) {
        ServiceManager serviceManager = searchFactoryImplementor.getServiceManager();
        try {
          ClassLoaderService classLoaderService = serviceManager.requestService( ClassLoaderService.class );
          entityType = classLoaderService.classForName( targetEntity );
        }
        catch (ClassLoadingException e) {
          throw new SearchException( "Unable to load entity class from criteria: " + targetEntity, e );
        }
        finally {
View Full Code Here


    session.close();
  }

  private Class<?> getEntityClass(String entity) {
    Class<?> clazz;
    ClassLoaderService classLoaderService = serviceManager.requestService( ClassLoaderService.class );
    try {
      clazz = classLoaderService.classForName( entity );
    }
    catch (ClassLoadingException e) {
      throw new IllegalArgumentException( entity + " not a indexed entity" );
    }
    finally {
View Full Code Here

    if ( criteria instanceof CriteriaImpl ) {
      String targetEntity = ( (CriteriaImpl) criteria ).getEntityOrClassName();
      if ( entityType == null ) {
        ServiceManager serviceManager = searchFactoryImplementor.getServiceManager();
        try {
          ClassLoaderService classLoaderService = serviceManager.requestService( ClassLoaderService.class );
          entityType = classLoaderService.classForName( targetEntity );
        }
        catch (ClassLoadingException e) {
          throw new SearchException( "Unable to load entity class from criteria: " + targetEntity, e );
        }
        finally {
View Full Code Here

    session.close();
  }

  private Class<?> getEntityClass(String entity) {
    Class<?> clazz;
    ClassLoaderService classLoaderService = serviceManager.requestService( ClassLoaderService.class );
    try {
      clazz = classLoaderService.classForName( entity );
    }
    catch (ClassLoadingException e) {
      throw new IllegalArgumentException( entity + " not a indexed entity" );
    }
    finally {
View Full Code Here

    annotationBasedProviders.add( new DateBridgeProvider() );
    annotationBasedProviders.add( new NumericBridgeProvider() );
    annotationBasedProviders.add( new SpatialBridgeProvider() );
    annotationBasedProviders.add( new TikaBridgeProvider() );

    ClassLoaderService classLoaderService = serviceManager.requestService( ClassLoaderService.class );
    try {
      regularProviders = classLoaderService.loadJavaServices( BridgeProvider.class );
      regularProviders.add( new EnumBridgeProvider() );
      regularProviders.add( new BasicJDKTypesBridgeProvider( serviceManager ) );
    }
    finally {
      serviceManager.releaseService( ClassLoaderService.class );
View Full Code Here

    }
  }

  public static Class<?> classForName(String classNameToLoad, String componentDescription, ServiceManager serviceManager) {
    Class<?> clazz;
    ClassLoaderService classLoaderService = serviceManager.requestService( ClassLoaderService.class );
    try {
      clazz = classLoaderService.classForName( classNameToLoad );
    }
    catch (ClassLoadingException e) {
      throw new SearchException(
          "Unable to find " + componentDescription +
              " implementation class: " + classNameToLoad, e
View Full Code Here

   * @return The class reference.
   *
   * @throws ClassLoadingException From {@link Class#forName(String, boolean, ClassLoader)}.
   */
  public static Class classForName(String classNameToLoad, ServiceManager serviceManager) {
    ClassLoaderService classLoaderService = serviceManager.requestService( ClassLoaderService.class );
    try {
      return classLoaderService.classForName( classNameToLoad );
    }

    finally {
      serviceManager.releaseService( ClassLoaderService.class );
    }
View Full Code Here

    this.serviceManager = serviceManager;
  }

  @Override
  public InputStream openResource(String resource) throws IOException {
    ClassLoaderService classLoaderService = serviceManager.requestService( ClassLoaderService.class );
    InputStream inputStream;
    try {
      inputStream = classLoaderService.locateResourceStream( resource );
    }
    finally {
      serviceManager.releaseService( ClassLoaderService.class );
    }
View Full Code Here

    }
  }

  public static Class<?> classForName(String classNameToLoad, String componentDescription, ServiceManager serviceManager) {
    Class<?> clazz;
    ClassLoaderService classLoaderService = serviceManager.requestService( ClassLoaderService.class );
    try {
      clazz = classLoaderService.classForName( classNameToLoad );
    }
    catch (ClassLoadingException e) {
      throw new SearchException(
          "Unable to find " + componentDescription +
              " implementation class: " + classNameToLoad, e
View Full Code Here

   * @return The class reference.
   *
   * @throws ClassLoadingException From {@link Class#forName(String, boolean, ClassLoader)}.
   */
  public static Class classForName(String classNameToLoad, ServiceManager serviceManager) {
    ClassLoaderService classLoaderService = serviceManager.requestService( ClassLoaderService.class );
    try {
      return classLoaderService.classForName( classNameToLoad );
    }

    finally {
      serviceManager.releaseService( ClassLoaderService.class );
    }
View Full Code Here

TOP

Related Classes of org.hibernate.search.engine.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.