Package juzu

Examples of juzu.Response$Body


    sourceDesc.getSources().add(source);
    fileDesc.setSourceDesc(sourceDesc);   
    meiHead.setFileDesc(fileDesc)
    mei.setMeiHead(meiHead);
    Music music = new Music();
    Body body = new Body();
    Mdiv mdiv = new Mdiv();
    Score score = new Score();
    ScoreDef scoreDef = createScoreDef(stavesCount);
    score.getGapsAndSbsAndCorrs().add(scoreDef);
    Section section = new Section();
    Measure measureFirst = new Measure();
    Staff staffFirst = new Staff();
    Layer layerFirst = new Layer();
    staffFirst.getSbsAndSymbolsAndOrigs().add(layerFirst);
    measureFirst.getAnnotsAndSlursAndTupletSpen().add(staffFirst);
    for (int stavesIter = 1; stavesIter < stavesCount; stavesIter++) {
      Staff staff = new Staff();
      Layer layer = new Layer();
      staff.getSbsAndSymbolsAndOrigs().add(layer);
      measureFirst.getAnnotsAndSlursAndTupletSpen().add(staff);
    }
    section.getUnclearsAndSbsAndApps().add(measureFirst);

    for (int measureIter = 1; measureIter < measureCount; measureIter++) {
      Measure measure = new Measure();
      for (int stavesIter = 0; stavesIter < stavesCount; stavesIter++) {
        Staff staff = new Staff();
        Layer layer = new Layer();
        staff.getSbsAndSymbolsAndOrigs().add(layer);
        measure.getAnnotsAndSlursAndTupletSpen().add(staff);
      }
      section.getUnclearsAndSbsAndApps().add(measure);
    }
    score.getGapsAndSbsAndCorrs().add(section);
    mdiv.setScore(score);
    body.getMdivs().add(mdiv);
    music.setBody(body);
    mei.setMusic(music);
    mei.setId(DEFAULT_MEI_TREE);
    return mei;
  }
View Full Code Here


    this.rememberMeSupported = rememberMeSupported;
  }

  public Response doLogout(Stage.Handler request) {
    SecurityUtils.getSubject().logout();
    Response resp = request.invoke();
    if (rememberMeSupported) {
      RememberMeUtil.forgetIdentity();
    }
    return resp;
  }
View Full Code Here

    try {
      subject.login(new UsernamePasswordToken(username, password.toCharArray(), remember));

      //
      Response resp = stage.invoke();
      if (remember && rememberMeSupported) {
        RememberMeUtil.forgetIdentity();
        RememberMeUtil.rememberSerialized();
      }
      return resp;
    } catch (AuthenticationException e) {
      List<ControlParameter> parameters = request.getHandler().getParameters();
      for (ControlParameter parameter : parameters) {
        if (parameter instanceof ContextualParameter) {
          if (AuthenticationException.class.isAssignableFrom(parameter.getType())) {
            request.getContextualArguments().put((ContextualParameter)parameter, e);
            Response resp = stage.invoke();
            if (remember) {
              RememberMeUtil.forgetIdentity();
            }
            return resp;
          }
View Full Code Here

    //
    JSON methodsJSON = controllerJSON.getJSON("methods");
    JSON methodJSON;

    if (controllerJSON.get("require") != null) {
      Response resp = authorizer.isAuthorized(stage, controllerJSON);
      if (resp != null) {
        return resp;
      } else {
        if (methodsJSON == null) {
          return stage.invoke();
View Full Code Here

    return doInvoke(stage, methodJSON);
  }

  private Response doInvoke(Stage.Handler request, JSON json) {
    Response resp = authorizer.isAuthorized(request, json);
    if (resp != null) {
      return resp;
    } else {
      if ("login".equals(json.get("operator"))) {
        return authenticater.doLogin(request);
View Full Code Here

  public void beginRequest(RequestContext context) {
  }

  @Override
  public void endRequest(RequestContext context) {
      Response response = context.getResponse();
      if (response instanceof ValidationError) {
        ValidationError error = (ValidationError)response;
        String id = context.getParameters().get("id").getValue();
       
        Iterator<ConstraintViolation<Object>> v = error.getViolations().iterator();
View Full Code Here

  public void beginRequest(RequestContext context) {   
  }

  @Override
  public void endRequest(RequestContext context) {
      Response response = context.getResponse();
      if (response instanceof ValidationError) {
        ValidationError error = (ValidationError)response;       
        violation.add(Violation.REGISTER, error.getHtmlMessage());
       
        context.setResponse(Application_.register());
View Full Code Here

  }

  @Override
  public Response handle(Stage.Unmarshalling argument) {
    final Request request = argument.getRequest();
    Response result = argument.invoke();

    //
    if (request.getPhase() == Phase.VIEW) {
      if (result instanceof Response.Content) {
        Response.Status status = (Response.Status)result;
View Full Code Here

    return Stage.Unmarshalling.class;
  }

  @Override
  public Response handle(Stage.Unmarshalling argument) {
    Response result = argument.invoke();
    Request request = argument.getRequest();
    if (request.getPhase() == Phase.VIEW) {
      if (result instanceof Response.Content) {
        final Collection<Chunk.Property<String>> bar = foo(request.getHandler().getMethod(), Collections.<Chunk.Property<String>>emptyList());
        Response.Status status = (Response.Status)result;
View Full Code Here

          return new Response.Error(e);
        }
      }

      //
      Response response = context.getResponse();
      if (response == null) {
        Stage.Invoke invokeStage = new Invoke(request, context, controller, args);
        response = invokeStage.invoke();
        context.setResponse(response);
View Full Code Here

TOP

Related Classes of juzu.Response$Body

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.