private boolean isExecutingAsynchronousCall() { return Contexts.getEventContext().isSet(AbstractDispatcher.EXECUTING_ASYNCHRONOUS_CALL); }
private Object resolveInContextObject(ELContext context, Context seamContext, Object property) { if (seamContext.isSet((String) property)) { context.setPropertyResolved(true); return seamContext.get((String) property); } else { return null; } }
private boolean isExceptionHandlerRedirect() { return Contexts.getConversationContext().isSet("org.jboss.seam.handledException"); }
/** * Store away the attribute from the event context (if it is set) * * @param names The list of context keys to store away * @param context The context to target */ private void storeOriginalValues(String[] names, Context context) { for (String name : names) { if (context.isSet(name)) { originalValues.put(name, context.get(name)); } } }
public static StandardDeploymentStrategy instance() { if (Contexts.getEventContext().isSet(NAME)) { return (StandardDeploymentStrategy) Contexts.getEventContext().get(NAME); } return null; }
public static HotDeploymentStrategy instance() { if (Contexts.getEventContext().isSet(NAME)) { return (HotDeploymentStrategy) Contexts.getEventContext().get(NAME); } return null; }
public static PagesDotXmlDeploymentHandler instance() { if (Contexts.isEventContextActive()) { if (Contexts.getEventContext().isSet(WarRootDeploymentStrategy.NAME)) { DeploymentStrategy deploymentStrategy = (DeploymentStrategy) Contexts.getEventContext().get(WarRootDeploymentStrategy.NAME); Object deploymentHandler = deploymentStrategy.getDeploymentHandlers().get(NAME); if (deploymentHandler != null) { return (PagesDotXmlDeploymentHandler) deploymentHandler; } } return null; } else { throw new IllegalStateException("Event context not active"); } }
public static DotPageDotXmlDeploymentHandler instance() { if (Contexts.isEventContextActive()) { if (Contexts.getEventContext().isSet(WarRootDeploymentStrategy.NAME)) { DeploymentStrategy deploymentStrategy = (DeploymentStrategy) Contexts.getEventContext().get(WarRootDeploymentStrategy.NAME); Object deploymentHandler = deploymentStrategy.getDeploymentHandlers().get(NAME); if (deploymentHandler != null) { return (DotPageDotXmlDeploymentHandler) deploymentHandler; } } return null; } else { throw new IllegalStateException("Event context not active"); } }
@Override public void sendRedirect(String url) throws IOException { if ( FacesContext.getCurrentInstance() != null && Contexts.isEventContextActive() && !Contexts.getEventContext().isSet(REDIRECT_FROM_MANAGER) ) { if ( !url.startsWith("http:") && !url.startsWith("https:") ) //yew! { String viewId = getViewId(url); if (viewId!=null) { url = Pages.instance().encodePageParameters( FacesContext.getCurrentInstance(), url, viewId ); } if ( Contexts.isConversationContextActive() ) { url = FacesManager.instance().appendConversationIdFromRedirectFilter(url, viewId); } } } super.sendRedirect(url); } };
/** * Restore the page and conversation contexts during a JSF request */ protected void afterRestoreView(FacesContext facesContext) { boolean conversationFound = Contexts.isPageContextActive() ? Contexts.getPageContext().isSet("org.jboss.seam.jsf.SeamPhaseListener.conversationFound") : false; FacesLifecycle.resumePage(); Map parameters = facesContext.getExternalContext().getRequestParameterMap(); if (!conversationFound) // there is exceptional case when restoring of conversation wasn't called while page context was lazily initialized { ConversationPropagation.instance().restoreConversationId(parameters); conversationFound = Manager.instance().restoreConversation(); } FacesLifecycle.resumeConversation( facesContext.getExternalContext() ); postRestorePage(facesContext, parameters, conversationFound); }
if ( isRequired() && !Contexts.getPageContext().isSet( getName() ) )
(!isExecutingAsynchronousCall() || Contexts.getEventContext().isSet(REENTRANT)); if (scheduleAsync)
/** * Will attempt to authenticate quietly if the user's credentials are set and they haven't * authenticated already. A quiet authentication doesn't throw any exceptions if authentication * fails. * * @return true if the user is logged in, false otherwise */ public boolean tryLogin() { if (!authenticating && getPrincipal() == null && credentials.isSet() && Contexts.isEventContextActive() && !Contexts.getEventContext().isSet(LOGIN_TRIED)) { Contexts.getEventContext().set(LOGIN_TRIED, true); quietLogin(); } return isLoggedIn(); }
/** * Startup a component and all its dependencies */ static void startup(Component component) { if ( component.isStartup() ) { for ( String dependency: component.getDependencies() ) { Component dependentComponent = Component.forName(dependency); if (dependentComponent!=null) { startup(dependentComponent); } } } if ( !component.getScope().getContext().isSet( component.getName() ) ) { log.debug( "starting up: " + component.getName() ); component.newInstance(); } }
/** * Post-authentication event observer */ @Observer(Identity.EVENT_POST_AUTHENTICATE) public void setUserAccountInSecurityContext() { if (getSecurityContext() != null) { getSecurityContext().insert(Identity.instance().getPrincipal()); // If we were authenticated with the JpaIdentityStore, then insert the authenticated // UserAccount into the security context. if (Contexts.isEventContextActive() && Contexts.isSessionContextActive() && Contexts.getEventContext().isSet(JpaIdentityStore.AUTHENTICATED_USER)) { getSecurityContext().insert(Contexts.getEventContext().get(JpaIdentityStore.AUTHENTICATED_USER)); } } } }
if (Contexts.isEventContextActive() && Contexts.getEventContext().isSet(SILENT_LOGIN))
if ( !context.isSet(compName) )