public static PrimeApplicationContext getCurrentInstance(FacesContext facesContext, boolean create) {
        if (facesContext == null || facesContext.getExternalContext() == null) {
            return null;
        }

        PrimeApplicationContext applicationContext =
                (PrimeApplicationContext) facesContext.getExternalContext().getApplicationMap().get(INSTANCE_KEY);

        if (create && applicationContext == null) {
            applicationContext = new PrimeApplicationContext(facesContext);
            setCurrentInstance(applicationContext, facesContext);
        }

        return applicationContext;
    }
A {@link PrimeApplicationContext} is a contextual store for the current application.

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