Ultrakompakter HTTP Server
ulrich
2024-12-08 f21fac0d6f7c73c7b0bcdcc3a6ef6de000edb76d
Einstweilen auf JDK 11 umgestellt fuer allgemeinere Verwendbarkeit
2 files modified
12 ■■■■ changed files
src/de/uhilger/neon/Factory.java 8 ●●●● patch | view | raw | blame | history
src/de/uhilger/neon/Handler.java 4 ●●●● patch | view | raw | blame | history
src/de/uhilger/neon/Factory.java
@@ -196,8 +196,8 @@
         */
        ctxAttrs.putAll(cd.attributes);
        ctxAttrs.put("serverDataProviderList", sdp);
        if (h instanceof Handler handler) {
          wire(handler, cd.attributes.get("contextName"));
        if (h instanceof Handler) {
          wire((Handler) h, cd.attributes.get("contextName"));
        }
        if (cd.authenticator instanceof String) {
          if (!(auth instanceof Authenticator)) {
@@ -214,8 +214,8 @@
            //
            Object filterObj = Class.forName(filterClassName)
                    .getDeclaredConstructor().newInstance();
            if (filterObj instanceof Filter filter) {
              ctx.getFilters().add(filter);
            if (filterObj instanceof Filter) {
              ctx.getFilters().add((Filter) filterObj);
            }
          }
        }
src/de/uhilger/neon/Handler.java
@@ -96,9 +96,9 @@
    //        .log(Level.INFO, "{0} {1} {2}", new Object[]{methodType, route, className});
    //dispatcher.get(methodType).put(ad.route, ad);
    Object adMapObj = dispatcher.get(methodType);
    if(adMapObj instanceof HashMap hashMap) {
    if(adMapObj instanceof HashMap) {
      @SuppressWarnings("unchecked")
      HashMap<String, ActionDescriptor> map = hashMap;
      HashMap<String, ActionDescriptor> map = (HashMap) adMapObj;
      map.put(ad.route, ad);
      Logger.getLogger(Handler.class.getName()).log(Level.FINER, "ActionDescriptor route {0} className {1}", new Object[]{route, className});              
    } else {