若要作為獨立式應用程式進行除錯,您需要撰寫模擬 IBM® Rational® Rhapsody® 回呼的主要作業,如下列範例所示:
public static void main(String[] args) {
//create an instance of my plug-in
MyPlugin myPlugin = new MyPlugin ();
//get Rhapsody application that is currently running
IRPApplication app
=RhapsodyAppServer.getActiveRhapsodyApplication();
//init the plug-in
myPlugin.RhpPluginInit(app);
//simulate a call to the plug-in
myPlugin.RhpPluginInvokeItem();
}
一旦包括這種主要作業,便可以執行 Rational Rhapsody,並採用會針對所有其他 Java 應用程式使用的方式,對外掛程式進行除錯。