private String getOriginatingClass(Permission p)
            throws RecursivePermissionException {
        final Throwable t = new Throwable();
        final StackTraceElement[] ste = t.getStackTrace();
        for (StackTraceElement s : ste) {
            if (s.getClassName().contentEquals(thisClass)
                    && s.getMethodName().contentEquals("getProductionDomain")) {
                throw new RecursivePermissionException();
            }
        }
        return ste[ste.length - 1].getClassName();
    }