Package org.ocpsoft.rewrite.event

Examples of org.ocpsoft.rewrite.event.Flow


   @Test
   public void testSubflowRestoresOriginalFlowStateAfterExceptionWithInitializedFlow()
   {
      rewrite.setFlow(ServletRewriteFlow.REDIRECT_PERMANENT);

      Flow result = null;
      try {
         result = SubflowTask.perform(rewrite, new MockEvaluationContext(), ServletRewriteFlow.INCLUDE,
                  new SubflowTask() {

                     @Override
View Full Code Here


    * @return the resultant {@link ServletRewriteFlow} from the {@link SubflowTask} execution.
    */
   public static Flow perform(ServletRewrite<?, ?> event, EvaluationContext context, Flow subflow,
            SubflowTask subflowTask)
   {
      Flow flow = event.getFlow();
      try
      {
         event.setFlow(subflow);
         subflowTask.performInSubflow(event, context);
         return event.getFlow();
View Full Code Here

   @Test
   public void testSubflowRestoresOriginalFlowState()
   {
      rewrite.setFlow(ServletRewriteFlow.REDIRECT_PERMANENT);

      Flow result = SubflowTask.perform(rewrite, new MockEvaluationContext(), new SubflowTask() {

         @Override
         public void performInSubflow(ServletRewrite<?, ?> event, EvaluationContext context)
         {
            Assert.assertEquals(ServletRewriteFlow.REDIRECT_PERMANENT, rewrite.getFlow());
View Full Code Here

   @Test
   public void testSubflowRestoresOriginalFlowStateWithInitializedFlow()
   {
      rewrite.setFlow(ServletRewriteFlow.REDIRECT_PERMANENT);

      Flow result = SubflowTask.perform(rewrite, new MockEvaluationContext(), ServletRewriteFlow.INCLUDE,
               new SubflowTask() {

                  @Override
                  public void performInSubflow(ServletRewrite<?, ?> event, EvaluationContext context)
                  {
View Full Code Here

   @Test
   public void testSubflowRestoresOriginalFlowStateAfterException()
   {
      rewrite.setFlow(ServletRewriteFlow.REDIRECT_PERMANENT);

      Flow result = null;
      try {
         result = SubflowTask.perform(rewrite, new MockEvaluationContext(), new SubflowTask() {

            @Override
            public void performInSubflow(ServletRewrite<?, ?> event, EvaluationContext context)
View Full Code Here

         for (final DeferredOperation deferredOperation : operations) {
            PhaseOperation<?> operation = deferredOperation.getOperation();
            if (operation.getBeforePhases().contains(event.getPhaseId())
                     || operation.getBeforePhases().contains(PhaseId.ANY_PHASE))
            {
               Flow flow = handlePhaseOperation(deferredOperation);

               if (flow.is(ServletRewriteFlow.ABORT_REQUEST))
               {
                  event.getFacesContext().responseComplete();
               }
               if (flow.is(ServletRewriteFlow.HANDLED))
               {
                  break;
               }
            }
         }
View Full Code Here

         for (final DeferredOperation deferredOperation : operations) {
            PhaseOperation<?> operation = deferredOperation.getOperation();
            if (operation.getAfterPhases().contains(event.getPhaseId())
                     || operation.getAfterPhases().contains(PhaseId.ANY_PHASE))
            {
               Flow flow = handlePhaseOperation(deferredOperation);

               if (flow.is(ServletRewriteFlow.ABORT_REQUEST))
               {
                  event.getFacesContext().responseComplete();
               }
               if (flow.is(ServletRewriteFlow.HANDLED))
               {
                  break;
               }
            }
         }
View Full Code Here

      }
   }

   private Flow handlePhaseOperation(final DeferredOperation operation)
   {
      Flow flow = SubflowTask.perform(operation.getEvent(), operation.getContext(), ServletRewriteFlow.UN_HANDLED,
               new SubflowTask() {

                  @Override
                  public void performInSubflow(ServletRewrite<?, ?> rewriteEvent, EvaluationContext context)
                  {
View Full Code Here

TOP

Related Classes of org.ocpsoft.rewrite.event.Flow

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.