Package juzu.impl.request

Examples of juzu.impl.request.ContextualParameter


        catch (NoSuchMethodException e) {
          throw new UndeclaredThrowableException(e);
        }

        //
        ContextualParameter argument = new ContextualParameter("argument", Response.Error.class);
        handler = new ControllerHandler<Phase.View>(null, Phase.VIEW, a, m, Collections.<ControlParameter>singletonList(argument));
        request = new Request(this, handler, bridge);
        request.getContextualArguments().put(argument, result);
        result = request.invoke();
      }
View Full Code Here


  @Override
  public Map<ContextualParameter, Object> getContextualArguments(Set<ContextualParameter> parameters) {
    Map<ContextualParameter, Object> args = super.getContextualArguments(parameters);
    for (ContextualParameter parameter : parameters) {
      ContextualParameter contextualParameter = (ContextualParameter)parameter;
      if (Event.class.isAssignableFrom(contextualParameter.getType())) {
        Class payloadType = Introspector.resolveToClass(contextualParameter.getGenericType(), Event.class, 0);
        if (payloadType.isInstance(req.getEvent().getValue())) {
          if (args.isEmpty()) {
            args = new HashMap<ContextualParameter, Object>();
          }
          args.put(parameter, new Event(req.getEvent().getName(), req.getEvent().getValue()));
View Full Code Here

        } else {
          files.put(name, file);
        }
      }
      for (Map.Entry<ContextualParameter, Object> argument : contextualArguments) {
        ContextualParameter contextualParam = argument.getKey();
        FileItem file = files.get(contextualParam.getName());
        if (file != null && FileItem.class.isAssignableFrom(contextualParam.getType())) {
          argument.setValue(file);
        }
      }
    }
    catch (FileUploadException e) {
View Full Code Here

  @Override
  public Response handle(Stage.Handler argument) {
    Request request = argument.getRequest();
    ControllerHandler m = request.getHandler();
    ContextualParameter in = (ContextualParameter)m.getParameter("in");
    request.getContextualArguments().put(in, new ByteArrayInputStream("__foo__".getBytes()));
    return argument.invoke();
  }
View Full Code Here

TOP

Related Classes of juzu.impl.request.ContextualParameter

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.