< prev index next >

src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnector.java

Print this page

2201     private static final byte base64ToInt[] = {
2202         -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2203         -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2204         -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54,
2205         55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4,
2206         5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
2207         24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34,
2208         35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51
2209     };
2210 
2211     //--------------------------------------------------------------------
2212     // Private stuff - Find / Set default class loader
2213     //--------------------------------------------------------------------
2214     @SuppressWarnings("removal")
2215     private ClassLoader pushDefaultClassLoader() {
2216         final Thread t = Thread.currentThread();
2217         final ClassLoader old =  t.getContextClassLoader();
2218         if (defaultClassLoader != null)
2219             AccessController.doPrivileged(new PrivilegedAction<Void>() {
2220                 public Void run() {
2221                     t.setContextClassLoader(defaultClassLoader);


2222                     return null;
2223                 }
2224             });
2225             return old;
2226     }
2227 
2228     @SuppressWarnings("removal")
2229     private void popDefaultClassLoader(final ClassLoader old) {
2230         AccessController.doPrivileged(new PrivilegedAction<Void>() {
2231             public Void run() {
2232                 Thread.currentThread().setContextClassLoader(old);



2233                 return null;
2234             }
2235         });
2236     }
2237 
2238     //--------------------------------------------------------------------
2239     // Private variables
2240     //--------------------------------------------------------------------
2241     /**
2242      * @serial The RMIServer stub of the RMI JMX Connector server to
2243      * which this client connector is (or will be) connected. This
2244      * field can be null when <var>jmxServiceURL</var> is not
2245      * null. This includes the case where <var>jmxServiceURL</var>
2246      * contains a serialized RMIServer stub. If both
2247      * <var>rmiServer</var> and <var>jmxServiceURL</var> are null then
2248      * serialization will fail.
2249      *
2250      * @see #RMIConnector(RMIServer,Map)
2251      **/
2252     @SuppressWarnings("serial") // Not statically typed as Serializable

2201     private static final byte base64ToInt[] = {
2202         -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2203         -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2204         -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54,
2205         55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4,
2206         5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
2207         24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34,
2208         35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51
2209     };
2210 
2211     //--------------------------------------------------------------------
2212     // Private stuff - Find / Set default class loader
2213     //--------------------------------------------------------------------
2214     @SuppressWarnings("removal")
2215     private ClassLoader pushDefaultClassLoader() {
2216         final Thread t = Thread.currentThread();
2217         final ClassLoader old =  t.getContextClassLoader();
2218         if (defaultClassLoader != null)
2219             AccessController.doPrivileged(new PrivilegedAction<Void>() {
2220                 public Void run() {
2221                     if (t.getContextClassLoader() != defaultClassLoader) {
2222                         t.setContextClassLoader(defaultClassLoader);
2223                     }
2224                     return null;
2225                 }
2226             });
2227             return old;
2228     }
2229 
2230     @SuppressWarnings("removal")
2231     private void popDefaultClassLoader(final ClassLoader old) {
2232         AccessController.doPrivileged(new PrivilegedAction<Void>() {
2233             public Void run() {
2234                 Thread t = Thread.currentThread();
2235                 if (t.getContextClassLoader() != old) {
2236                     t.setContextClassLoader(old);
2237                 }
2238                 return null;
2239             }
2240         });
2241     }
2242 
2243     //--------------------------------------------------------------------
2244     // Private variables
2245     //--------------------------------------------------------------------
2246     /**
2247      * @serial The RMIServer stub of the RMI JMX Connector server to
2248      * which this client connector is (or will be) connected. This
2249      * field can be null when <var>jmxServiceURL</var> is not
2250      * null. This includes the case where <var>jmxServiceURL</var>
2251      * contains a serialized RMIServer stub. If both
2252      * <var>rmiServer</var> and <var>jmxServiceURL</var> are null then
2253      * serialization will fail.
2254      *
2255      * @see #RMIConnector(RMIServer,Map)
2256      **/
2257     @SuppressWarnings("serial") // Not statically typed as Serializable
< prev index next >