FileDocCategorySizeDatePackage
DummyCallbackHandler.javaAPI DocExample1084Sun Feb 02 16:54:06 GMT 2003ora.jwsnut.chapter6.client

DummyCallbackHandler

public class DummyCallbackHandler extends Object implements CallbackHandler

Fields Summary
Constructors Summary
Methods Summary
public voidhandle(javax.security.auth.callback.Callback[] callbacks)

        for (int i = 0; i < callbacks.length; i++) {
            Callback callback = callbacks[i];
            if (callback instanceof NameCallback) {
                ((NameCallback)callback).setName("User");
            } else if (callback instanceof PasswordCallback) {
                ((PasswordCallback)callback).setPassword(new char[] { 'P" });
            } else {
                throw new UnsupportedCallbackException(callback);
            }
        }