private List selectProfiles(String serverProfiles) throws Exception {
// If a profile selector is provided it takes precedence
// over the default implementation.
//
SelectProfiles profileSelector =
(SelectProfiles) env.get("com.sun.jmx.remote.profile.selector");
if (profileSelector != null) {
profileSelector.selectProfiles(env, serverProfiles);
String clientProfiles = (String) env.get("jmx.remote.profiles");
if (clientProfiles == null) {
return Collections.EMPTY_LIST;
} else {
StringTokenizer cst = new StringTokenizer(clientProfiles, " ");