List<Principal> roles = getGroupsFromSubject(msgSubject);
String [] rolesArr = new String[roles.size()];
for( int i = 0; i < rolesArr.length; ++i ) {
rolesArr[i] = roles.get(i).getName();
}
UserGroupAdapter newUserGroupAdapter = new JmsUserGroupAdapter(userPass[0], rolesArr);
JAASUserGroupCallbackImpl.addExternalUserGroupAdapter(newUserGroupAdapter);
jmsUserGroupAdapter = newUserGroupAdapter;
} catch (Exception e) {
logger.warn("Unable to retrieve group information for user in message: " + e.getMessage(), e);
}