01: /*
02: * Copyright 2002-2007 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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.springframework.context.annotation;
18:
19: import org.springframework.beans.factory.config.BeanDefinition;
20:
21: /**
22: * Describes scope characteristics for a Spring-managed bean including the scope
23: * name and the scoped-proxy behavior.
24: *
25: * <p>The default scope is "singleton", and the default is to <i>not</i> create
26: * scoped-proxies.
27: *
28: * @author Mark Fisher
29: * @since 2.5
30: * @see ScopeMetadataResolver
31: * @see ScopedProxyMode
32: */
33: public class ScopeMetadata {
34:
35: private String scopeName = BeanDefinition.SCOPE_SINGLETON;
36:
37: private ScopedProxyMode scopedProxyMode = ScopedProxyMode.NO;
38:
39: /**
40: * Get the name of the scope.
41: * @return said scope name
42: */
43: public String getScopeName() {
44: return scopeName;
45: }
46:
47: /**
48: * Set the name of the scope.
49: * @param scopeName said scope name
50: */
51: public void setScopeName(String scopeName) {
52: this .scopeName = scopeName;
53: }
54:
55: /**
56: * Get the proxy-mode to be applied to the scoped instance.
57: * @return said scoped-proxy mode
58: */
59: public ScopedProxyMode getScopedProxyMode() {
60: return scopedProxyMode;
61: }
62:
63: /**
64: * Set the proxy-mode to be applied to the scoped instance.
65: * @param scopedProxyMode said scoped-proxy mode
66: */
67: public void setScopedProxyMode(ScopedProxyMode scopedProxyMode) {
68: this.scopedProxyMode = scopedProxyMode;
69: }
70:
71: }
|