-
Notifications
You must be signed in to change notification settings - Fork 580
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Helidon main class. - injection implementation - CDI implementation - refactored MP apps to use it - refactored Níma FT example to use it
- Loading branch information
1 parent
39bd2aa
commit a20a7d0
Showing
60 changed files
with
719 additions
and
264 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 0 additions & 59 deletions
59
...es/nima/fault-tolerance/src/main/java/io/helidon/examples/nima/faulttolerance/FtMain.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* Copyright (c) 2023 Oracle and/or its affiliates. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.helidon; | ||
|
||
import java.util.ServiceLoader; | ||
|
||
import io.helidon.common.HelidonServiceLoader; | ||
import io.helidon.logging.common.LogConfig; | ||
import io.helidon.spi.HelidonStartupProvider; | ||
|
||
/** | ||
* Main entry point for any Helidon application. | ||
* {@link java.util.ServiceLoader} is used to discover the correct {@link io.helidon.spi.HelidonStartupProvider} | ||
* to start the application (probably either Helidon Injection based application, or a CDI based application). | ||
* <p> | ||
* The default option is to start Helidon injection based application. | ||
*/ | ||
public class Main { | ||
static { | ||
LogConfig.initClass(); | ||
} | ||
|
||
private Main() { | ||
} | ||
|
||
/** | ||
* Start Helidon. | ||
* This method is required to start directly from a command line. | ||
* | ||
* @param args arguments of the application | ||
*/ | ||
public static void main(String[] args) { | ||
// we always initialize logging | ||
LogConfig.configureRuntime(); | ||
|
||
// this should only be called once in a lifetime of the server, so no need to optimize | ||
var services = HelidonServiceLoader.create(ServiceLoader.load(HelidonStartupProvider.class)) | ||
.asList(); | ||
|
||
if (services.isEmpty()) { | ||
throw new IllegalStateException("Helidon Main class can only be called if a startup provider is available. " | ||
+ "Please use either Helidon Injection, or Helidon MicroProfile " | ||
+ "(or a custom extension). If neither is available, you should use " | ||
+ "your own Main class."); | ||
} | ||
services.get(0).start(args); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.