SocketPermission sp = new SocketPermission( getParameter("host") + ":6000", "connect"); try { AccessController.checkPermission(sp); System.out.println("Ok to open socket"); } catch (AccessControlException ace) { System.out.println(ace); }