Skip to content

Commit 0449f6c

Browse files
committed
Polish @scope Javadoc
1 parent 34798a4 commit 0449f6c

File tree

1 file changed

+14
-6
lines changed
  • org.springframework.context/src/main/java/org/springframework/context/annotation

1 file changed

+14
-6
lines changed

org.springframework.context/src/main/java/org/springframework/context/annotation/Scope.java

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2009 the original author or authors.
2+
* Copyright 2002-2011 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -22,7 +22,7 @@
2222
import java.lang.annotation.RetentionPolicy;
2323
import java.lang.annotation.Target;
2424

25-
import org.springframework.beans.factory.config.BeanDefinition;
25+
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
2626
import org.springframework.stereotype.Component;
2727

2828
/**
@@ -35,8 +35,13 @@
3535
* the instance returned from the method.
3636
*
3737
* <p>In this context, scope means the lifecycle of an instance, such as
38-
* {@code singleton}, {@code prototype}, and so forth.
39-
*
38+
* {@code singleton}, {@code prototype}, and so forth. Scopes provided out of the box in
39+
* Spring may be referred to using the {@code SCOPE_*} constants available in
40+
* via {@link ConfigurableBeanFactory} and {@code WebApplicationContext} interfaces.
41+
*
42+
* <p>To register additional custom scopes, see
43+
* {@link org.springframework.beans.factory.config.CustomScopeConfigurer CustomScopeConfigurer}.
44+
*
4045
* @author Mark Fisher
4146
* @author Chris Beams
4247
* @since 2.5
@@ -50,9 +55,12 @@
5055

5156
/**
5257
* Specifies the scope to use for the annotated component/bean.
53-
* @return the specified scope
58+
* @see ConfigurableBeanFactory#SCOPE_SINGLETON
59+
* @see ConfigurableBeanFactory#SCOPE_PROTOTYPE
60+
* @see org.springframework.web.context.WebApplicationContext#SCOPE_REQUEST
61+
* @see org.springframework.web.context.WebApplicationContext#SCOPE_SESSION
5462
*/
55-
String value() default BeanDefinition.SCOPE_SINGLETON;
63+
String value() default ConfigurableBeanFactory.SCOPE_SINGLETON;
5664

5765
/**
5866
* Specifies whether a component should be configured as a scoped proxy

0 commit comments

Comments
 (0)