Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Update to new properties

...

Code Block
java
java
public class Activator implements BundleActivator {
    private ServiceRegistration reg;

    public void start(BundleContext bc) throws Exception {        
        Dictionary props = new Hashtable();
        
        String host = getHostName(); // obtain the current host name
        int port = getPort();        // find a free port
        
        props.put("osgiservice.remoteexported.interfaces", "*");
        props.put("osgiservice.remoteexported.configuration.typeconfigs", "pojoorg.apache.cxf.ws");
        props.put("osgiorg.remoteapache.configurationcxf.pojows.address", "http://" + host + ":" + port + "/display");

        reg = bc.registerService(DisplayService.class.getName(), 
                new DisplayServiceImpl(host + ":" + port), props);
    }

    public void stop(BundleContext bc) throws Exception {
        reg.unregister();
    }
}

...