use of com.tvd12.ezyfoxserver.delegate.EzyUserDelegate in project ezyfox-server by youngmonkeys.
the class EzySimpleServerContextBuilder method newZoneContexts.
protected Collection<EzyZoneContext> newZoneContexts(EzyServerContext parent) {
Collection<EzyZoneContext> contexts = new ArrayList<>();
EzySettings settings = EzyServerContexts.getSettings(parent);
for (Integer zoneId : settings.getZoneIds()) {
EzyZoneSetting zoneSetting = settings.getZoneById(zoneId);
EzySimpleZone zone = new EzySimpleZone();
zone.setSetting(zoneSetting);
EzyUserDelegate userDelegate = newUserDelegate(parent);
EzyZoneUserManager userManager = newZoneUserManager(zoneSetting, userDelegate);
EzyEventControllers eventControllers = newEventControllers(zoneSetting.getEventControllers());
zone.setUserManager(userManager);
zone.setEventControllers(eventControllers);
EzySimpleZoneContext zoneContext = new EzySimpleZoneContext();
zoneContext.setParent(parent);
zoneContext.setZone(zone);
zoneContext.addAppContexts(newAppContexts(zoneContext));
zoneContext.addPluginContexts(newPluginContexts(zoneContext));
zoneContext.init();
contexts.add(zoneContext);
processWithException(((EzyStartable) userManager)::start);
}
return contexts;
}
Aggregations