Mercurial Hosting > luan
changeset 496:c65df5b25932
remove Http.session
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sat, 16 May 2015 20:19:05 -0600 |
parents | 598123096772 |
children | 55f9f74f1e55 |
files | http/src/luan/modules/http/HttpServicer.java |
diffstat | 1 files changed, 0 insertions(+), 38 deletions(-) [+] |
line wrap: on
line diff
--- a/http/src/luan/modules/http/HttpServicer.java Fri May 15 18:10:14 2015 -0600 +++ b/http/src/luan/modules/http/HttpServicer.java Sat May 16 20:19:05 2015 -0600 @@ -78,12 +78,6 @@ try { module.put( luan, "request", lib.requestTable() ); module.put( luan, "response", lib.responseTable() ); - module.put( luan, "session", lib.sessionTable() ); -/* - module.put( "write", new LuanJavaFunction( - HttpServicer.class.getMethod( "text_write", LuanState.class, new Object[0].getClass() ), lib - ) ); -*/ } catch(NoSuchMethodException e) { throw new RuntimeException(e); } @@ -349,38 +343,6 @@ return tbl; } - private LuanTable sessionTable() throws NoSuchMethodException { - LuanTable tbl = new LuanTable(); - LuanTable attributes = new NameMeta() { - - @Override Object get(String name) { - return request.getSession().getAttribute(name); - } - - @Override protected Iterator keys(LuanTable tbl) { - return new EnumerationIterator(request.getSession().getAttributeNames()); - } - - @Override public boolean canNewindex() { - return true; - } - - @Override public void __new_index(LuanState luan,LuanTable tbl,Object key,Object val) { - if( !(key instanceof String) ) - throw new IllegalArgumentException("key must be string for session attributes table"); - String name = (String)key; - request.getSession().setAttribute(name,val); - } - - @Override protected String type(LuanTable tbl) { - return "session.attributes"; - } - - }.newTable(); - tbl.rawPut( "attributes", attributes ); - return tbl; - } - private void add(LuanTable t,String method,Class<?>... parameterTypes) throws NoSuchMethodException { t.rawPut( method, new LuanJavaFunction(HttpServicer.class.getMethod(method,parameterTypes),this) ); }