Package org.jboss.seam.contexts

Examples of org.jboss.seam.contexts.Context


      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


  
   static void cache(FacesContext context)
   {
      Map convCache = convCache(context);
     
      Context convContext = Contexts.getConversationContext();
      if (convContext == null) return;
     
      String[] names = convContext.getNames();
      for (int i=0; i < names.length; i++)
      {
         convCache.put(names[i], convContext.get(names[i]));
      }
   }
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

   {}

   private void installComponents(Init init)
   {
      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);

              if ( componentDescriptor.isAutoCreate() )
              {
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);

      if (identity == null)
      {
         throw new ServletException("Identity not found - please ensure that the Identity component is created on startup.");
      }
     
      Credentials credentials = (Credentials) ctx.get(Credentials.class);
     
      boolean requireAuth = false;
     
      String header = request.getHeader("Authorization");
      if (header != null && header.startsWith("Basic "))
View Full Code Here

   private void processDigestAuth(HttpServletRequest request,
            HttpServletResponse response, FilterChain chain)
      throws IOException, ServletException
   {
      Context ctx = new SessionContext( new ServletRequestSessionMap(request) );
      Identity identity = (Identity) ctx.get(Identity.class);
     
      if (identity == null)
      {
         throw new ServletException("Identity not found - please ensure that the Identity component is created on startup.");
      }     
     
      Credentials credentials = (Credentials) ctx.get(Credentials.class);
     
      boolean requireAuth = false;   
      boolean nonceExpired = false;
     
      String header = request.getHeader("Authorization");     
View Full Code Here

  }

  @SuppressWarnings ("unchecked")
  private Map<String, Boolean> getShowContentValues()
  {
    Context conversationContext = Contexts.getConversationContext();
    if (conversationContext == null)
      return null;

    return (Map<String, Boolean>)conversationContext.get(SHOW_CONTENT);
  }
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 installComponents(Init init)
   {
      log.debug("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);

              if ( componentDescriptor.isAutoCreate() )
              {
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

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.