001/*
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements.  See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership.  The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License.  You may obtain a copy of the License at
009 *
010 *     http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing,
013 * software distributed under the License is distributed on an
014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 * KIND, either express or implied.  See the License for the
016 * specific language governing permissions and limitations
017 * under the License.
018 */
019package org.apache.shiro.web.env;
020
021import org.apache.shiro.web.config.ShiroFilterConfiguration;
022import org.apache.shiro.web.filter.mgt.FilterChainResolver;
023import org.apache.shiro.web.mgt.WebSecurityManager;
024
025import javax.servlet.ServletContext;
026
027/**
028 * A {@code WebEnvironment} that supports 'write' operations operations.  This mainly exists to shield
029 * {@code WebEnvironment} API consumers from modification operations, which are mostly only used during Shiro
030 * environment initialization.
031 *
032 * @since 1.2
033 */
034public interface MutableWebEnvironment extends WebEnvironment {
035
036    /**
037     * Sets the {@code WebEnvironment}'s {@link FilterChainResolver}.
038     *
039     * @param filterChainResolver the {@code WebEnvironment}'s {@link FilterChainResolver}.
040     */
041    void setFilterChainResolver(FilterChainResolver filterChainResolver);
042
043    /**
044     * Sets the {@link WebEnvironment}'s associated {@code ServletContext} instance.  Invoking this method merely
045     * makes the {@code ServletContext} available to the underlying instance - it does not trigger initialization
046     * behavior.
047     *
048     * @param servletContext the {@link WebEnvironment}'s associated {@code ServletContext} instance.
049     */
050    void setServletContext(ServletContext servletContext);
051
052    /**
053     * Sets the {@code WebEnvironment}'s {@link WebSecurityManager}.
054     *
055     * @param webSecurityManager the {@code WebEnvironment}'s {@link WebSecurityManager}.
056     */
057    void setWebSecurityManager(WebSecurityManager webSecurityManager);
058
059    /**
060     * Sets the {@code WebEnvironment}'s {@link ShiroFilterConfiguration}.
061     *
062     * @param filterConfiguration the {@code WebEnvironment}'s {@link ShiroFilterConfiguration}.
063     */
064    void setShiroFilterConfiguration(ShiroFilterConfiguration filterConfiguration);
065}