Putting prerequisites in plugin.xml for a component plugin
Actually, it is neither an advisor nor a participant, but a component instead.
The other plugins (advisors and participants) leverage its methods to retrieve some pieces of information and perform some common tasks.
I would like this plugin to be able to retrieve also the services that advisors and participants use (IWorkItem server, IRepositoryItemService, ...), but I need to declare their interfaces as prerequistes of the component plugin in the plugin.xml file.
Is it possibile or not?
So far, I could not find any point in plugin.xml where it is possible to put this piece of xml:
<prerequisites>
<requiredService interface="com.ibm.team.workitem.service.IWorkItemServer"/>
<requiredService interface="com.ibm.team.repository.service.IRepositoryItemService"/>
</prerequisites>
The current content of plugin.xml of the component plugin is:
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension point="com.ibm.team.repository.common.components">
<component id="com.ibm.team.custom.common" name="[Custom] Common">
</component>
</extension>
</plugin>
I am working with RTC 4.0.6.
Accepted answer
Also see https://rsjazz.wordpress.com/2012/07/31/rtc-update-parent-duration-estimation-and-effort-participant/ at the end of the post.
Comments
In the provided examples the services are retrieved by advisor and participant plugins.
Of course, it works, but I would like to do a different thing.
I am trying to retrieve those services in the component plugin: this way, I would provide a single, common point to retrieve these services.
I have no problem in retrieving the services in the component plugin (there are no changes in the code), but at runtime the plugin generates and exception, because the interfaces are not declared in the plugin.xml.
If I put the <prerequisites> tag anywhere in the plugin.xml. it is just ignored at runtime,
You can not just put the stuff somewhere because it is more convenient. The other plugins don't know anything about the component plugin. All are isolated. You have to put the required services into each plugin that requires them!