Package org.jboss.seam.contexts

Examples of org.jboss.seam.contexts.Context


   }

   private void installComponents(Init init, RedeployableStrategy redeployStrategy)
   {
      log.info("Installing components...");
      Context context = Contexts.getApplicationContext();

      DependencyManager manager = new DependencyManager(componentDescriptors);

      Set<ComponentDescriptor> installable = manager.installedSet();     
      for (ComponentDescriptor componentDescriptor: installable)
      {
          String compName = componentDescriptor.getName() + COMPONENT_SUFFIX;

          if ( !context.isSet(compName) )
          {
              addComponent(componentDescriptor, context, redeployStrategy);

              if ( componentDescriptor.isAutoCreate() )
              {
View Full Code Here


      loadResourceProviders();
   }

   protected void loadResourceProviders()
   {
      Context tempApplicationContext = new ApplicationContext( new ServletApplicationMap(context) );

      Init init = (Init) tempApplicationContext.get(Init.class);
      for (String name : init.getResourceProviders())
      {
         AbstractResource provider = (AbstractResource) tempApplicationContext.get(name);
         if (provider != null)
         {
            provider.setServletContext(context);
            providers.put( provider.getResourcePath(), provider );
         }
View Full Code Here

   protected void beforeRenderResponse(FacesContext facesContext)
   { 
     
      if ( Contexts.isPageContextActive() )
      {
         Context pageContext = Contexts.getPageContext();
         //after every time that the view may have changed,
         //we need to flush the page context, since the
         //attribute map is being discarder
         pageContext.flush();
         //force refresh of the conversation lists (they are kept in PAGE context)
         pageContext.remove(Seam.getComponentName(Switcher.class));
         pageContext.remove("org.jboss.seam.core.conversationList");
         pageContext.remove("org.jboss.seam.core.conversationStack");
      }
     
      preRenderPage(facesContext);
     
      if ( facesContext.getResponseComplete() )
View Full Code Here

      }
   }

   private Object resolveInContextObject(ELContext context, Object base, Object property)
   {
      Context seamContext = (Context) base;
      if ( seamContext.isSet( (String) property ) )
      {
         context.setPropertyResolved(true);
         return seamContext.get( (String) property );
      }
      else
      {
         return null;
      }
View Full Code Here

      DataBinder wrapper = createWrapper( dataModelGetter.getAnnotation() );
      Object list = dataModelGetter.get(bean);
      String name = dataModelGetter.getName();
      Annotation dataModelAnn = dataModelGetter.getAnnotation();
      ScopeType scope = wrapper.getVariableScope(dataModelAnn);     
      Context context = getOutScope(scope, this).getContext();
      Object existingDataModel = context.get(name);
     
      boolean dirty = existingDataModel == null ||
            wrapper.isDirty(dataModelAnn, existingDataModel, list);
      boolean reoutject = existingDataModel!=null && scope==PAGE;
     
      if (dirty)
      {
         if ( list!=null )
         {
            context.set( name, wrapper.wrap(dataModelAnn, list) );
         }
         else
         {
            context.remove(name);
         }
      }
      else if (reoutject)
      {
         context.set(name, existingDataModel);
      }
        
   }
View Full Code Here

   protected void beforeRenderResponse(FacesContext facesContext)
   { 
     
      if ( Contexts.isPageContextActive() )
      {
         Context pageContext = Contexts.getPageContext();
         //after every time that the view may have changed,
         //we need to flush the page context, since the
         //attribute map is being discarder
         pageContext.flush();
         //force refresh of the conversation lists (they are kept in PAGE context)
         pageContext.remove(Seam.getComponentName(Switcher.class));
         pageContext.remove("org.jboss.seam.core.conversationList");
         pageContext.remove("org.jboss.seam.core.conversationStack");
      }
     
      preRenderPage(facesContext);
     
      if ( facesContext.getResponseComplete() )
View Full Code Here

  
   private void processBasicAuth(HttpServletRequest request,
            HttpServletResponse response, FilterChain chain)
      throws IOException, ServletException
   {
      Context ctx = new SessionContext( new ServletRequestSessionMap(request) );
      Identity identity = (Identity) ctx.get(Identity.class);
     
      boolean requireAuth = false;
     
      String header = request.getHeader("Authorization");
      if (header != null && header.startsWith("Basic "))
View Full Code Here

      Component comp = getComponent();
      String name = comp.getName();
      Object target = ctx.getTarget();
      Method method = ctx.getMethod();
      Object[] parameters = ctx.getParameters();
      Context outerMethodContext = Lifecycle.beginMethod();
      try
      {
         Contexts.getMethodContext().set(name, target);
         Contexts.getMethodContext().set("org.jboss.seam.this", target);
         Contexts.getMethodContext().set("org.jboss.seam.method", method);
View Full Code Here

   *
   * @return Set
   */
  public Set getUserTokens()
  {
    Context session = Contexts.getSessionContext();
    if (session.get(CONTEXT_USER_TOKENS) == null)
    {
      synchronized(session)
      {
        if (session.get(CONTEXT_USER_TOKENS) == null)
          session.set(CONTEXT_USER_TOKENS, new HashSet<String> ());
      }
    }
    return (Set) session.get(CONTEXT_USER_TOKENS);
  }
View Full Code Here

    viewIdMap.put("edit", "/foo.xml");
    portletContext.setAttribute(Bridge.BRIDGE_PACKAGE_PREFIX + portletConfig.getPortletName() +"."+ Bridge.DEFAULT_VIEWID_MAP, viewIdMap);

        portletBridge = new AjaxPortletBridge();
        portletBridge.init(portletConfig);
         Context appContext = new ApplicationContext( externalContext.getApplicationMap() );
         installComponents(appContext);
   }
View Full Code Here

TOP

Related Classes of org.jboss.seam.contexts.Context

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.