Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[buckminster-dev] Extension point for query resolver factories

Hi,
I added a new extension point today that makes it possible to register new Component Query Resolution strategies. Previously, all we had was a Resource Map (the RMAP). Now it will be possible to add completely new ways of resolving a query. In addition, I also added the new preference 'queryResolverSortOrder' to the Buckminster preference store. This preference controls the order of execution of registered resolution strategies. When more then one strategy is registered, a panel will pop-up in the Buckminster preference page that makes it possible to change the order and to add/remove strategies.

In order to implement a new strategy, you must write an implementation of the org.eclipse.buckminster.core.resolver.IResolutionFactory. This factory is responsible for creating instances that implements the org.eclipse.buckminster.core.resolver.IResolver interface. Once the factory has been created, it must be registered using the 'org.eclipse.buckminster.core.queryResolvers' extension point.

Here is an example of such a registration:

<extension
      point="org.eclipse.buckminster.core.queryResolvers">
   <queryResolver id="demoRMap">
<factory class="org.eclipse.buckminster.core.resolver.ResourceMapResolverFactory">
         <parameter
               name="resourceMapURL"
value="http://www.eclipse.org/buckminster/samples/rmap/demo.rmap"/>
         <parameter
               name="overrideQueryURL"
               value="true"/>
      </factory>
   </queryResolver>
</extension>

Note that the definition allows for parameters. If the implementation is derived from org.eclipse.buckminster.core.helpers.AbstractExtension and you override the method setExtensionParameter(String key, String value), you will get calls to that method. One call for each parameter. The order of the calls is undefined. The class org.eclipse.buckminster.core.resolver.ResourceMapResolverFactory serves as a good reference implementation.

The code is in CVS right now. Will be released shortly.

Kind Regards,
Thomas Hallgren



Back to the top