+ add javadoc

This commit is contained in:
costin
2010-07-16 13:26:44 +03:00
parent 754d42a880
commit a3936e3ce5

View File

@@ -36,6 +36,8 @@ import com.gemstone.gemfire.GemFireException;
import com.gemstone.gemfire.cache.Region;
/**
* Entity processing and interpreting shell commands.
*
* @author Costin Leau
*/
@Component
@@ -87,6 +89,7 @@ public class CommandProcessor {
System.out.println(process(br.readLine()));
} catch (Exception ex) {
System.out.println("Error executing last command " + ex.getMessage());
ex.printStackTrace();
}
System.out.print("-> ");
@@ -125,10 +128,18 @@ public class CommandProcessor {
}
String command = sc.next();
// query shortcut
if ("query".equalsIgnoreCase(command)) {
String query = line.trim().substring(command.length());
return region.query(query).toString();
}
// parse commands w/o arguments
if ("exit".equalsIgnoreCase(command)) {
threadActive = false;
return EMPTY;
return "Node exiting...";
}
if ("help".equalsIgnoreCase(command)) {
return help;
@@ -138,7 +149,7 @@ public class CommandProcessor {
}
if ("clear".equalsIgnoreCase(command)) {
region.clear();
return EMPTY;
return "Clearing grid";
}
if ("keys".equalsIgnoreCase(command)) {
return region.keySet().toString();
@@ -179,12 +190,6 @@ public class CommandProcessor {
return region.put(arg, arg2);
}
// pass the entire string w/o the command
if ("query".equalsIgnoreCase(command)) {
String query = line.trim().substring(command.length());
return region.query(query).toString();
}
sc.close();
return "unknown command - run 'help' for available commands";
}