Hi,

I have a simple OSGi service I've exposed via CXF DOSGi 1.4.0 using
Karaf 2.2.11 - it's pretty much a straight copy from the discovery
sample from the 1.4.0 release of cxf-dosgi. The service is exposed by
the bundle activator as follows :

    private ServiceRegistration reg;

    public void start(BundleContext bc) throws Exception {
        Dictionary<String, Object> props = new Hashtable<String,
        Object>();

        String host = getHostName();
        int port = getPort();

        String address = getAddress(host,port);
        LOG.info("Registering ws address {}",address);

        props.put("service.exported.interfaces", "*");
        props.put("service.exported.configs", "org.apache.cxf.ws");
        props.put("org.apache.cxf.ws.address", address); // old obsolete
        value
        props.put("endpoint.id", address);

        reg = bc.registerService(PingService.class.getName(),
                new SimplePingService(), props);
    }

    public void stop(BundleContext bc) throws Exception {
        LOG.info("Unregistering ping service");

        reg.unregister();
    }


And sure enough it gets registered as a SOAP service and I can see it in
zookeeper too. However, when I stop the bundle the service is indeed
removed in the local OSGi registry but I can still access the SOAP
endpoint, and it's still visible in zookeeper too. Furthermore, if I
re-activate the bundle the service is now available on the old endpoint
and the new one.

So either my understanding is wrong (I would have thought unregistering
the service would remove the SOAP service too) or there's a bug in
DOSGi, or I'm missing something / doing something wrong.

Could someone give some guidance please ?

Thanks,

Jon.

Reply via email to