1 /*
2 * Copyright 2018-2020 the original author or authors.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * https://www.apache.org/licenses/LICENSE-2.0
9 *
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 package org.springframework.data.repository.config;
17
18 /**
19 * Enumeration to define in which way repositories are bootstrapped.
20 *
21 * @author Oliver Gierke
22 * @see RepositoryConfigurationSource#getBootstrapMode()
23 * @since 2.1
24 * @soundtrack Dave Matthews Band - She (Come Tomorrow)
25 */
26 public enum BootstrapMode {
27
28 /**
29 * Repository proxies are instantiated eagerly, just like any other Spring bean, except explicitly marked as lazy.
30 * Thus, injection into repository clients will trigger initialization.
31 */
32 DEFAULT,
33
34 /**
35 * Repository bean definitions are considered lazy and clients will get repository proxies injected that will
36 * initialize on first access. Repository initialization is triggered on application context bootstrap completion.
37 */
38 DEFERRED,
39
40 /**
41 * Repository bean definitions are considered lazy, lazily inject and only initialized on first use, i.e. the
42 * application might have fully started without the repositories initialized.
43 */
44 LAZY;
45 }
46