* @see LoginContext#login()
*/
public void login(LoginContext context) throws LoginException
{
if (preventsLogin != null)
throw new LoginException("Additional Logins are not allowed");
if (context == null)
throw new LoginException("Context is required to login.");
HashKey key = new HashKey(context);
if (subjects.containsKey(key))
throw new LoginException("Already logged in through this context ").setLoginContext(context);
Subject mySubject;
mySubject = context.login();
if (mySubject == null)
throw new LoginException("Login failed ").setLoginContext(context);
mySubject.setReadOnly();
if (key.preventsAdditionalLogins())
preventsLogin = key;
subjects.put(key, mySubject);
logins.add(key);