Java by API/java.security/AccessController
AccessController: checkPermission(Permission perm)
import java.net.SocketPermission;
import java.security.AccessControlException;
import java.security.AccessController;
public class AccessTest {
public static void main(String[] a) {
SocketPermission sp = new SocketPermission("www.jexp.ru", "connect");
try {
AccessController.checkPermission(sp);
System.out.println("Ok to open socket");
} catch (AccessControlException ace) {
System.out.println(ace);
}
}
}