1 28 29 package com.caucho.jsf.context; 30 31 import javax.faces.*; 32 import javax.faces.application.*; 33 import javax.faces.context.*; 34 import javax.faces.lifecycle.*; 35 36 import javax.servlet.*; 37 import javax.servlet.http.*; 38 39 public class FacesContextFactoryImpl extends FacesContextFactory { 40 private ApplicationFactory _applicationFactory; 41 42 public FacesContext getFacesContext(Object context, 43 Object request, 44 Object response, 45 Lifecycle lifecycle) 46 throws FacesException 47 { 48 return new ServletFacesContextImpl(this, 49 (ServletContext) context, 50 (HttpServletRequest) request, 51 (HttpServletResponse) response); 52 } 53 54 Application getApplication() 55 { 56 synchronized (this) { 57 if (_applicationFactory == null) { 58 _applicationFactory = (ApplicationFactory) 59 FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY); 60 } 61 62 return _applicationFactory.getApplication(); 63 } 64 } 65 66 public String toString() 67 { 68 return "FacesContextFactoryImpl[]"; 69 } 70 } 71 | Popular Tags |