diff options
author | Omair Majid <[email protected]> | 2010-10-22 10:44:12 -0400 |
---|---|---|
committer | Omair Majid <[email protected]> | 2010-10-22 10:44:12 -0400 |
commit | 12747b34f31cfb98c057f45e8aeb1711ea7341c8 (patch) | |
tree | 45b4d70163f9f19f014017bf33d0adaf725e03a6 /netx/net/sourceforge/jnlp/NetxPanel.java | |
parent | 61aeaaf89164aa93280527c7eb80cf4c1432fbee (diff) |
show security dialogs using the main AppContext
2010-10-22 Omair Majid <[email protected]>
* netx/net/sourceforge/jnlp/NetxPanel.java
(runLoader): Do not initialize JNLPRuntime here.
(createAppletThreads): Initialize JNLPRuntim here.
* netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java:
Switch from SecurityWarningDialog.AccessType to
SecurityWarning.AccessType.
* netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
(getInstance(JNLPFile,UpdatePolicy)): Switch to SecurityWarning.
(initializeResources): Likewise.
(checkTrustWithUser): Likewise.
* netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java:
Add securityDialogMesasgeHandler.
(initialize): Set System look and feel. Start security thread.
(startSecurityThread): New method. Starts a thread to show security
dialogs.
(getSecurityDialogHandler): Returns the securityDialogMessageHandler.
* netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java:
Switch from SecurityWarningDialog.AccessType to
SecurityWarning.AccessType.
(checkAwtEventQueueAccess): New method. Skeleton code for allowing
EventQueue acccess to applets.
* netx/net/sourceforge/jnlp/security/AccessWarningPane.java:
Switch from SecurityWarningDialog.AccessType to
SecurityWarning.AccessType.
* netx/net/sourceforge/jnlp/security/CertWarningPane.java:
Likewise.
* netx/net/sourceforge/jnlp/security/SecurityWarningDialog.java:
Move DialogType and AccessType to SecurityWarning.
(SecurityWarningDialog(DialogType,AccessType,JNLPFile,CertVerifier,
X509Certificate,Object[])): New method. The catch-all construction.
(SecurityWarningDialog(DialogType,AccessType,JNLPFile): Delegate to
the new constructor.
(SecurityWarningDialog(DialogType,AccessType,JNLPFile,CertVerifier)):
Likewise.
(SecurityWarningDialog(DialogType,AccessType,CertVerifier)): Likewise.
(SecurityWarningDialog(DialogType,AccessType,JNLPFile,Object[])):
Likewise.
(SecurityWarningDialog(DialogType,X509Certificate)): Likewise.
(showAccessWarningDialog(AccessType,JNLPFile)): Move to SecurityWarning
class.
(showAccessWarningDialog(AccessType,JNLPFile,Object[])): Likewise.
(showNotAllSignedWarningDialog(JNLPFile)): Likewise.
(showCertWarningDialog(AccessType,JNLPFile,CertVerifier)): Likewise.
(showAppletWarning): Likewise.
(initDialog): Make dialog non modal and remove window closing listener.
(getValue): Make public.
(dispose): New method. Notify listeners.
(notifySelectionMade): New method. Notify listeners that user has made
a decision.
(addActionListener): New method. Add a listener to be notified when
user makes a decision about this security warning.
* netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java:
Switch from SecurityWarningDialog.AccessType to
SecurityWarning.AccessType.
* netx/net/sourceforge/jnlp/services/ServiceUtil.java: Likewise.
* netx/net/sourceforge/jnlp/services/XClipboardService.java: Likewise.
* netx/net/sourceforge/jnlp/services/XExtendedService.java: Likewise.
* netx/net/sourceforge/jnlp/services/XFileOpenService.java: Likewise.
* netx/net/sourceforge/jnlp/services/XFileSaveService.java: Likewise.
* netx/net/sourceforge/jnlp/security/SecurityDialogMessage.java:
New class.
* netx/net/sourceforge/jnlp/security/SecurityDialogMessageHandler.java:
New class.
(run): New method. Runs the security message loop.
(handleMessage): New method. Handles a SecurityDialogMessage to show a
security warning.
(postMessage): New method. Posts a message to sthe security message
queue.
* netx/net/sourceforge/jnlp/security/SecurityWarning.java: New class.
Move AccessType and DialogType from SecurityWarningDialog to here.
(showAccessWarningDialog): Moved from SecurityWarningDialog to here.
(showAccessWarningDialog): Moved from SecurityWarningDialog to here.
Modified to post messages to the security queue instead of showing a
SecurityWarningDialog directly.
(showNotAllSignedWarningDialog): Likewise.
(showCertWarningDialog): Likewise.
(showAppletWarning): Likewise.
(getUserReponse): New method. Posts a message to the security thread and
blocks until it gets a response from the user.
Diffstat (limited to 'netx/net/sourceforge/jnlp/NetxPanel.java')
-rw-r--r-- | netx/net/sourceforge/jnlp/NetxPanel.java | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/netx/net/sourceforge/jnlp/NetxPanel.java b/netx/net/sourceforge/jnlp/NetxPanel.java index 977451d..1cd4d1b 100644 --- a/netx/net/sourceforge/jnlp/NetxPanel.java +++ b/netx/net/sourceforge/jnlp/NetxPanel.java @@ -84,19 +84,6 @@ public class NetxPanel extends AppletViewerPanel getHeight(), atts); - synchronized(JNLPRuntime.initMutex) { - //The custom NetX Policy and SecurityManager are set here. - if (!JNLPRuntime.isInitialized()) { - if (JNLPRuntime.isDebug()) - System.out.println("initializing JNLPRuntime..."); - - JNLPRuntime.initialize(false); - } else { - if (JNLPRuntime.isDebug()) - System.out.println("JNLPRuntime already initialized"); - } - } - doInit = true; dispatchAppletEvent(APPLET_LOADING, null); status = APPLET_LOAD; @@ -146,6 +133,20 @@ public class NetxPanel extends AppletViewerPanel */ // Reminder: Relax visibility in sun.applet.AppletPanel protected synchronized void createAppletThread() { + // initialize JNLPRuntime in the main threadgroup + synchronized(JNLPRuntime.initMutex) { + //The custom NetX Policy and SecurityManager are set here. + if (!JNLPRuntime.isInitialized()) { + if (JNLPRuntime.isDebug()) + System.out.println("initializing JNLPRuntime..."); + + JNLPRuntime.initialize(false); + } else { + if (JNLPRuntime.isDebug()) + System.out.println("JNLPRuntime already initialized"); + } + } + // when this was being done (incorrectly) in Launcher, the call was // new AppThreadGroup(mainGroup, file.getTitle()); ThreadGroup tg = new AppThreadGroup(Launcher.mainGroup, |