1 19 20 package org.netbeans.modules.httpserver; 21 22 import org.apache.tomcat.core.*; 23 24 import org.openide.util.Lookup; 25 26 31 public class NbLoaderInterceptor extends BaseInterceptor { 32 33 public NbLoaderInterceptor() { 34 } 35 36 private void setNbLoader( ContextManager cm ) throws TomcatException { 37 ClassLoader cl = (ClassLoader )Lookup.getDefault().lookup(ClassLoader .class); 38 cm.setParentClassLoader(cl); 39 } 40 41 public void contextInit(Context ctx) throws TomcatException { 42 if( ctx.getDebug() > 0 ) ctx.log("NbLoaderInterceptor - init"); ContextManager cm=ctx.getContextManager(); 44 45 try { 46 setNbLoader( cm ); 48 49 ctx.setSessionTimeOut (30); 52 } catch (Exception e) { 53 String msg = "NbLoaderInterceptor failed"; System.out.println(msg); 55 } 56 57 } 58 59 } 60 61 | Popular Tags |