jdk/src/jdk.naming.rmi/share/classes/com/sun/jndi/rmi/registry/RegistryContext.java
equal
deleted
inserted
replaced
351 |
351 |
352 |
352 |
353 /** |
353 /** |
354 * Wrap a RemoteException inside a NamingException. |
354 * Wrap a RemoteException inside a NamingException. |
355 */ |
355 */ |
356 @SuppressWarnings("deprecation") |
|
357 public static NamingException wrapRemoteException(RemoteException re) { |
356 public static NamingException wrapRemoteException(RemoteException re) { |
358 |
357 |
359 NamingException ne; |
358 NamingException ne; |
360 |
359 |
361 if (re instanceof ConnectException) { |
360 if (re instanceof ConnectException) { |
363 |
362 |
364 } else if (re instanceof AccessException) { |
363 } else if (re instanceof AccessException) { |
365 ne = new NoPermissionException(); |
364 ne = new NoPermissionException(); |
366 |
365 |
367 } else if (re instanceof StubNotFoundException || |
366 } else if (re instanceof StubNotFoundException || |
368 re instanceof UnknownHostException || |
367 re instanceof UnknownHostException) { |
369 re instanceof SocketSecurityException) { |
|
370 ne = new ConfigurationException(); |
368 ne = new ConfigurationException(); |
371 |
369 |
372 } else if (re instanceof ExportException || |
370 } else if (re instanceof ExportException || |
373 re instanceof ConnectIOException || |
371 re instanceof ConnectIOException || |
374 re instanceof MarshalException || |
372 re instanceof MarshalException || |
412 |
410 |
413 /** |
411 /** |
414 * Attempts to install a security manager if none is currently in |
412 * Attempts to install a security manager if none is currently in |
415 * place. |
413 * place. |
416 */ |
414 */ |
417 @SuppressWarnings("deprecation") |
|
418 private static void installSecurityMgr() { |
415 private static void installSecurityMgr() { |
419 |
416 |
420 try { |
417 try { |
421 System.setSecurityManager(new RMISecurityManager()); |
418 System.setSecurityManager(new SecurityManager()); |
422 } catch (Exception e) { |
419 } catch (Exception e) { |
423 } |
420 } |
424 } |
421 } |
425 |
422 |
426 /** |
423 /** |