44import org .tzi .use .plugins .monitor .MonitorPlugin ;
55import org .tzi .use .plugins .monitor .vm .adapter .InvalidAdapterConfiguration ;
66import org .tzi .use .plugins .monitor .vm .adapter .VMAdapter ;
7+ import org .tzi .use .plugins .monitor .vm .adapter .jvm .JVMAdapter ;
78import org .tzi .use .util .Log ;
89import org .tzi .use .util .StringUtil ;
910
@@ -12,26 +13,23 @@ public class StartMonitorCmd extends AbstractMonitorCmd {
1213 @ Override
1314 public void doPerformCommand (IPluginShellCmd pluginCommand ) {
1415 if (MonitorPlugin .getInstance ().getMonitor ().isRunning ()) {
15- Log .error ("Already monitioring an application. Please stop before starting a new monitor." );
16+ Log .error ("Already monitoring an application. Please stop before starting a new monitor." );
1617 return ;
1718 }
1819
19- String [] args = pluginCommand .getCmdArguments (). split ( " " );
20-
20+ String [] args = pluginCommand .getCmdArgumentList ( );
21+ String adapterName ;
2122 if (args .length == 0 ) {
23+ adapterName = JVMAdapter .JVM_ADAPTER_NAME ;
2224 Log .println ("Using default value for JVM remote debugger: localhost:6000" );
23- }
24-
25- String adpaterName = args [0 ];
26- VMAdapter adapter = MonitorPlugin .getInstance ().getAdapterRegistry ().getAdapterByName (adpaterName );
25+ } else {
26+ adapterName = args [0 ];
27+ }
2728
29+ VMAdapter adapter = MonitorPlugin .getInstance ().getAdapterRegistry ().getAdapterByName (adapterName );
2830 if (adapter == null ) {
29- Log .print ("Invalid adapter name " + StringUtil .inQuotes (adpaterName ) + " specified." );
31+ Log .println ("Invalid adapter name " + StringUtil .inQuotes (adapterName ) + " specified." );
3032 return ;
31- }
32-
33- for (int i = 1 ; i < args .length ;++i ) {
34-
3533 }
3634
3735 try {
@@ -41,6 +39,4 @@ public void doPerformCommand(IPluginShellCmd pluginCommand) {
4139 }
4240 }
4341
44-
45-
4642}
0 commit comments