| 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | ||||||||
@Retention(value=RUNTIME) @Target(value=TYPE) public @interface Profile
Indicates that a component is eligible for registration when one or more specified profiles are active.
A profile is a named logical grouping that may be activated programatically via
 ConfigurableEnvironment.setActiveProfiles(java.lang.String...) or declaratively through setting the
 spring.profiles.active property,
 usually through JVM system properties, as an environment variable, or for web applications
 as a Servlet context parameter in web.xml.
 
The @Profile annotation may be used in any of the following ways:
 
@Component, including @Configuration classes
   If a @Configuration class is marked with @Profile, all of the
 @Bean methods and @Import annotations associated with that class will
 be bypassed unless one or more the specified profiles are active.  This is very similar to
 the behavior in Spring XML: if the profile attribute of the beans element is
 supplied e.g., <beans profile="p1,p2">, the beans element will not be parsed unless
 profiles 'p1' and/or 'p2' have been activated.  Likewise, if a @Component or
 @Configuration class is marked with @Profile({"p1", "p2"}), that class will
 not be registered/processed unless profiles 'p1' and/or 'p2' have been activated.
 
If the @Profile annotation is omitted, registration will occur, regardless of which,
 if any, profiles are active.
 
When defining Spring beans via XML, the "profile" attribute of the <beans>
 element may be used. See the documentation in spring-beans-3.1.xsd for details.
ConfigurableEnvironment.setActiveProfiles(java.lang.String...), 
ConfigurableEnvironment.setDefaultProfiles(java.lang.String...), 
AbstractEnvironment.ACTIVE_PROFILES_PROPERTY_NAME, 
AbstractEnvironment.DEFAULT_PROFILES_PROPERTY_NAME| Required Element Summary | |
|---|---|
 String[] | 
value
The set of profiles for which this component should be registered.  | 
| Element Detail | 
|---|
public abstract String[] value
  | 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | ||||||||