Mercurial Hosting > luan
comparison src/luan/modules/http/LuanDomainHandler.java @ 1454:219f2b937f2b
remove log4j
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 08 Mar 2020 14:11:30 -0600 |
parents | 27efb1fcbcb5 |
children | b89212fd04b5 |
comparison
equal
deleted
inserted
replaced
1453:928be2a4d565 | 1454:219f2b937f2b |
---|---|
7 import luan.Luan; | 7 import luan.Luan; |
8 import luan.LuanTable; | 8 import luan.LuanTable; |
9 import luan.LuanCloner; | 9 import luan.LuanCloner; |
10 import luan.LuanFunction; | 10 import luan.LuanFunction; |
11 import luan.LuanException; | 11 import luan.LuanException; |
12 import luan.modules.logging.Log4j; | 12 import luan.modules.logging.LuanLogger; |
13 | 13 |
14 | 14 |
15 public class LuanDomainHandler implements Handler, DomainHandler.Factory { | 15 public class LuanDomainHandler implements Handler, DomainHandler.Factory { |
16 | 16 |
17 private final Luan luanInit; | 17 private final Luan luanInit; |
18 private final DomainHandler domainHandler = new DomainHandler(this); | 18 private final DomainHandler domainHandler = new DomainHandler(this); |
19 | 19 |
20 public LuanDomainHandler(Luan luanInit) { | 20 public LuanDomainHandler(Luan luanInit) { |
21 LuanLogger.initThreadLogging(); | |
21 LuanCloner cloner = new LuanCloner(LuanCloner.Type.COMPLETE); | 22 LuanCloner cloner = new LuanCloner(LuanCloner.Type.COMPLETE); |
22 this.luanInit = (Luan)cloner.clone(luanInit); | 23 this.luanInit = (Luan)cloner.clone(luanInit); |
23 } | 24 } |
24 | 25 |
25 @Override public Handler newHandler(String domain) { | 26 @Override public Handler newHandler(String domain) { |
26 Luan luan = newLuan(domain); | 27 Luan luan = newLuan(domain); |
27 return new LuanHandler(luan,domain); | 28 return new LuanHandler(luan,domain); |
28 } | 29 } |
29 | 30 |
30 protected void newLoggerRepository(Luan luan) { | |
31 Log4j.newLoggerRepository(luan); | |
32 } | |
33 | |
34 protected Luan newLuan(final String domain) { | 31 protected Luan newLuan(final String domain) { |
35 LuanCloner cloner = new LuanCloner(LuanCloner.Type.COMPLETE); | 32 LuanCloner cloner = new LuanCloner(LuanCloner.Type.COMPLETE); |
36 Luan luan = (Luan)cloner.clone(luanInit); | 33 Luan luan = (Luan)cloner.clone(luanInit); |
37 newLoggerRepository(luan); | |
38 LuanFunction reset_luan = new LuanFunction(false) { | 34 LuanFunction reset_luan = new LuanFunction(false) { |
39 @Override public Object call(Object[] args) { | 35 @Override public Object call(Object[] args) { |
40 domainHandler.removeHandler(domain); | 36 domainHandler.removeHandler(domain); |
41 return LuanFunction.NOTHING; | 37 return LuanFunction.NOTHING; |
42 } | 38 } |