Hi everyone,

I'd like to pick up on a discussion that happened in May 2009 on the dev
list: http://felix.markmail.org/thread/tdowmhihje4c4fza

I think I have a related problem. My use case is this: I'm trying to
implement a simple Remote Services implementation and have a
distribution provider that creates service proxies for imported services.
Since the distribution provider has no wires to the various possible API
bundles for the imported services, it has to create ServiceFactories so
it can first load the interface(s) using the caller bundle and provide
it with a proxy for the right interface for the caller.

Now, Felix doesn't return the imported service (the ServiceFactory),
probably because of the check for case 2 in
ServiceRegistrationImpl.isClassAccessible():
http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/ServiceRegistrationImpl.java?view=annotate
That check was introduced in October 2009 (rev 830347).

That check feels a little arbitrary to me. I guess it works for the
extender case where an extender bundle registers a ServiceFactory under
the target bundle's BundleContext. But in the case of Remote Services I
don't have such a target bundle. The only bundle I can register the
ServiceFactories under is the distribution provider itself. But the case
2 check prohibits that. I have a feeling that if I created a "service
contrainer bundle" next to the distribution provider that receives the
ServiceRegistrations for the proxies I could probably circumvent this
check. But that's not elegant.

I've run my code against Knopflerfish to see how it reacts and there my
approach worked just fine.

The Remote Service Admin spec even hints in 122.5.6 Proxying (4.2.
Enterprise) at using a ServiceProxy and that it's responsible for
avoiding ClassCastExceptions. I may have missed something but Felix may
be too restrictive here. Any thoughts?

Thanks,
Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org

Reply via email to