public static void setCurrentInstance(PrimeRequestContext context, FacesContext facesContext) {
        if (context == null) {
            if (facesContext != null) {
                facesContext.getAttributes().remove(INSTANCE_KEY);
            }
        }
        else {
            facesContext.getAttributes().put(INSTANCE_KEY, context);
        }
    }
A {@link PrimeRequestContext} is a contextual store for the current request.

It can be accessed via:
<blockquote>
PrimeRequestContext.getCurrentInstance(context)
</blockquote>
primefaces/src/main/java/org/primefaces/context/PrimeRequestContext.java