|
40 | 40 | import java.util.function.Predicate; |
41 | 41 | import java.util.function.Supplier; |
42 | 42 | import java.util.stream.Collectors; |
43 | | -import java.util.stream.Stream; |
44 | 43 |
|
45 | 44 | import org.slf4j.Logger; |
46 | 45 | import org.slf4j.LoggerFactory; |
@@ -1124,48 +1123,6 @@ public String toString() { |
1124 | 1123 | return getName() + ":" + getVersion(); |
1125 | 1124 | } |
1126 | 1125 |
|
1127 | | - /** |
1128 | | - * Setup default environment, logging (logback or log4j2) and run application. |
1129 | | - * |
1130 | | - * @param args Application arguments. |
1131 | | - * @param applicationType Application type. |
1132 | | - */ |
1133 | | - public static void runApp( |
1134 | | - @NonNull String[] args, @NonNull Class<? extends Jooby> applicationType) { |
1135 | | - runApp(args, ExecutionMode.DEFAULT, applicationType); |
1136 | | - } |
1137 | | - |
1138 | | - /** |
1139 | | - * Setup default environment, logging (logback or log4j2) and run application. |
1140 | | - * |
1141 | | - * @param args Application arguments. |
1142 | | - * @param executionMode Application execution mode. |
1143 | | - * @param applicationType Application type. |
1144 | | - */ |
1145 | | - public static void runApp( |
1146 | | - @NonNull String[] args, |
1147 | | - @NonNull ExecutionMode executionMode, |
1148 | | - @NonNull Class<? extends Jooby> applicationType) { |
1149 | | - configurePackage(applicationType.getPackage()); |
1150 | | - runApp(args, executionMode, reflectionProvider(applicationType)); |
1151 | | - } |
1152 | | - |
1153 | | - /** |
1154 | | - * Setup default environment, logging (logback or log4j2) and run application. |
1155 | | - * |
1156 | | - * @param args Application arguments. |
1157 | | - * @param executionMode Application execution mode. |
1158 | | - * @param applicationType Application type. |
1159 | | - * @return Application. |
1160 | | - */ |
1161 | | - public static Jooby createApp( |
1162 | | - @NonNull String[] args, |
1163 | | - @NonNull ExecutionMode executionMode, |
1164 | | - @NonNull Class<? extends Jooby> applicationType) { |
1165 | | - configurePackage(applicationType.getPackage()); |
1166 | | - return createApp(args, executionMode, reflectionProvider(applicationType)); |
1167 | | - } |
1168 | | - |
1169 | 1126 | /** |
1170 | 1127 | * Setup default environment, logging (logback or log4j2) and run application. |
1171 | 1128 | * |
@@ -1354,20 +1311,6 @@ private static Supplier<Jooby> consumerProvider(Consumer<Jooby> consumer) { |
1354 | 1311 | }; |
1355 | 1312 | } |
1356 | 1313 |
|
1357 | | - private static Supplier<Jooby> reflectionProvider( |
1358 | | - @NonNull Class<? extends Jooby> applicationType) { |
1359 | | - return () -> |
1360 | | - (Jooby) |
1361 | | - Stream.of(applicationType.getDeclaredConstructors()) |
1362 | | - .filter(it -> it.getParameterCount() == 0) |
1363 | | - .findFirst() |
1364 | | - .map(SneakyThrows.throwingFunction(c -> c.newInstance())) |
1365 | | - .orElseThrow( |
1366 | | - () -> |
1367 | | - new IllegalArgumentException( |
1368 | | - "Default constructor for: " + applicationType.getName())); |
1369 | | - } |
1370 | | - |
1371 | 1314 | /** |
1372 | 1315 | * Check if we are running from joobyRun and invoke a hook class passing the web server. JoobyRun |
1373 | 1316 | * intercept the server and use it for doing hotswap. |
|
0 commit comments