/**
 * Licensed to Jasig under one or more contributor license
 * agreements. See the NOTICE file distributed with this work
 * for additional information regarding copyright ownership.
 * Jasig licenses this file to you under the Apache License,
 * Version 2.0 (the "License"); you may not use this file
 * except in compliance with the License. You may obtain a
 * copy of the License at:
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on
 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

package org.jasig.portal.rendering;

import com.google.common.base.Predicate;
import org.springframework.beans.factory.annotation.Required;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * A Rendering Pipeline that proceeds down one of two branches depending upon a Predicate.
 *
 * If the Predicate returns true, proceed down the true branch.
 * If the Predicate returns false, proceed down the false branch.
 *
 * @since uPortal 4.2
 */
public class BranchingRenderingPipeline
    implements IPortalRenderingPipeline {

    // dependency-injected
    private Predicate<HttpServletRequest> predicate;

    // dependency-injected
    private IPortalRenderingPipeline truePipe;

    // dependency-injected
    private IPortalRenderingPipeline falsePipe;


    @Override
    public void renderState(final HttpServletRequest request, final HttpServletResponse response)
            throws ServletException, IOException {

        // render either the true or false pipe, depending on the trueness or falseness of the predicate

        if (predicate.apply(request)) {
            truePipe.renderState(request, response);
        } else {
            falsePipe.renderState(request, response);
        }

    }

    @Required
    public void setPredicate(Predicate<HttpServletRequest> predicate) {
        this.predicate = predicate;
    }

    @Required
    public void setTruePipe(IPortalRenderingPipeline truePipe) {
        this.truePipe = truePipe;
    }

    @Required
    public void setFalsePipe(IPortalRenderingPipeline falsePipe) {
        this.falsePipe = falsePipe;
    }
}

@@ -843,16 +843,73 @@
 dicate;%0A
+import org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A
 import o
@@ -1460,24 +1460,98 @@
 Pipeline %7B%0A%0A
+    protected final Logger logger = LoggerFactory.getLogger(getClass());%0A%0A
     // depen
@@ -2097,65 +2097,180 @@
     
-truePipe.renderState(request, response);%0A        %7D else %7B
+logger.trace(%22Branching to the true pipe.%22);%0A            truePipe.renderState(request, response);%0A        %7D else %7B%0A            logger.trace(%22Branching to the false pipe.%22);
 %0A   

Add logging in BranchingRenderingPipeline.