001/*
002 * Copyright 2002-2013 the original author or authors.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *      https://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017package org.springframework.context.annotation;
018
019/**
020 * Enumerates the various scoped-proxy options.
021 *
022 * <p>For a more complete discussion of exactly what a scoped proxy is, see the
023 * section of the Spring reference documentation entitled '<em>Scoped beans as
024 * dependencies</em>'.
025 *
026 * @author Mark Fisher
027 * @since 2.5
028 * @see ScopeMetadata
029 */
030public enum ScopedProxyMode {
031
032        /**
033         * Default typically equals {@link #NO}, unless a different default
034         * has been configured at the component-scan instruction level.
035         */
036        DEFAULT,
037
038        /**
039         * Do not create a scoped proxy.
040         * <p>This proxy-mode is not typically useful when used with a
041         * non-singleton scoped instance, which should favor the use of the
042         * {@link #INTERFACES} or {@link #TARGET_CLASS} proxy-modes instead if it
043         * is to be used as a dependency.
044         */
045        NO,
046
047        /**
048         * Create a JDK dynamic proxy implementing <i>all</i> interfaces exposed by
049         * the class of the target object.
050         */
051        INTERFACES,
052
053        /**
054         * Create a class-based proxy (uses CGLIB).
055         */
056        TARGET_CLASS;
057
058}