Re: [hibernate-dev] Scanner contract

2013-03-16 Thread Ales Justin
> I should point out this is based on what we saw when Brett initially worked > with Karaf, especially in the Enterprise OSGi use cases. The incoming > PersistenceUnitInfo contained no urls other than the root url, which happened > to be an osgi bundle url (the protocol was "bundle"). To me, i

Re: [hibernate-dev] Scanner contract

2013-03-16 Thread Gunnar Morling
2013/3/16 Steve Ebersole > I should clarify why I did not necessarily like the ClassDescriptor and > PackageDescriptor (or whatever we name them) to "encapsulate which class > loader to use". At least based on the JBoss AS usage (and I can envision > other environments being similar) we do not n

Re: [hibernate-dev] Scanner contract

2013-03-16 Thread Steve Ebersole
I should point out this is based on what we saw when Brett initially worked with Karaf, especially in the Enterprise OSGi use cases. The incoming PersistenceUnitInfo contained no urls other than the root url, which happened to be an osgi bundle url (the protocol was "bundle"). To me, interpre

Re: [hibernate-dev] Scanner contract

2013-03-16 Thread Steve Ebersole
No guessing involved. The PersistenceUnitDescriptor passed in to scan() tells exactly which deployment we are talking about. And if the container does not know the ClassLoader how do you expect HIbernate to? ;) On 03/16/2013 03:09 PM, Ales Justin wrote: > It's probably best if the SPI would ta

Re: [hibernate-dev] Scanner contract

2013-03-16 Thread Ales Justin
It's probably best if the SPI would take the ClassLoader as parameter, instead of having to guess it, or depend on proper TCCL (think OSGi ;-)). e.g. for this reason Infinispan introduced AdvancedCache::withClassLoader. -Ales On Mar 16, 2013, at 8:48 PM, Steve Ebersole wrote: > I should clarif

Re: [hibernate-dev] Scanner contract

2013-03-16 Thread Steve Ebersole
I should clarify why I did not necessarily like the ClassDescriptor and PackageDescriptor (or whatever we name them) to "encapsulate which class loader to use". At least based on the JBoss AS usage (and I can envision other environments being similar) we do not necessarily know the ultimate Cl

Re: [hibernate-dev] Scanner contract

2013-03-16 Thread Steve Ebersole
On Sat 16 Mar 2013 03:29:22 AM CDT, Gunnar Morling wrote: > > interface ScanResult { > public Set getPackageNames(); > public Set getClassNames(); > public Set getResourceStreams(); > } > > > Is there missing one method? Or is it 4 methods in the original design > and one is not required with the n

Re: [hibernate-dev] Scanner contract

2013-03-16 Thread Gunnar Morling
Hi, 2013/3/16 Steve Ebersole > I am proposing a change to the org.hibernate.jpa.packaging.spi.Scanner > SPI. First I suggest we make the scanning happen in one call, and that > one call return a token of the result. Currently we have 4 "scan" > methods on the Scanner contract; I instead propos