| | |
| | | /** |
| | | * Einen Neon-Server gemaess einem Serverbeschreibungsobjekt herstellen und starten |
| | | * |
| | | * @param starter die Klasse, mit der Neon durch Aufruf dieser Methode gestartet wird |
| | | * @param d das Object mit der Serverbeschreibung |
| | | * @param packageNames Namen der Packages, aus der rekursiv vorgefundene Actors eingebaut werden |
| | | * sollen |
| | |
| | | * @throws InvocationTargetException |
| | | * @throws IOException |
| | | */ |
| | | public void runInstance(Class c, NeonDescriptor d, List<String> packageNames, List<DataProvider> sdp) |
| | | public void runInstance(Class starter, NeonDescriptor d, List<String> packageNames, List<DataProvider> sdp) |
| | | throws ClassNotFoundException, NoSuchMethodException, InstantiationException, |
| | | IllegalAccessException, IllegalArgumentException, InvocationTargetException, IOException { |
| | | |
| | | Logger.getLogger(Factory.class.getName()).log(Level.FINER, System.getProperty("java.class.path")); |
| | | Class pingClass = c.getClassLoader().loadClass("de.uhilger.neonbaselokal.actor.Ping"); |
| | | if(pingClass != null) { |
| | | Logger.getLogger(Factory.class.getName()).log(Level.FINER, |
| | | pingClass.getName() + " " + pingClass.getPackageName() + |
| | | " " + pingClass.getSimpleName()); |
| | | } else { |
| | | Logger.getLogger(Factory.class.getName()).log(Level.FINER, "pingClass not found"); |
| | | } |
| | | |
| | | List serverList = d.server; |
| | | Iterator<ServerDescriptor> serverIterator = serverList.iterator(); |
| | |
| | | if(packageNames == null) { |
| | | packageNames = d.actorPackages; |
| | | } |
| | | addContexts(c, d, server, sd.contexts, packageNames, sdp); |
| | | addContexts(starter, d, server, sd.contexts, packageNames, sdp); |
| | | |
| | | server.setExecutor(Executors.newFixedThreadPool(10)); |
| | | server.start(); |