/* * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package com.sun.jmx.remote.util; import java.io.IOException; import java.io.ObjectOutputStream; import java.io.OutputStream; import java.util.Collection; import java.util.HashMap; import java.util.Hashtable; import java.util.Iterator; import java.util.Map; import java.util.SortedMap; import java.util.SortedSet; import java.util.StringTokenizer; import java.util.TreeMap; import java.util.TreeSet; import java.security.AccessController; import javax.management.ObjectName; import javax.management.MBeanServer; import javax.management.InstanceNotFoundException; import javax.management.remote.JMXConnectorFactory; import javax.management.remote.JMXConnectorServerFactory; import com.sun.jmx.mbeanserver.GetPropertyAction; import com.sun.jmx.remote.security.NotificationAccessController; import javax.management.remote.JMXConnector; import javax.management.remote.JMXConnectorServer; public class EnvHelp { /** * Name of the attribute that specifies a list of class names acceptable * as parameters to the {@link RMIServer#newClient(java.lang.Object) RMIServer.newClient()} * remote method call. *

* This list of classes should correspond to the transitive closure of the * credentials class (or classes) used by the installed {@linkplain JMXAuthenticator} * associated with the {@linkplain RMIServer} implementation. *

* If the attribute is not set, or is null, then any class is * deemed acceptable. */ public static final String CREDENTIAL_TYPES = "jmx.remote.rmi.server.credential.types"; /** *

Name of the attribute that specifies a default class loader * object. * The value associated with this attribute is a ClassLoader object

*/ private static final String DEFAULT_CLASS_LOADER = JMXConnectorFactory.DEFAULT_CLASS_LOADER; /** *

Name of the attribute that specifies a default class loader * ObjectName. * The value associated with this attribute is an ObjectName object

*/ private static final String DEFAULT_CLASS_LOADER_NAME = JMXConnectorServerFactory.DEFAULT_CLASS_LOADER_NAME; /** * Get the Connector Server default class loader. *

* Returns: *

*

* * @param env Environment attributes. * @param mbs The MBeanServer for which the connector server provides * remote access. * * @return the connector server's default class loader. * * @exception IllegalArgumentException if one of the following is true: *