1 8 9 package test.javax.management.remote.rmi; 10 11 import java.net.MalformedURLException ; 12 import java.security.Policy ; 13 import javax.management.remote.JMXServiceURL ; 14 15 import test.javax.management.remote.RemoteSecurityManagerTestCase; 16 17 20 public class RMIJRMPRemoteSecurityManagerTest extends RemoteSecurityManagerTestCase 21 { 22 static 23 { 24 Policy.setPolicy(new RMIJRMPRemoteModifiablePolicy()); 26 System.setSecurityManager(new SecurityManager ()); 27 } 28 29 public RMIJRMPRemoteSecurityManagerTest(String s) 30 { 31 super(s); 32 } 33 34 protected JMXServiceURL createJMXConnectorServerAddress() throws MalformedURLException 35 { 36 return new JMXServiceURL ("rmi", "localhost", 7777); 37 } 38 39 public static class RMIJRMPRemoteModifiablePolicy extends RemoteModifiablePolicy 40 { 41 public boolean isServerSide() 42 { 43 if (!isSeparateClientServerPermissions()) return true; 44 String name = Thread.currentThread().getName(); 45 if (name.indexOf("RMI") >= 0) return true; 46 return false; 47 } 48 } 49 } 50 | Popular Tags |