public void onXmppCommand(Object command) throws Exception {
// TODO we could do some nice code generation to boost performance
// by autogenerating the bytecode to statically lookup a handler from a registry maybe?
Handler handler = registry.getHandler(command.getClass());
if (handler == null) {
unknownCommand(command);
}
else {
handler.handle(command);
}
}