public static CspState getCspState(FacesContext context) {
        CspState cspState = (CspState) context.getAttributes().get(CspState.class.getName());
        if (cspState == null) {
            cspState = new CspState(context);
            context.getAttributes().put(CspState.class.getName(), cspState);
        }

        return cspState;
    }
Custom {@link FacesContextWrapper} to init and release our {@link PrimeRequestContext}.
primefaces/src/main/java/org/primefaces/context/PrimeFacesContext.java