基本的なカスタマイズ > ユーザーインタフェースのカスタマイズ > MVC コンポーネント > MVC コンポーネントの概要 > JCA コンポーネント > ヒント > ビルダーのスレッドセーフティ
  
ビルダーのスレッドセーフティ
デフォルトで、ビルダーはサーブレットのスレッドセーフティパラダイムに従います (シングルトンスコープ)。つまり、ビルダー内のインスタンス変数はスレッドセーフでなければなりません。コンフィギュレーションビルダー API とデータビルダー API との間の通信は、コンフィギュレーションオブジェクト自体または 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");
-----
}
}