It's nice that Eclipse uses service oriented architecture more and more, but am I only the developer who sees the lack of knowledge of by what plug-in and at what stage service is registered as a problem?
Consider example:
IServiceLocator someServiceLocator = ...
SomeService someService = (SomeService)someServiceLocator.getService(SomeService.class);
// oops, someService is null
Possible reasons to why someService is null are:
- Some plug-in that registers this service doesn't present or not loaded
- Service wasn't registered yet
How should one resolve this? Are there any to开发者_开发问答ols?
Thanks.
The short answer: there are no tools available.
For the complete list of services and where they are registered do "Call Hierarchy" on ServiceLocator.registerService(Class api, Object service).
For a good list of the available global services, look at Workbench.initializeDefaultServices(). There are some additional services that are only available at the window or workbench part level.
If you want to know what plugins are installed and started, you can use the OSGI console and see the state of the plugins.
So if you are looking for a service "XService", find the plugin which contains the service and look for the plugin state on the OSGI console.
Start you application with -console option and type ss on the osgi console. This is not straight forward but works.
加载中,请稍侯......
精彩评论