Spring bean scopes

Spring beans can be created with multiple scopes. The default scope is a singleton.

Since there is only one instance of a singleton bean, it cannot contain any data that is specific to a request.

The scope can be provided with the @Scope annotation on any spring bean:

    @Service 
@Scope("singleton")
public class BusinessServiceImpl implements BusinessService

The following table shows the different types of scopes available for beans: