karaf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ken <anh...@gmail.com>
Subject executing command during client startup
Date Wed, 12 Mar 2014 01:06:13 GMT
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.

Mime
View raw message