IBM Rational Performance Tester SDK

com.ibm.rational.test.common.schedule.editor.extensions
Interface IOptionProvider


public interface IOptionProvider

This interface allows Contributors to initialize their schedule options when the Schedule has been created via the File->New wizard. Upon completion of the wizard, the wizard code enumerates all implementors of the optionProvider extension point. That extension point requires a class to be identified that implements the IOptionProvider interface.

Then, for each implementor of the extension point, the setDefaultOptionValues() method is called.


Method Summary
 String[] getFeatureIDs()
          Called before setDefaultOptionValues() to determine if the options belong in the schedule or not.
 void setDefaultOptionValues(com.ibm.rational.test.common.schedule.Schedule theSchedule)
          Called whenever a test is added to a schedule, so that contributors can initialize their own options and add them to the Schedule.
 

Method Detail

setDefaultOptionValues

void setDefaultOptionValues(com.ibm.rational.test.common.schedule.Schedule theSchedule)
Called whenever a test is added to a schedule, so that contributors can initialize their own options and add them to the Schedule. The Schedule should be checked to make sure the options do not already exist before adding them. (See example.)

Example:
public void setDefaultOptionValues(Schedule theSchedule) { if (theSchedule != null) { MyOptions options = theSchedule.getOptions(MyOptions.class.getName()); if (options == null) { options = MyFactory.createMyOptions(); if (options != null) { options.setValue1("Hi"); options.setValue2("There!"); options.setIntValue(42); theSchedule.addOptions(options); } } } } Note that in the example above, MyOptions is a class the is derived from com.ibm.rational.test.common.models.behavior.CBOption
Also note that the order in which the optionProvider extensions are called is not guaranteed. Only the "general" Schedule options are guaranteed to exist before any of the optionProvider extensions are called.


getFeatureIDs

String[] getFeatureIDs()
Called before setDefaultOptionValues() to determine if the options belong in the schedule or not. When a test is added to a schedule, it's feature ids are enumerated and compared against the feature ids returned by this method. If there is a match, then setDefaultOptionValues() will be called. Returning null will indicate the options should be present regardless of the features in the tests. (ie, always match.) Returning a non-null but empty array will cause the match to always fail.


IBM Rational Performance Tester SDK

© Copyright IBM Corp. 2012. All rights reserved.