X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=src%2Fdolda%2Fjsvc%2Fj2ee%2FServlet.java;h=082113c9f0a92bc54c27b80f30bc1d5673b21d2b;hb=9990cd490e3b4f4b9381517193d3f7adb0330c10;hp=43726527083ba0fcbeb7eec9e5fca1d2958ddb34;hpb=c9837b5e87402fa1375fe6d3dd80cb3405edda42;p=jsvc.git diff --git a/src/dolda/jsvc/j2ee/Servlet.java b/src/dolda/jsvc/j2ee/Servlet.java index 4372652..082113c 100644 --- a/src/dolda/jsvc/j2ee/Servlet.java +++ b/src/dolda/jsvc/j2ee/Servlet.java @@ -10,19 +10,19 @@ import javax.servlet.*; public class Servlet extends HttpServlet { private ThreadContext tg; - public void init() throws ServletException { - Properties sprop = new Properties(); + public void init(ServletConfig cfg) throws ServletException { + J2eeContext ctx = J2eeContext.create(cfg); try { InputStream pi = Servlet.class.getClassLoader().getResourceAsStream("jsvc.properties"); try { - sprop.load(pi); + ctx.loadconfig(pi); } finally { pi.close(); } } catch(IOException e) { throw(new Error(e)); } - String clnm = (String)sprop.get("jsvc.bootstrap"); + String clnm = ctx.libconfig("jsvc.bootstrap", null); if(clnm == null) throw(new ServletException("No JSvc bootstrapper specified")); Class bc; @@ -31,9 +31,12 @@ public class Servlet extends HttpServlet { } catch(ClassNotFoundException e) { throw(new ServletException("Invalid JSvc bootstrapper specified", e)); } - tg = new ThreadContext(null, "JSvc service", bc); - ServletContext ctx = getServletContext(); - ctx.setAttribute("jsvc.starttime", System.currentTimeMillis()); + String tgn; + if(ctx.name() != null) + tgn = "JSvc service for " + ctx.name(); + else + tgn = "JSvc service"; + tg = new ThreadContext(null, tgn, ctx, bc); } public void destroy() {