@Override
    public void handle ( Callback[] callbacks ) throws IOException, UnsupportedCallbackException {
        for ( Callback cb : callbacks ) {
            if ( log.isDebugEnabled() ) {
                log.debug("Got callback " + cb.getClass().getName());
            }

            if ( cb instanceof NameCallback ) {
                NameCallback nc = (NameCallback) cb;
                String userDomain = this.getSpecifiedUserDomain();
                if ( this.getUsername() != null && userDomain != null ) {
                    nc.setName(this.getUsername() + "@" + userDomain);
                }
            }
            else if ( cb instanceof PasswordCallback ) {
                PasswordCallback pc = (PasswordCallback) cb;
                if ( this.getPassword() != null ) {
                    pc.setPassword(this.getPassword().toCharArray());
                }
            }
        }
    }
@ Override public void handle ( Callback [ ] callbacks ) throws IOException , UnsupportedCallbackException { for ( Callback cb : callbacks ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "Got callback " + cb . getClass ( ) . getName ( ) ) ; } if ( cb instanceof NameCallback ) { NameCallback nc = ( NameCallback ) cb ; String userDomain = this . getSpecifiedUserDomain ( ) ; if ( this . getUsername ( ) != null && userDomain != null ) { nc . setName ( this . getUsername ( ) + "@" + userDomain ) ; } } else if ( cb instanceof PasswordCallback ) { PasswordCallback pc = ( PasswordCallback ) cb ; if ( this . getPassword ( ) != null ) { pc . setPassword ( this . getPassword ( ) . toCharArray ( ) ) ; } } } }
{@inheritDoc}

@see javax.security.auth.callback.CallbackHandler#handle(javax.security.auth.callback.Callback[])