Class SecurityDialogMessageHandler
- java.lang.Object
-
- net.adoptopenjdk.icedteaweb.client.parts.dialogs.security.SecurityDialogMessageHandler
-
- All Implemented Interfaces:
java.lang.Runnable
public class SecurityDialogMessageHandler extends java.lang.Object implements java.lang.RunnableHandlesSecurityDialogMessages and shows appropriate security dialogs.In the current architecture,
SecurityDialogs are shown from a differentAppContextthan theAppContextthat asks for a security prompt. This ensures that all security prompts are isolated and their Look and Feel is not affected by the Look and Feel of the applet/application.This class contains allows a client application to post a
SecurityDialogMessage. When this class finds a security message in the queue, it shows a security warning to the user, and setsSecurityDialogMessage.userResponseto the appropriate value.
-
-
Field Summary
Fields Modifier and Type Field Description private static LoggerLOGprivate java.util.concurrent.BlockingQueue<SecurityDialogMessage>queuethe queue of incoming messages to show security dialogs
-
Constructor Summary
Constructors Constructor Description SecurityDialogMessageHandler()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidhandleMessage(SecurityDialogMessage message)Handles a singleSecurityDialogMessageby showing aSecurityDialog.private static booleanisHeadless()Returns whether the current runtime configuration is headlessprivate static booleanisXtrustAll()Returns whether the current runtime configuration is trustAllprivate static booleanisXtrustNone()Returns whether the current runtime configuration is trustNonevoidpostMessage(SecurityDialogMessage message)Post a message to the security event queue.private booleanprocessAutomatedAnswers(SecurityDialogMessage message, SecurityDialog dialog)private voidprocessMessageInGui(SecurityDialog dialog, RememberableDialog found, SecurityDialogMessage message)private voidprocessMessageInHeadless(SecurityDialog dialog, SecurityDialogMessage message)voidrun()Runs the message handler loop.private static booleanshouldPromptUser()Returns whether the current runtime configuration allows prompting user for security warnings.protected voidunlockMessagesClient(SecurityDialogMessage msg)
-
-
-
Field Detail
-
LOG
private static final Logger LOG
-
queue
private java.util.concurrent.BlockingQueue<SecurityDialogMessage> queue
the queue of incoming messages to show security dialogs
-
-
Method Detail
-
run
public void run()
Runs the message handler loop. This waits for incoming security messages and shows a security dialog.- Specified by:
runin interfacejava.lang.Runnable
-
handleMessage
protected void handleMessage(SecurityDialogMessage message)
Handles a singleSecurityDialogMessageby showing aSecurityDialog.Once the user has made a choice the
SecurityDialogMessage.toDispose(if not null) is disposed andSecurityDialogMessage.lock(in not null) is released.- Parameters:
message- the message indicating what type of security dialog to show
-
processAutomatedAnswers
private boolean processAutomatedAnswers(SecurityDialogMessage message, SecurityDialog dialog)
-
processMessageInGui
private void processMessageInGui(SecurityDialog dialog, RememberableDialog found, SecurityDialogMessage message)
-
processMessageInHeadless
private void processMessageInHeadless(SecurityDialog dialog, SecurityDialogMessage message)
-
unlockMessagesClient
protected void unlockMessagesClient(SecurityDialogMessage msg)
-
postMessage
public void postMessage(SecurityDialogMessage message)
Post a message to the security event queue. This message will be picked up by the security thread and used to show the appropriate security dialog.Once the user has made a choice the
SecurityDialogMessage.toDispose(if not null) is disposed andSecurityDialogMessage.lock(in not null) is released.- Parameters:
message- indicates the type of security dialog to show
-
shouldPromptUser
private static boolean shouldPromptUser()
Returns whether the current runtime configuration allows prompting user for security warnings.- Returns:
- true if security warnings should be shown to the user.
-
isHeadless
private static boolean isHeadless()
Returns whether the current runtime configuration is headless- Returns:
- true X is used
-
isXtrustAll
private static boolean isXtrustAll()
Returns whether the current runtime configuration is trustAll- Returns:
- true if xtrustall was specified
-
isXtrustNone
private static boolean isXtrustNone()
Returns whether the current runtime configuration is trustNone- Returns:
- true if xtrustnone was specified
-
-