Refine search
@Override public Application getApplication() { return delegate().getApplication(); }
@Override public void setApplication(Application application) { delegate().setApplication(application); }
protected static Application getApplication() { FacesContext context = FacesContext.getCurrentInstance(); if (context != null) { return (FacesContext.getCurrentInstance().getApplication()); } ApplicationFactory afactory = (ApplicationFactory) FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY); return (afactory.getApplication()); }
private void configureApplication() Application application = ((ApplicationFactory) FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY)).getApplication(); application.setActionListener(ClassUtils.buildApplicationObject(ActionListener.class, dispenser.getActionListenerIterator(), null)); application.setDefaultLocale(LocaleUtils.toLocale(dispenser.getDefaultLocale())); application.setDefaultRenderKitId(dispenser.getDefaultRenderKitId());
public void handle() throws FacesException { boolean sessionExpired = false; final FacesContext fc = FacesContext.getCurrentInstance(); final ExternalContext ec = fc.getExternalContext(); final Iterator<ExceptionQueuedEvent> exceptionQueuedEventIterator = getUnhandledExceptionQueuedEvents().iterator(); if (exceptionQueuedEventIterator.hasNext()) { Throwable ex = queueContext.getException(); if (fc.isProjectStage(ProjectStage.Development)) { log.log(Level.WARNING, "queued exception", ex); ApplicationFactory factory = (ApplicationFactory) FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY); app = factory.getApplication(); app.publishEvent(fc, ExceptionQueuedEvent.class, ctxt);
@Override public void encodeMarkupEnd(FacesContext facesContext, UIComponent uiComponent) throws IOException { ResponseWriter responseWriter = facesContext.getResponseWriter(); String clientId = uiComponent.getClientId(facesContext); String inputClientId = clientId.concat(INPUT_SUFFIX); BrowserSnifferFactory browserSnifferFactory = (BrowserSnifferFactory) FactoryExtensionFinder.getFactory( BrowserSnifferFactory.class); BrowserSniffer browserSniffer = browserSnifferFactory.getBrowserSniffer(facesContext.getExternalContext()); InputDateTime inputDateTime = (InputDateTime) uiComponent; InputDateTimeResponseWriter inputDateTimeResponseWriter = getInputDateTimeResponseWriter(responseWriter, ApplicationFactory applicationFactory = (ApplicationFactory) FactoryFinder.getFactory( FactoryFinder.APPLICATION_FACTORY); Application application = applicationFactory.getApplication(); Icon icon = (Icon) application.createComponent(Icon.COMPONENT_TYPE); String buttonIconName = getButtonIconName(); icon.setName(buttonIconName); Button button = (Button) application.createComponent(Button.COMPONENT_TYPE); List<UIComponent> buttonChildren = button.getChildren(); buttonChildren.add(icon);
try { facesContextFactory = (FacesContextFactory) FactoryFinder .getFactory(FactoryFinder.FACES_CONTEXT_FACTORY); } catch (Exception ex) { log.debug("Unable to initialize faces", ex); .getFactory(FactoryFinder.LIFECYCLE_FACTORY); lifecycle = lifecycleFactory.getLifecycle(lifecycleId); .getFactory(FactoryFinder.APPLICATION_FACTORY)) .getApplication(); .setActionListener((ActionListener) getApplicationObject( ActionListener.class, i, application .getActionListener())); application.setDefaultRenderKitId(defaultRenderKitId);
private void processPostConstructApplicationEvent(PostConstructApplicationEvent event) { ApplicationFactory factory = (ApplicationFactory) FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY); SpringApplication application = new SpringApplication(event.getApplication()); factory.setApplication(application); SpringFacesIntegration.postConstructApplicationEvent(FacesContext.getCurrentInstance().getExternalContext(), application); } }
private void configureApplication() Application application = ((ApplicationFactory) FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY)) .getApplication(); FacesConfigDispenser dispenser = getDispenser(); application.setActionListener((ActionListener) getApplicationObject(ActionListener.class, dispenser .getActionListenerIterator(), null)); application.setDefaultLocale(LocaleUtils.toLocale(dispenser.getDefaultLocale())); application.setDefaultRenderKitId(dispenser.getDefaultRenderKitId());
protected ExpressionFactory getExpressionFactory() { if (expressionFactory == null) { ApplicationFactory appFactory = (ApplicationFactory) FactoryFinder .getFactory(FactoryFinder.APPLICATION_FACTORY); expressionFactory = appFactory.getApplication().getExpressionFactory(); } return expressionFactory; }
(ApplicationFactory) FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY); Application application = appFactory.getApplication(); ViewHandler viewHandler = application.getViewHandler(); ServletFacesContextImpl facesContext = (ServletFacesContextImpl) facesContext(request, response); facesContext.setExternalContext(makeExternalContext(request, response));
/** * This method follows JSF Spec section 2.1.1. It renders a view from a non-faces * request. This is useful for a default view as well as for views that need to * be rendered from the portlet's edit and help buttons. * * @param request The portlet render request. * @param response The portlet render response. * @param view The name of the view that needs to be rendered. */ protected void nonFacesRequest(RenderRequest request, RenderResponse response, String view) throws PortletException { if (log.isTraceEnabled()) log.trace("Non-faces request: contextPath = " + request.getContextPath()); setContentType(request, response); // do this in case nonFacesRequest is called by a subclass ApplicationFactory appFactory = (ApplicationFactory)FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY); Application application = appFactory.getApplication(); ViewHandler viewHandler = application.getViewHandler(); FacesContext facesContext = facesContext(request, response); UIViewRoot viewRoot = viewHandler.createView(facesContext, view); viewRoot.setViewId(view); facesContext.setViewRoot(viewRoot); lifecycle.render(facesContext); }
FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY); Application app = factory.getApplication(); if (app.getProjectStage() != ProjectStage.UnitTest && !reloaded) { throw e;
private FacesContextImpl(ReleaseableExternalContext externalContext) { _application = ((ApplicationFactory)FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY)) .getApplication(); _renderKitFactory = (RenderKitFactory) FactoryFinder.getFactory(FactoryFinder.RENDER_KIT_FACTORY); _externalContext = externalContext; FacesContext.setCurrentInstance(this); //protected method, therefore must be called from here }
/** * Setup this test class instance * Must be run for each test class instance (e.g. @BeforeClass) * @throws Exception */ protected void setupClass() throws Exception { servletContext = ServletLifecycle.getServletContext(); // FactoryFinder cannot be reliably used, as something could have called getFactory sooner applicationFactory = (ApplicationFactory) FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY); //applicationFactory = new MockApplicationFactory(); application = applicationFactory.getApplication(); conversationViewRootAttributes = new HashMap<String, Map>(); seamFilter = createSeamFilter(); FactoryFinder.setFactory(FactoryFinder.FACES_CONTEXT_FACTORY, MockFacesContextFactory.class.getName()); for (ELResolver elResolver : getELResolvers()) { application.addELResolver(elResolver); } }
public MockFacesContext(ExternalContext externalContext) { application = ((ApplicationFactory) FactoryFinder .getFactory(FactoryFinder.APPLICATION_FACTORY)).getApplication(); renderKitFactory = (RenderKitFactory) FactoryFinder .getFactory(FactoryFinder.RENDER_KIT_FACTORY); this.externalContext = externalContext; }
public void destroy() { if (!mInitialized) // do nothing if destroy an uninitialzed bridge return; mInitialized = false; // Remove the context listener ((ApplicationFactory)FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY)) .getApplication().removeELContextListener(this); // remove any scopes being managed for this portlet // Each scope has a per portlet prefix -- pass in the prefix // constructed by adding the prefix to an empty string. removeRequestScopes(qualifyScopeId(mPortletConfig.getPortletName(), null, null, null)); mPortletConfig = null; }
public Application getApplication() { Application app = delegate.getApplication(); // Ensure that FlowViewStateManager is first in the chain if (app.getStateManager() != null && !(app.getStateManager() instanceof FlowViewStateManager)) { FlowViewStateManager sm = new FlowViewStateManager(app.getStateManager()); app.setStateManager(sm); } return app; }
((ApplicationFactory)FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY)) .getApplication().addELContextListener(this);
@Override public void contextInitialized(ServletContextEvent sce) { // get JSF application factory ApplicationFactory applicationFactory = (ApplicationFactory) FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY); Application application = applicationFactory.getApplication(); ActionListener defaultActionListener = application.getActionListener(); // create proxy for the default actionlistener ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader(); ActionListenerInvocationHandler actionListenerInvocationHandler = new ActionListenerInvocationHandler(defaultActionListener); @SuppressWarnings("rawtypes") Class[] interfaces = new Class[] { ActionListener.class }; ActionListener actionListenerProxy = (ActionListener) Proxy.newProxyInstance(contextClassLoader, interfaces, actionListenerInvocationHandler); // set proxied actionListener as new default actionlistener application.setActionListener(actionListenerProxy); }