On Jul 16, 2009, at 6:17 AM, Richard S. Hall wrote:
Yes, it has gone away. You could create a fragment for the client to
add the imports. Still not very clean, but better than the
alternatives perhaps (e.g., making the packages available via boot
delegation).
Is it possible for a "client" bundle to request that a fragment be
attached to it? According to the spec, it appears that the fragment
must declare their hosts via the Framework-Host manifest header. This
won't work because there may be multiple client (host) bundles, and
the clients aren't known at the time the fragment is defined.
Also, it seems like requiring clients to attach a fragment bundle
isn't really any different than requiring the package imports since in
either case I'm leaking some implementation details of the service
bundle. If I replace the implementation with another which doesn't
use cglib, a different fragment would need to be attached. This isn't
tragic; I'm just testing my understanding.
It looks like I could make it work cleanly (from the client bundle
implementors' perspective anyway) by putting the cglib code in a
"bootclasspath" extension fragment. Is this what you were referring
to by "boot delegation?"
Thanks for your help - if nothing else, I know to stop chasing the x-
implicitwire angle :)
Kris
-> richard
On 07/16/2009 12:37 PM, Kris Pruden wrote:
Hello,
I have an OSGi-based application which uses cglib. I'm running
into a problem that seems very similar to what's described here:
http://www.osgi.org/blog/2007/07/to-declare-or-not-to-declare.html
Basically, I have one bundle which calls a method on a service
provided by another bundle, passing it a class. The service
implementation uses cglib to generate an alternative implementation
of the passed-in class, and return an instance of it.
This all works fine in unit tests (not in an OSGi container), but
fails when run inside of felix with a ClassNotFoundException on
net.sf.cglib.proxy.Factory.
I was able to make this work by adding several cglib-specific
imports on my client bundle manifest, but I'd rather not do that
since the use of cglib is an implementation detail that I don't
want to leak to clients.
The above article suggests that the user of the x-implicitwire
directive will accomplish what I need, but it doesn't seem to
work. I came across this post:
http://mail-archives.apache.org/mod_mbox/felix-users/200801.mbox/%[email protected]%3e
Which indicates that this directive is just an experiment and may
go away. Has it been removed? If so, is there any viable
alternative to adding the explicit import in the client bundle(s)?
Thanks,
Kris
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]