Package org.jboss.seam.contexts

Examples of org.jboss.seam.contexts.Context


   private static final long serialVersionUID = 6833040683938889232L;
   @AroundInvoke
   public Object aroundInvoke(InvocationContext ctx) throws Exception
   {
      String name = getComponent().getName();
      Context outerMethodContext = Lifecycle.beginMethod();
      try
      {
         Contexts.getMethodContext().set( name, ctx.getTarget() );
         return ctx.proceed();
      }
View Full Code Here


      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 || scope==PAGE ||
            wrapper.isDirty(dataModelAnn, existingDataModel, list);
     
      if (dirty)
      {
         if ( list!=null )
         {
            context.set( name, wrapper.wrap(dataModelAnn, list) );
         }
         else
         {
            context.remove(name);
         }
      }
   }
View Full Code Here

      }
   }

   public void init(FilterConfig filterConfig) throws ServletException
   {
      Context tempApplicationContext = new WebApplicationContext( filterConfig.getServletContext() );
      Init init = (Init) tempApplicationContext.get(Init.class);
      for ( String filterName: init.getInstalledFilters() )
      {
         Filter filter = (Filter) tempApplicationContext.get(filterName);
         log.info( "Initializing filter: " + filterName );
         filter.init(filterConfig);
         filters.add(filter);
      }
   }
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

   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

      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

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.