[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [equinox-dev] Hibernate and classloaders
- From: Emmanuel Potvin <epotvin@xxxxxxxxxxx>
- Date: Fri, 28 Mar 2008 08:33:09 -0400
- Delivered-to: firstname.lastname@example.org
- Thread-index: AciQdtTA7BUNV9yPTiuEqUPO+DPKKAAWO3iA
Thanks, I solved my problem with Eclipse-BuddyPolicy and
Eclipse-RegisterBuddy. It's exactly what I wanted.
De : equinox-dev-bounces@xxxxxxxxxxx
[mailto:equinox-dev-bounces@xxxxxxxxxxx] De la part de Alin Dreghiciu
Envoyé : 27 mars 2008 21:56
À : Equinox development mailing list
Objet : Re: [equinox-dev] Hibernate and classloaders
On Fri, Mar 28, 2008 at 12:01 AM, Emmanuel Potvin <epotvin@xxxxxxxxxxx>
> My question is about classloaders. Hibernate is just an example.
> How can I change temporarily the classpath of an object? In this case, I
> pass a string to a configurator class containing « /hibernate.cfg.xml ».
> configurator open the file and configure hibernate. The problem is : the
> hibernate.cfg.xml file (and any entity classes) are in my current bundle,
> but the configurator run as in his proper bundle, so it don't see any of
> I know that the httpservice use string for resource registering. I want
> same thing.
If you want the same thing than you will have to:
1. from your hibernate bundle register a HibernateService with a
method like, lets say, registerMappings(String hbmLocaton)
2. the above service should implement ServiceFactory (read more about
on the core osgi specs)
3. in getService(...) implementation you will get the Bundle that
contains the class that made the call to the service so you are now
able to do Bundle.getResource or Bundle.getEntry to find the url of
your hbm file
4. on ungetService(...) ou can deconfgure (undo) what you have done above.
I don't know if this is workable for our use case but at least this is
how HttpService implementations works.
Hope it helps,
> equinox-dev mailing list
equinox-dev mailing list