1 files added
3 files modified
| | |
| | | import java.lang.reflect.InvocationTargetException; |
| | | import java.lang.reflect.Method; |
| | | import java.net.InetSocketAddress; |
| | | import java.net.MalformedURLException; |
| | | import java.net.URI; |
| | | import java.net.URISyntaxException; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | |
| | | import java.util.logging.Level; |
| | | import java.util.logging.Logger; |
| | | import de.uhilger.neon.Scanner.ScannerListener; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * Einen Neon-Server aus einer Beschreibungsdatei herstellen |
| | |
| | | IllegalAccessException, IllegalArgumentException, InvocationTargetException, IOException { |
| | | |
| | | Logger.getLogger(Factory.class.getName()).log(Level.FINER, System.getProperty("java.class.path")); |
| | | |
| | | |
| | | List<ServerDescriptor> serverList = d.server; |
| | | for (ServerDescriptor sd : serverList) { |
| | | HttpServer server = HttpServer.create(new InetSocketAddress(sd.port), 0); |
| | |
| | | server.setExecutor(Executors.newFixedThreadPool(10)); |
| | | server.start(); |
| | | } |
| | | fireInstanceStarted(); |
| | | |
| | | fireInstanceStarted(); |
| | | } |
| | | |
| | | private Authenticator createAuthenticator(NeonDescriptor d) { |
| | |
| | | l.serverCreated(server); |
| | | } |
| | | } |
| | | |
| | | |
| | | private void fireHandlerCreated(HttpContext ctx, HttpHandler h) { |
| | | for (FactoryListener l : listeners) { |
| | | l.handlerCreated(ctx, h); |
| | |
| | | |
| | | public void authenticatorCreated(HttpContext context, Authenticator authenticator); |
| | | |
| | | //public void elementCreated(Object realm); |
| | | |
| | | public void instanceStarted(); |
| | | |
| | | } |
| | |
| | | public List<String> actorPackages; |
| | | public AuthenticatorDescriptor authenticator; |
| | | public List<ServerDescriptor> server; |
| | | public List<WsServerDescriptor> wsserver; |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | neon - Embeddable HTTP Server based on jdk.httpserver |
| | | Copyright (C) 2025 Ulrich Hilger |
| | | |
| | | This program is free software: you can redistribute it and/or modify |
| | | it under the terms of the GNU Affero General Public License as |
| | | published by the Free Software Foundation, either version 3 of the |
| | | License, or (at your option) any later version. |
| | | |
| | | This program is distributed in the hope that it will be useful, |
| | | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| | | GNU Affero General Public License for more details. |
| | | |
| | | You should have received a copy of the GNU Affero General Public License |
| | | along with this program. If not, see <https://www.gnu.org/licenses/>. |
| | | */ |
| | | |
| | | package de.uhilger.neon.entity; |
| | | |
| | | /** |
| | | * |
| | | * @author Ulrich Hilger |
| | | * @version 0.1, 22.11.2025 |
| | | */ |
| | | public class WsServerDescriptor { |
| | | public String name; |
| | | public int port; |
| | | } |