How to call karaf console command in Java
问题 If I want to execute a karaf shell command in my plugin (java), how to do it? ex: opendaylight-user@root> snmp4sdn:printdb "org.apache.felix.service.command.CommandProcessor" can handle it ? 回答1: In Karaf 3, you have to use the Felix Gogo services, ie the CommandProcessor . From a CommandProcessor , you can create a CommandSession and then call execute on this session. Two notes on this: In Karaf4, the service has changed - it's not dependent on Gogo anymore All the shell commands use an