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.filter.mgt.FilterChainResolver;
022import org.apache.shiro.web.mgt.WebSecurityManager;
023
024import javax.servlet.ServletContext;
025
026/**
027 * A {@code WebEnvironment} that supports 'write' operations operations.  This mainly exists to shield
028 * {@code WebEnvironment} API consumers from modification operations, which are mostly only used during Shiro
029 * environment initialization.
030 *
031 * @since 1.2
032 */
033public interface MutableWebEnvironment extends WebEnvironment {
034
035    /**
036     * Sets the {@code WebEnvironment}'s {@link FilterChainResolver}.
037     *
038     * @param filterChainResolver the {@code WebEnvironment}'s {@link FilterChainResolver}.
039     */
040    void setFilterChainResolver(FilterChainResolver filterChainResolver);
041
042    /**
043     * Sets the {@link WebEnvironment}'s associated {@code ServletContext} instance.  Invoking this method merely
044     * makes the {@code ServletContext} available to the underlying instance - it does not trigger initialization
045     * behavior.
046     *
047     * @param servletContext the {@link WebEnvironment}'s associated {@code ServletContext} instance.
048     */
049    void setServletContext(ServletContext servletContext);
050
051    /**
052     * Sets the {@code WebEnvironment}'s {@link WebSecurityManager}.
053     *
054     * @param webSecurityManager the {@code WebEnvironment}'s {@link WebSecurityManager}.
055     */
056    void setWebSecurityManager(WebSecurityManager webSecurityManager);
057}