Mercurial Hosting > luan
comparison src/luan/tools/WebShell.java @ 111:2428ecfed375
change LuanFunction.call() from returning Object[] to returning Object, to reduce garbage collection
git-svn-id: https://luan-java.googlecode.com/svn/trunk@112 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Fri, 23 May 2014 20:40:05 +0000 |
parents | 3c404a296995 |
children | eacf6ce1b47d |
comparison
equal
deleted
inserted
replaced
110:7afa6df829f3 | 111:2428ecfed375 |
---|---|
11 import javax.servlet.http.HttpServletRequest; | 11 import javax.servlet.http.HttpServletRequest; |
12 import javax.servlet.http.HttpServletResponse; | 12 import javax.servlet.http.HttpServletResponse; |
13 import javax.servlet.http.HttpSession; | 13 import javax.servlet.http.HttpSession; |
14 import org.slf4j.Logger; | 14 import org.slf4j.Logger; |
15 import org.slf4j.LoggerFactory; | 15 import org.slf4j.LoggerFactory; |
16 import luan.Luan; | |
16 import luan.LuanFunction; | 17 import luan.LuanFunction; |
17 import luan.LuanState; | 18 import luan.LuanState; |
18 import luan.LuanTable; | 19 import luan.LuanTable; |
19 import luan.LuanException; | 20 import luan.LuanException; |
20 import luan.lib.BasicLib; | 21 import luan.lib.BasicLib; |
25 private static final Logger logger = LoggerFactory.getLogger(WebShell.class); | 26 private static final Logger logger = LoggerFactory.getLogger(WebShell.class); |
26 | 27 |
27 protected LuanState newLuanState() throws LuanException { | 28 protected LuanState newLuanState() throws LuanException { |
28 return LuanState.newStandard(); | 29 return LuanState.newStandard(); |
29 } | 30 } |
30 /* | 31 |
31 protected LuanTable newEnvironment(LuanState luan) throws LuanException { | |
32 return luan.newEnvironment(); | |
33 } | |
34 */ | |
35 protected Object[] eval(LuanState luan,String cmd) throws LuanException { | 32 protected Object[] eval(LuanState luan,String cmd) throws LuanException { |
36 return luan.eval(cmd,"WebShell",true); | 33 return Luan.array(luan.eval(cmd,"WebShell",true)); |
37 } | 34 } |
38 | 35 |
39 @Override protected void service(HttpServletRequest request,HttpServletResponse response) | 36 @Override protected void service(HttpServletRequest request,HttpServletResponse response) |
40 throws ServletException, IOException | 37 throws ServletException, IOException |
41 { | 38 { |