You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by ken <an...@gmail.com> on 2014/03/12 02:06:13 UTC
executing command during client startup
Hi,
I am using karaf 3.0.0 and trying to execute a custom command during
bin/client. While a trivial command such as "bin/client -h 127.0.0.1 "exit
--help"" works well. Its when I attempt to execute a custom command that
I've wrote that requires access to the CommandSession that it doesn't seem
to work properly.
The command is basically a text base wizard presenting the user with a
question and asking for an input. In the command, I've attempted the
following;
1. get the ConsoleReader from the CommandSession - which isn't available
when using executing a command via bin/client
2. tried using commandSession.getConsole() and commandSession.getKeyboard()
however, this seems to hang when accepting input, it is being blocked and
not returning the input i want.
Looking at the org.apache.karaf.client.Main class, it takes in a
ByteArrayInputStream which I've changed to System.in and the same problem is
still being observed in step 2.
Are there anyway to access the input and output stream to write text to it?
Thanks,
Ken
--
View this message in context: http://karaf.922171.n3.nabble.com/executing-command-during-client-startup-tp4032203.html
Sent from the Karaf - User mailing list archive at Nabble.com.
Re: executing command during client startup
Posted by ken <an...@gmail.com>.
Another thing I've tried is. Start the karaf server and in another shell
executed "./client -h 127.0.0.1 shutdown" to execute the shutdown command.
It prompted for an input, however it does not respond. This hangs in the
read() method of ThreadInputStream.
Any ideas on how to resolve this issue?
--
View this message in context: http://karaf.922171.n3.nabble.com/executing-command-during-client-startup-tp4032203p4032251.html
Sent from the Karaf - User mailing list archive at Nabble.com.