[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] [WireAdmin] the simplest test does not work

No, I just register Producer and Consumer services.

Do I have to call any WireAdmin methods additionally to create wire?

Best regards,
Dmytro Pishchukhin


On Fri, Jan 7, 2011 at 15:01, John W Ross <jwross@xxxxxxxxxx> wrote:

Are you connecting the consumer to the producer by calling WireAdmin.createWire("producer.all", "consumer.all", null)?

~ John


Inactive hide details for Dmytro Pishchukhin ---01/07/2011 07:10:56 AM---Hello All,Dmytro Pishchukhin ---01/07/2011 07:10:56 AM---Hello All,


To

equinox-dev@xxxxxxxxxxx

cc


Subject

[equinox-dev] [WireAdmin] the simplest test does not work

Hello All,

I'm trying to run a simple WireAdmin Producer/Consumer test.

List of bundles I use:

osgi> ss
Framework is launched.
id      State       Bundle
0       ACTIVE      org.eclipse.osgi_3.6.1.R36x_v20100806
1       ACTIVE      org.eclipse.osgi.services_3.2.100.v20100503
2       ACTIVE      org.eclipse.osgi.util_3.2.100.v20100503
3       ACTIVE      org.eclipse.equinox.common_3.6.0.v20100503
4       ACTIVE      org.eclipse.equinox.registry_3.5.0.v20100503
5       ACTIVE      org.eclipse.equinox.util_1.0.200.v20100503
6       ACTIVE      org.eclipse.equinox.log_1.2.100.v20100503
7       ACTIVE      org.eclipse.equinox.ds_1.2.1.R36x_v20100803
8       ACTIVE      org.eclipse.equinox.preferences_3.3.0.v20100503
9       ACTIVE      org.eclipse.equinox.event_1.2.0.v20100503
10      ACTIVE      org.eclipse.equinox.cm_1.0.200.v20100520
11      ACTIVE      org.eclipse.equinox.wireadmin_1.0.200.v20100503
12      ACTIVE      wireadmin_test_1.0.0.SNAPSHOT

Producer and Consumer are both DS components

Producer:
....
protected void activate(ComponentContext context) {
        Hashtable props = new Hashtable();
        //the producer will be sending String data (flavors)
        Class[] flavors = new Class[]{String.class};
        props.put(WireConstants.WIREADMIN_PRODUCER_FLAVORS, flavors);
        //the producer PID property
        props.put("service.pid", "producer.all");
        reg = context.getBundleContext().registerService(Producer.class.getName(), this, props);
    }
.....

Consumer:
....
 protected void activate(ComponentContext context) {
        Hashtable prop = new Hashtable();
        //this property shows that the consumer will accept any data types
        prop.put(WireConstants.WIREADMIN_CONSUMER_FLAVORS, new Class[]{Object.class});
        //the identifier property of the consumer
        prop.put("service.pid", "consumer.all");
        //registering the service on the framework
        reg = context.getBundleContext().registerService(Consumer.class.getName(), this, prop);
    }
....

Debug Info from WireAdmin:
DEBUG 11 Notification event ; Producer com.acme.ProducerImpl@97d3f0; source: null; wires null
DEBUG 11  [0] 10001 : asynchronous
DEBUG 11 Notification event ; Consumer com.acme.ConsumerImpl@c28cb7; source: null; wires null
DEBUG 11  [0] 10001 : asynchronous

I do not see any mistakes in my code and configuration. Maybe, you can find any :)

Thanks in advance.

Best regards,
Dmytro Pishchukhin
_______________________________________________

equinox-dev mailing list
equinox-dev@xxxxxxxxxxx

_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev


GIF image

GIF image