Package org.jboss.seam.contexts

Examples of org.jboss.seam.contexts.Context


  
   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

   }

   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

      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

public abstract class DigestAuthenticator
{
   @SuppressWarnings("deprecation")
   protected boolean validatePassword(String password)
   {
      Context ctx = Contexts.getSessionContext();
     
      DigestRequest digestRequest = (DigestRequest) ctx.get(DigestRequest.DIGEST_REQUEST);
      if (digestRequest == null)
      {
         throw new IllegalStateException("No digest request found in session scope");
      }
     
      // Remove the digest request from the session now
      ctx.remove(DigestRequest.DIGEST_REQUEST);
     
      // Calculate the expected digest
      String serverDigestMd5 = DigestUtils.generateDigest(
               digestRequest.isPasswordAlreadyEncoded(),
               Identity.instance().getUsername(), digestRequest.getRealm(),
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

      if (component.isPerNestedConversation()) {
         return id;
      }
     
      String name = component.getName();
      Context session = Contexts.getSessionContext();
      String location = id;
      for (int i = 1, len = conversationIdStack.size(); i < len; i++) {
         String cid = conversationIdStack.get(i);
         String key = ScopeType.CONVERSATION.getPrefix() + '#' + cid + '$' + name;
         if (session.get(key) != null) {
            location = cid;
            break;
         }
      }
     
View Full Code Here

  private static final long serialVersionUID = 1L;

  private void doWork(HttpServletRequest request, HttpServletResponse response)
      throws IOException {

    Context context = Contexts.getConversationContext();
    Project project = (Project) context.get("project");

    try {
      ActivityViewListService activityViewListService = (ActivityViewListService) Component
          .getInstance("activityViewListService");
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.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

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.