In fact, if anything I would think that promptSecret <i>would block,<b> </b></i>and promptWithCompleter would not. Seems backwards?<br><br><div class="gmail_quote">On Tue, Jul 17, 2012 at 5:02 PM, Lincoln Baxter, III <span dir="ltr">&lt;<a href="mailto:lincolnbaxter@gmail.com" target="_blank">lincolnbaxter@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">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&#39;t really know what we could chance since this pretty much delegates to the JLine library. I&#39;m also not sure why promptSecret would not block, or would behave any differently.<br>

<br>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.<br><br>What do you think?<br>~Lincoln<br><br><br>

<br><div class="gmail_quote"><div><div class="h5">On Wed, Jul 11, 2012 at 2:00 PM, James Perkins <span dir="ltr">&lt;<a href="mailto:jperkins@redhat.com" target="_blank">jperkins@redhat.com</a>&gt;</span> wrote:<br></div>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">

  

    
  
  <div text="#000000" bgcolor="#FFFFFF">
    I was working on getting support to connect to remote servers for
    the JBoss AS 7 plugin. The management API&#39;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.<br>
    <br>
    The workaround I&#39;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.<br>
    <br>
    This leads to a few questions:<br>
    <ol>
      <li>Should the promptSecret be blocking too?</li>
      <li>Is there a better approach to getting the credentials?</li>
      <li>Should the promptWithCompleter be blocking? (I haven&#39;t really
        looked at the code enough to determine this)</li>
    </ol>
    <br>
    <br>
    [1]:
    
    <a href="https://github.com/forge/core/blob/master/shell/src/main/java/org/jboss/forge/shell/ShellImpl.java#L836" target="_blank">https://github.com/forge/core/blob/master/shell/src/main/java/org/jboss/forge/shell/ShellImpl.java#L836</a><br>


    [2]: <a href="https://github.com/forge/core/blob/master/shell/src/main/java/org/jboss/forge/shell/ShellImpl.java#L1337" target="_blank">https://github.com/forge/core/blob/master/shell/src/main/java/org/jboss/forge/shell/ShellImpl.java#L1337</a><br>


    [3]:
    
    <a href="https://github.com/forge/core/blob/master/shell/src/main/java/org/jboss/forge/shell/ShellImpl.java#L1404" target="_blank">https://github.com/forge/core/blob/master/shell/src/main/java/org/jboss/forge/shell/ShellImpl.java#L1404</a><span><font color="#888888">
    <pre cols="72">-- 
James R. Perkins
JBoss by Red Hat</pre>
  </font></span></div>

<br></div></div>_______________________________________________<br>
forge-dev mailing list<br>
<a href="mailto:forge-dev@lists.jboss.org" target="_blank">forge-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/forge-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-dev</a><br>
<br></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><br>-- <br>Lincoln Baxter, III<br><a href="http://ocpsoft.org" target="_blank">http://ocpsoft.org</a><br>&quot;Simpler is better.&quot;<br>

</font></span></blockquote></div><br><br clear="all"><br>-- <br>Lincoln Baxter, III<br><a href="http://ocpsoft.org" target="_blank">http://ocpsoft.org</a><br>&quot;Simpler is better.&quot;<br>