Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ecf-dev] previous message : null createInstance incomplete

Hi Pierre,

I see that on several occasions in the Application class that you create ID instances like this:

       final Namespace jgNS= new JGroupsNamespace();
       return  jgNS.createInstance( new String[]{ jgURL } ) ;

This won't likely work (as you've found), and should be replaced with this pattern:

return idFactory.createID("ecf.namespace.jgroupsid",jgURL);

Notice that the "ecf.namespace.jgroupsid" is declared as a namespace extension within the org.eclipse.ecf.provider.jgroups/plugin.xml so the idFactory will find it, and use the JGroupsNamespace instance defined within the jgroups provider...no need to import the JGroupsNamespace class and create an instance.

(Note that you can get the idFactory via the IIDFactory OSGi service...e.g. a service tracker...*or* you can use: IDFactory.getDefault(). But the OSGi service is preferred over the IDFactory.getDefault() method).

Thanks,

Scott


Pierre Henry Perret wrote:
Scott,

I've committed an *o.e.e.client.jgroups* as a product on ecf1 so that you can see the code.
--
Pierre
------------------------------------------------------------------------

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



Back to the top