public function getUsernameAndPassword()
{
// create and initialize an ArrayList for the callback handlers
$list = new ArrayList();
$list->add($nameCallback = new NameCallback());
$list->add($passwordCallback = new PasswordCallback());
// handle the callbacks
$this->callbackHandler->handle($list);
// return an array with the username and callback
return array($nameCallback->getName(), $passwordCallback->getPassword());
}