Thread Safety of Builders
By default the builders follow the thread safety paradigm of servlets (Singleton scope), meaning that instance variables in your builders must be thread-safe. Communication between your config and data builder APIs can be done through either the config object itself, or via ComponentParams.
public class TestComponentBuilder extends AbstractComponentBuilder{
@Override
public ComponentConfig buildComponentConfig(ComponentParams params)
throws WTException {
Object myObject;
//add information that you want to pass to data builder
params.setAttribute("myKey", myObject);
-----
}
@Override
public Object buildComponentData(ComponentConfig config,
ComponentParams params)
throws WTException {
//get the information that was put in config builder
Object myObject = params.getAttribute("myKey");
-----
}
}