Skip navigation links
IcedTea-Web
NetX

Package net.sourceforge.jnlp.security

package generally about showing various security prompts

See: Description

Package net.sourceforge.jnlp.security Description

package generally about showing various security prompts

Following diagram shows how dialog is handled when some application/appelt needs to show it


        ITW-thread(s)               | dialogs-thread                                                                                                                                  X
                                    |                                                                                                                                                 X
   presteps in SecurtyDialogs       |                                                                                                                                                 X
      # eg handle trustall/none     |                                                                                                                                                 X
            |                       |                                                                                                                                                 X
    prepare message                 |                                                                                                                                                 X
               # set JNLPfile       |                                                                                                                                                 X
               # set type of dialog |                                                                                                                                                 X
                   see              |                                                                                                                                                 X
               # extrass...         |                                                                                                                                                 X
               # lock               |                                                                                                                                                 X
            |                       |                                                                                                                                                 X
    post message to queue           |                                                                                                                                                 X
            | >------------------------------------> | <----------------------------------------------------------------------------------------------------------------------------| X
    wait for result from            |            read message from queue                                                                                                            | X
          getUserResponse(lock lock)|                |                                                                                                                              | X
                                    |            create instance of dialogue                                                                                                        | X
                                    |                |                                                                                                                              | X
                                    |            according to type of dialogue, create and place panel  (this is important, panel is keeper of rememberable decision)               | X
                                    |                |                                                                                                                              | X
                                    |            if panel is instance of RememberableDialog                                                                                         | X
                                    |              else                        then                                                                                                 | X
                                    |                |                          |                                                                                                   | X
                                    |                |                         check whether this applet+action was already stored and permanently remembered in .appletSecurity    | X
                                    |                |                          no                                                                        yes                       | X
                                    |                |<-------------------------|                                                                          |                        | X
                                    |                |                                                                                                     |                        | X
                                    |                |                                                                                                     |                        | X
                                    |                |                                                                                                     |                        | X
                                    |                |                                                                                                     |                        | X
                                    |            add closing and disposing listener(s) to button(s)                                                        |                        | X
                                    |                |     * set return value to listener?                                                                 |                        | X
                                    |                |                                                                                                     |                        | X
                                    |                      according to set value, set default selected button?                                            |                        | X
                                    |                |                                                                                                     |                        | X
                                    |            if his applet+action was already stored in .appletSecurity include text approved/denyed and when          |                        | X
                                    |                |                                                                                                     |                        | X
                                    |            wait for user to click button or close dialogue                                                          |                        | X
                                    |                |                                                                                                     |                        | X
                                    |                --> set selected value (via listener?) to message, dispose dialog -> <- set stored value to message <-|                        | X
                                    |                                                                                    |                                                          | X
                                    |                    if panel is instance of RememberableDialogue crate new, update old(date/decision,jars...) record in .appletSecurity        | X
                                    |                                                                                    |                                                          | X
            | <------------------------------------------------------------------------------------------< unlock lock of this message  >--------------------------------------------| X
  read result from message          |                                                                                                                                                 X
            |                       |                                                                                                                                                 X
   continue accordingly             |                                                                                                                                                 X
                                                                                                                                                                                      X

How to make your dialog to be remembered

  • RememberPanelResult getRemeberAction - if your dialogue uses RememberPanel, then you get RememberPanelResult for free
  • DialogResult getValue() - what your dialogue actually returns. If it is some simple Yes, No.. Then you can use existing types in dialogresults package. If it handles something more complex, you can inspire yourself in AccessWarningPaneComplexReturn
  • JNLPFile getFile() - ok, file keeps all needed to identify applet/app, so it is a must.
  • DialogResult readValue(String s) - the dialog must be able to read answer from String, which is supplied to it via engine. If you use some PrimitivesSubset extension, then it is mostly only static call its factory creator from String.
This should be all. The value your type writeValue to file, is then stored under Key, which is your extension of SecurityPanel implementing RememberableDialog name
Skip navigation links
IcedTea-Web
NetX

Submit a bug or feature