Package: Main
Main
name | instruction | branch | complexity | line | method | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Main() |
|
|
|
|
|
||||||||||||||||||||
annotationSpringSystemRoleFactory() |
|
|
|
|
|
||||||||||||||||||||
main(String[]) |
|
|
|
|
|
||||||||||||||||||||
preferencesHandler() |
|
|
|
|
|
Coverage
1: /*
2: * *********************************************************************************************************************
3: *
4: * SolidBlue 3: Data safety
5: * http://tidalwave.it/projects/solidblue3
6: *
7: * Copyright (C) 2023 - 2023 by Tidalwave s.a.s. (http://tidalwave.it)
8: *
9: * *********************************************************************************************************************
10: *
11: * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
12: * the License. You may obtain a copy of the License at
13: *
14: * http://www.apache.org/licenses/LICENSE-2.0
15: *
16: * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
17: * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
18: * specific language governing permissions and limitations under the License.
19: *
20: * *********************************************************************************************************************
21: *
22: * git clone https://bitbucket.org/tidalwave/solidblue3j-src
23: * git clone https://github.com/tidalwave-it/solidblue3j-src
24: *
25: * *********************************************************************************************************************
26: */
27: package it.tidalwave.datamanager.application.nogui;
28:
29: import jakarta.annotation.Nonnull;
30: import org.springframework.boot.SpringApplication;
31: import org.springframework.boot.autoconfigure.SpringBootApplication;
32: import org.springframework.boot.autoconfigure.domain.EntityScan;
33: import org.springframework.context.annotation.Bean;
34: import org.springframework.context.annotation.ComponentScan;
35: import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
36: import org.slf4j.LoggerFactory;
37: import it.tidalwave.util.PreferencesHandler;
38: import it.tidalwave.role.impl.ServiceLoaderLocator;
39: import it.tidalwave.role.spi.SystemRoleFactory;
40: import it.tidalwave.role.spring.spi.AnnotationSpringSystemRoleFactory;
41: import it.tidalwave.datamanager.dao.impl.jpa.JpaDataManagerDao;
42:
43: /***********************************************************************************************************************
44: *
45: * The main for the command line (no gui) version of the application.
46: *
47: * @author Fabrizio Giudici
48: *
49: **********************************************************************************************************************/
50: @SpringBootApplication(scanBasePackages = "it.tidalwave.datamanager")
51: @ComponentScan({"it.tidalwave.datamanager", "it.tidalwave.util.spring.jpa"})
52: @EnableJpaRepositories(basePackageClasses = JpaDataManagerDao.class)
53: @EntityScan("it.tidalwave.datamanager.dao")
54: public class Main
55: {
56: /*******************************************************************************************************************
57: * Primary entry point.
58: ******************************************************************************************************************/
59: public static void main (@Nonnull final String... args)
60: {
61: System.setProperty("spring.config.name", "application,module,module-test");
62: PreferencesHandler.setAppName("SolidBlue");
63: System.setProperty(PreferencesHandler.PROP_SUPPRESS_CONSOLE, "true");
64: System.setProperty(ServiceLoaderLocator.PROP_SUPPRESS_CONSOLE, "true");
65: System.setProperty("logFolder", PreferencesHandler.getInstance().getLogFolder().toString());
66: LoggerFactory.getLogger(Main.class).info("********************************");
67: SpringApplication.run(Main.class, args);
68: }
69:
70: /*******************************************************************************************************************
71: * Enables the DCI role annotation scanner.
72: ******************************************************************************************************************/
73: @Bean
74: public AnnotationSpringSystemRoleFactory annotationSpringSystemRoleFactory()
75: {
76: return (AnnotationSpringSystemRoleFactory)SystemRoleFactory.getInstance();
77: }
78:
79: /*******************************************************************************************************************
80: *
81: ******************************************************************************************************************/
82: @Bean
83: public PreferencesHandler preferencesHandler()
84: {
85: return PreferencesHandler.getInstance();
86: }
87: }