Method method = sessionClass.getMethod("login", String.class, String.class);
method.invoke(session, userID, password);
loggedIn = true;
loginProcessed = true;
} catch (ClassNotFoundException e) {
throw new IMException(EXCEPTION);
} catch (IllegalAccessException e) {
throw new IMException(EXCEPTION);
} catch (InstantiationException e) {
throw new IMException(EXCEPTION);
} catch (NoSuchMethodException e) {
throw new IMException(EXCEPTION);
} catch (Exception e) {
Throwable throwable = e.getCause();
if (throwable!= null && "ymsg.network.LoginRefusedException".equals(throwable.getClass().getName())) {
loggedIn = false;
loginProcessed = true;
throw new IMException(throwable.getMessage());
}
}
}