}
String username = getAndRemoveParameter(parameters, "username", String.class);
String password = getAndRemoveParameter(parameters, "password", String.class);
if (username != null && password != null) {
ConnectionFactory cf = endpoint.getConfiguration().getConnectionFactory();
UserCredentialsConnectionFactoryAdapter ucfa = new UserCredentialsConnectionFactoryAdapter();
ucfa.setTargetConnectionFactory(cf);
ucfa.setPassword(password);
ucfa.setUsername(username);
endpoint.getConfiguration().setConnectionFactory(ucfa);
} else {
if (username != null || password != null) {
// exclude the the saturation of username and password are all empty
throw new IllegalArgumentException("The JmsComponent's username or password is null");