001package org.apache.turbine.pipeline;
002
003import java.util.Map;
004
005
006/*
007 * Licensed to the Apache Software Foundation (ASF) under one
008 * or more contributor license agreements.  See the NOTICE file
009 * distributed with this work for additional information
010 * regarding copyright ownership.  The ASF licenses this file
011 * to you under the Apache License, Version 2.0 (the
012 * "License"); you may not use this file except in compliance
013 * with the License.  You may obtain a copy of the License at
014 *
015 *   http://www.apache.org/licenses/LICENSE-2.0
016 *
017 * Unless required by applicable law or agreed to in writing,
018 * software distributed under the License is distributed on an
019 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
020 * KIND, either express or implied.  See the License for the
021 * specific language governing permissions and limitations
022 * under the License.
023 */
024
025
026/**
027 * <p>A <b>PipelineData</b> is a holder for data being passed from one
028 * Valve to the next.
029 * The detailed contract for a Valve is included in the description of
030 * the <code>invoke()</code> method below.</p>
031 *
032 * <b>HISTORICAL NOTE</b>:  The "PipelineData" name was assigned to this
033 * holder as it functions similarly to the RunData object, but without
034 * the additional methods
035 *
036 * @author <a href="mailto:epugh@opensourceconnections.com">Eric Pugh</a>
037 * @author <a href="mailto:peter@courcoux.biz">Peter Courcoux</a>
038 */
039public interface PipelineData
040{
041    /**
042     * Put a configured map of objects into the pipeline data object
043     *
044     * @param name the key class
045     * @param value the value map
046     */
047    public void put(Class<?> name, Map<Class<?>, ? super Object> value);
048
049    /**
050     * Get the configured map of objects for the given key
051     *
052     * @param name the key class
053     * @return the value map or null if no such key exists
054     */
055    public Map<Class<?>, ? super Object> get(Class<?> name);
056
057    /**
058     * Get a value from the configured map of objects for the given keys
059     *
060     * @param key the key class
061     * @param innerKey the key into the value map
062     *
063     * @param <T> the type of the inner key
064     *
065     * @return the inner value or null if no such keys exist
066     */
067    public <T> T get(Class<?> key, Class<T> innerKey);
068}