1 16 package org.mortbay.jetty.servlet.jmx; 17 18 import java.util.HashMap ; 19 import java.util.List ; 20 import java.util.Map ; 21 22 import javax.management.MBeanException ; 23 import javax.management.ObjectName ; 24 25 import org.apache.commons.logging.Log; 26 import org.mortbay.log.LogFactory; 27 import org.mortbay.jetty.servlet.WebApplicationHandler; 28 29 30 31 36 public class WebApplicationHandlerMBean extends ServletHandlerMBean 37 { 38 39 private static final Log log = LogFactory.getLog (WebApplicationHandlerMBean.class); 40 private WebApplicationHandler _webappHandler; 41 private Map _filters = new HashMap (); 42 43 44 47 public WebApplicationHandlerMBean() 48 throws MBeanException 49 {} 50 51 52 protected void defineManagedResource() 53 { 54 super.defineManagedResource(); 55 defineAttribute("acceptRanges"); 56 defineAttribute("filterChainsCached"); 57 defineAttribute("filters",READ_ONLY,ON_MBEAN); 58 _webappHandler=(WebApplicationHandler)getManagedResource(); 59 } 60 61 62 public ObjectName [] getFilters() 63 { 64 List l=_webappHandler.getFilters(); 65 return getComponentMBeans(l.toArray(),_filters); 66 } 67 68 public void postDeregister () 69 { 70 destroyComponentMBeans(_filters); 71 super.postDeregister(); 72 } 73 } 74 | Popular Tags |