cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Schneider <ch...@die-schneider.net>
Subject Re: Using Distributed OSGi with dynamic dispatch?
Date Wed, 14 May 2014 09:43:58 GMT
I am not sure I understand what you are trying to achieve.
Can you formulate this from a pure business view so without the technology?

This is what I think you want:

B wants to receive events from A. So it registers with A as a kind of 
listener. A then asynchronously sends events to B. Is that correct?
If yes then you might want to rather look into JMS or Distributed Event 
Admin (http://blog.osgi.org/2013/06/distributed-eventing-rfp-158-now.html).

I can imagine that it can be achieved with DOSGi but it would bend the 
scope of the framework quite a bit.

The easiest solution I can imagine as long as the above spec is not 
implemented is using jms topics for communication and hiding jms behind 
a regular OSGi service.

Christian

On 14.05.2014 05:23, Mello, Cody wrote:
> Hello everyone,
>
> I'm fairly new to CXF, and have been working on adapting a project to
> use Distributed OSGi. I've been successful so far by following the
> Spring DM example, but I've hit a wall. After some searching online, I
> can't quite determine how to proceed. I have some code that works
> something like this:
>
> class A implements Service {
>
>      public void register(String str, Client client) {
>          this.map.put(str, client);
>      }
>
>      public void performLater(String str) {
>          this.map.get(str).receive();
>      }
>
>      ....
> }
>
> class B implements Client {
>      protected Service service;
>
>      public void setService(Service serv) {
>          this.service = serv;
>      }
>
>      public void registerWithServer() {
>          this.service.register("myName", this);
>      }
>
>      public void receive() {
>          ....
>      }
> }
>
> Here, A is a service available on one Equinox instance, made available
> over port 9000, and B is on another Equinox instance, making calls to
> A. I have this working well in one direction so far, but the instant
> that performLater() is called, I get an error message like this:
>
> Exception in thread "pool-6-thread-1" java.lang.IllegalAccessError:
> receive is not delegated.
>      at org.apache.cxf.aegis.type.basic.InterfaceInvocationHandler.invoke(InterfaceInvocationHandler.java:57)
>      at com.sun.proxy.$Proxy53.receive(Unknown Source)
>      at net.beaconcontroller.core.internal.Controller.handleMessages(Controller.java:387)
>      at net.beaconcontroller.core.internal.Controller.handleSwitchEvent(Controller.java:199)
>      at net.beaconcontroller.core.internal.Controller.handleEvent(Controller.java:138)
>      at net.beaconcontroller.core.io.internal.IOLoop.doLoop(IOLoop.java:122)
>      at net.beaconcontroller.core.internal.Controller$2.run(Controller.java:541)
>      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>      at java.lang.Thread.run(Thread.java:744)
>
> I believe that I understand why this isn't working: I haven't exported
> any service for Client which can be consumed by the Service. I don't
> know where to head from here, though. I would like to be able to
> deploy multiple Clients in multiple bundles on the same OSGi instance
> and also deploy multiple Equinox instances on separate machines, which
> can dynamically register and deregister themselves with the Service.
> Is this something that I can do with DOSGi or any of the CXF projects?
> If so, what would this look like, and are there any examples I can
> reference?
>
> Thanks!
>
> - Cody


-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com


Mime
View raw message