1 /* 2 * Copyright 2009 University Corporation for Advanced Internet Development, Inc. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package org.opensaml.ws.message; 18 19 20 /** 21 * An interface for components which evaluate a message context as the basis for extracting, calculating, 22 * or otherwise producing a specific data value. 23 * 24 * <p> 25 * Implementations should not have side effects and should not modify any data in the 26 * underlying message context. For a component that is intended to allow message context 27 * modification, see {@link MessageContextMutatingFunctor}. 28 * </p> 29 * 30 * @param <T> the type of product of the component 31 */ 32 public interface MessageContextEvaluatingFunctor<T> { 33 34 /** 35 * Using the specified MessageContext as the evaluation context, 36 * produce a data value product of the appropriate type. 37 * 38 * @param msgContext the message context to evaluate 39 * @return value product based on the message context, or null 40 * 41 * @throws MessageException if there is a fatal error evaluating the context 42 */ 43 public T evaluate(MessageContext msgContext) throws MessageException; 44 45 }