[forge-dev] Shell Prompt Locking

Lincoln Baxter, III lincolnbaxter at gmail.com
Tue Jul 17 17:02:48 EDT 2012


Something tells me that promptWithCompleter should not be blocking if we
can help it. I think there are a few issues that have come up related to
this, but TBH I don't really know what we could chance since this pretty
much delegates to the JLine library. I'm also not sure why promptSecret
would not block, or would behave any differently.

Do you think you could put together a Forge test case for this so I can see
the issue? Otherwise, perhaps we could do a hangout so you can bring me up
to speed on this.

What do you think?
~Lincoln



On Wed, Jul 11, 2012 at 2:00 PM, James Perkins <jperkins at redhat.com> wrote:

>  I was working on getting support to connect to remote servers for the
> JBoss AS 7 plugin. The management API's require a
> javax.security.auth.callback.CallbackHandler. I originally had an
> implementation that would prompt for the username and password to be
> entered. The issue is that the ShellImpl locks on execution [1] with the
> same lock on the promptWithCompleter [2]. This causes the prompt on the
> CallbackHandler implementation to dead-lock.
>
> The workaround I've found is the promptSecret [3] does not seem to block.
> There are other potential ways around this, but they generally require the
> user to authenticate on each execution which is not really desirable.
>
> This leads to a few questions:
>
>    1. Should the promptSecret be blocking too?
>    2. Is there a better approach to getting the credentials?
>    3. Should the promptWithCompleter be blocking? (I haven't really
>    looked at the code enough to determine this)
>
>
>
> [1]:
> https://github.com/forge/core/blob/master/shell/src/main/java/org/jboss/forge/shell/ShellImpl.java#L836
> [2]:
> https://github.com/forge/core/blob/master/shell/src/main/java/org/jboss/forge/shell/ShellImpl.java#L1337
> [3]:
> https://github.com/forge/core/blob/master/shell/src/main/java/org/jboss/forge/shell/ShellImpl.java#L1404
>
> --
> James R. Perkins
> JBoss by Red Hat
>
>
> _______________________________________________
> forge-dev mailing list
> forge-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/forge-dev
>
>


-- 
Lincoln Baxter, III
http://ocpsoft.org
"Simpler is better."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/forge-dev/attachments/20120717/f9a7c26c/attachment.html 


More information about the forge-dev mailing list