From 7189ff3d683f97870fc11ec4e14de3f23abe3c4b Mon Sep 17 00:00:00 2001 From: ulrich Date: Thu, 05 Dec 2024 15:11:06 +0000 Subject: [PATCH] TempActor umbenannt zu ActorDescriptor, verschoben zu entity Package --- src/de/uhilger/neon/entity/ActorDescriptor.java | 4 ++-- src/de/uhilger/neon/Factory.java | 14 ++++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/de/uhilger/neon/Factory.java b/src/de/uhilger/neon/Factory.java index 9f9ef19..7c3af07 100644 --- a/src/de/uhilger/neon/Factory.java +++ b/src/de/uhilger/neon/Factory.java @@ -17,6 +17,7 @@ */ package de.uhilger.neon; +import de.uhilger.neon.entity.ActorDescriptor; import com.google.gson.Gson; import com.sun.net.httpserver.Authenticator; import com.sun.net.httpserver.Filter; @@ -48,6 +49,7 @@ 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 @@ -67,7 +69,7 @@ */ public class Factory implements ScannerListener { - private Map<String, List<TempActor>> actorMap; + private Map<String, List<ActorDescriptor>> actorMap; public Factory() { listeners = new ArrayList<>(); @@ -348,10 +350,10 @@ * @param contextName Name des Kontext, dem der Handler zugeordnet ist */ private void wire(Handler h, String contextName) { - List<TempActor> actorList = actorMap.get(contextName); - Iterator<TempActor> i = actorList.iterator(); + List<ActorDescriptor> actorList = actorMap.get(contextName); + Iterator<ActorDescriptor> i = actorList.iterator(); while(i.hasNext()) { - TempActor actor = i.next(); + ActorDescriptor actor = i.next(); h.setActor(actor.getHttpMethod(), actor.getRoute(), actor.getActorClassName()); } } @@ -413,13 +415,13 @@ if (action != null) { List<String> actionHandlers = Arrays.asList(action.handler()); for (String contextName : actionHandlers) { - TempActor tempActor = new TempActor(); + ActorDescriptor tempActor = new ActorDescriptor(); tempActor.setContextName(contextName); tempActor.setHttpMethod(action.type()); tempActor.setRoute(action.route()); tempActor.setActorClassName(foundClass.getName()); - List<TempActor> actorList = actorMap.get(contextName); + List<ActorDescriptor> actorList = actorMap.get(contextName); if(actorList == null) { actorList = new ArrayList<>(); } diff --git a/src/de/uhilger/neon/TempActor.java b/src/de/uhilger/neon/entity/ActorDescriptor.java similarity index 92% rename from src/de/uhilger/neon/TempActor.java rename to src/de/uhilger/neon/entity/ActorDescriptor.java index 6f78624..8d7afeb 100644 --- a/src/de/uhilger/neon/TempActor.java +++ b/src/de/uhilger/neon/entity/ActorDescriptor.java @@ -1,4 +1,4 @@ -package de.uhilger.neon; +package de.uhilger.neon.entity; import de.uhilger.neon.Action.Type; @@ -7,7 +7,7 @@ * @author Ulrich Hilger * @version 0.1, 03.12.2024 */ -public class TempActor { +public class ActorDescriptor { private String contextName; private Type httpMethod; -- Gitblit v1.9.3