1 17 package org.apache.geronimo.jetty6.cluster.wadi; 18 19 import org.apache.geronimo.clustering.wadi.WADISessionManager; 20 import org.apache.geronimo.gbean.GBeanInfo; 21 import org.apache.geronimo.gbean.GBeanInfoBuilder; 22 import org.apache.geronimo.gbean.GBeanLifecycle; 23 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory; 24 import org.apache.geronimo.jetty6.PreHandler; 25 import org.apache.geronimo.jetty6.PreHandlerFactory; 26 import org.apache.geronimo.jetty6.SessionHandlerFactory; 27 import org.codehaus.wadi.impl.ClusteredManager; 28 29 30 34 public class WADIClusteredPreHandlerFactory implements PreHandlerFactory, GBeanLifecycle { 35 36 private final WADISessionManager sessionManager; 37 private ClusteredManager wadiManager; 38 39 public WADIClusteredPreHandlerFactory(WADISessionManager sessionManager) { 40 this.sessionManager = sessionManager; 41 } 42 43 public void doStart() throws Exception { 44 wadiManager = sessionManager.getManager(); 45 } 46 47 public void doStop() throws Exception { 48 } 49 50 public void doFail() { 51 } 52 53 public PreHandler createHandler() { 54 return new WADIClusteredPreHandler(wadiManager); 55 } 56 57 public static final GBeanInfo GBEAN_INFO; 58 public static final String GBEAN_REF_WADI_SESSION_MANAGER = "WADISessionManager"; 59 60 static { 61 GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic("WADI Pre-Handler Factory", 62 WADIClusteredPreHandlerFactory.class, NameFactory.GERONIMO_SERVICE); 63 64 infoFactory.addReference(GBEAN_REF_WADI_SESSION_MANAGER, WADISessionManager.class, 65 NameFactory.GERONIMO_SERVICE); 66 67 infoFactory.addInterface(SessionHandlerFactory.class); 68 69 infoFactory.setConstructor(new String []{GBEAN_REF_WADI_SESSION_MANAGER}); 70 71 GBEAN_INFO = infoFactory.getBeanInfo(); 72 } 73 74 public static GBeanInfo getGBeanInfo() { 75 return GBEAN_INFO; 76 } 77 78 } 79 | Popular Tags |