コマンドは、TargetableCommandImpl クラスを拡張す ることによって実装されます。このクラスは、TargetableCommand インターフェースをインプリメントします。 TargetableCommandImpl クラスは、 TargetableCommand インターフェースのいくつかのメソッド (例えば、戻り値の設定) の実装を提供する抽象クラスで、 アプリケーション自体が実装する必要がある追加メソッド (例えば、コマンドの実行方法) を宣言します。
... import java.lang.reflect.*; import com.ibm.websphere.command.*; public class MyCommandImpl extends TargetableCommandImpl implements MyCommand { // Set instance variables here ... // Implement methods in the MyCommand interface ... // Implement methods in the CompensableCommand interface ... // Implement abstract methods in the TargetableCommandImpl class ... }