FileDocCategorySizeDatePackage
LoginCallbackHandler.javaAPI DocGlassfish v2 API3520Fri May 04 22:35:26 BST 2007com.sun.enterprise.security.auth.login

LoginCallbackHandler

public class LoginCallbackHandler extends Object implements CallbackHandler
This is the default callback handler provided by the application client container. The container tries to use the application specified callback handler (if provided). If there is no callback handler or if the handler cannot be instantiated then this default handler is used.

Fields Summary
private boolean
isGUI
private static final com.sun.enterprise.util.LocalStringManagerImpl
localStrings
Constructors Summary
public LoginCallbackHandler()


      
        this(true);
    
public LoginCallbackHandler(boolean gui)

        isGUI = gui;
    
Methods Summary
public voidhandle(javax.security.auth.callback.Callback[] callbacks)
This is the callback method called when authentication data is required. It either pops up a dialog box to request authentication data or use text input.

param
the callback object instances supported by the login module.

        if(isGUI) {
            String user = localStrings.getLocalString("login.user", "user");
	    new GUILoginDialog(user, callbacks);
	} else {
	    new TextLoginDialog(callbacks);
        }