org.hibernate.osgi
Class OsgiScanner

java.lang.Object
  extended by org.hibernate.osgi.OsgiScanner
All Implemented Interfaces:
Scanner

public class OsgiScanner
extends Object
implements Scanner

OSGi-specific implementation of the Scanner contract. Scans the persistence unit Bundle for classes and resources. The given 'URL jartoScan' is completely ignored.


Constructor Summary
OsgiScanner(org.osgi.framework.Bundle persistenceBundle)
           
 
Method Summary
 Set<Class<?>> getClassesInJar(URL jartoScan, Set<Class<? extends Annotation>> annotationsToLookFor)
          return all classes in the jar matching one of these annotations if annotationsToLookFor is empty, return all classes
 Set<NamedInputStream> getFilesInClasspath(Set<String> filePatterns)
          Return all files in the classpath (ie PU visibility) matching one of these file names if filePatterns is empty, return all files the use case is really exact file name.
 Set<NamedInputStream> getFilesInJar(URL jartoScan, Set<String> filePatterns)
          return all files in the jar matching one of these file names if filePatterns is empty, return all files eg **\/*.hbm.xml, META-INF/orm.xml
 Set<Package> getPackagesInJar(URL jartoScan, Set<Class<? extends Annotation>> annotationsToLookFor)
          return all packages in the jar matching one of these annotations if annotationsToLookFor is empty, return all packages
 String getUnqualifiedJarName(URL jarUrl)
          return the unqualified JAR name ie customer-model.jar or store.war
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OsgiScanner

public OsgiScanner(org.osgi.framework.Bundle persistenceBundle)
Method Detail

getPackagesInJar

public Set<Package> getPackagesInJar(URL jartoScan,
                                     Set<Class<? extends Annotation>> annotationsToLookFor)
Description copied from interface: Scanner
return all packages in the jar matching one of these annotations if annotationsToLookFor is empty, return all packages

Specified by:
getPackagesInJar in interface Scanner

getClassesInJar

public Set<Class<?>> getClassesInJar(URL jartoScan,
                                     Set<Class<? extends Annotation>> annotationsToLookFor)
Description copied from interface: Scanner
return all classes in the jar matching one of these annotations if annotationsToLookFor is empty, return all classes

Specified by:
getClassesInJar in interface Scanner

getFilesInJar

public Set<NamedInputStream> getFilesInJar(URL jartoScan,
                                           Set<String> filePatterns)
Description copied from interface: Scanner
return all files in the jar matching one of these file names if filePatterns is empty, return all files eg **\/*.hbm.xml, META-INF/orm.xml

Specified by:
getFilesInJar in interface Scanner

getFilesInClasspath

public Set<NamedInputStream> getFilesInClasspath(Set<String> filePatterns)
Description copied from interface: Scanner
Return all files in the classpath (ie PU visibility) matching one of these file names if filePatterns is empty, return all files the use case is really exact file name. NOT USED by HEM at the moment. We use exact file search via getResourceAsStream for now.

Specified by:
getFilesInClasspath in interface Scanner

getUnqualifiedJarName

public String getUnqualifiedJarName(URL jarUrl)
Description copied from interface: Scanner
return the unqualified JAR name ie customer-model.jar or store.war

Specified by:
getUnqualifiedJarName in interface Scanner


Copyright © 2001-2015 Red Hat, Inc. All Rights Reserved.