1 18 package org.apache.activemq.console.util; 19 20 import org.apache.activemq.broker.util.CommandMessageListener; 21 22 import java.io.BufferedReader ; 23 import java.io.InputStreamReader ; 24 25 31 public class SimpleConsole { 32 33 public static void main(String [] args) { 34 CommandMessageListener listener = new CommandMessageListener(null); 35 36 try { 37 BufferedReader reader = new BufferedReader (new InputStreamReader (System.in)); 38 while (true) { 39 String line = reader.readLine(); 40 if (line == null || "quit".equalsIgnoreCase(line)) { 41 break; 42 } 43 line = line.trim(); 44 if (line.length() == 0) { 45 continue; 46 } 47 48 System.out.println(listener.processCommandText(line)); 49 } 50 } 51 catch (Exception e) { 52 System.out.println("Caught: " + e); 53 e.printStackTrace(); 54 } 55 } 56 } 57 | Popular Tags |