View Javadoc

1   //========================================================================
2   //Copyright (c) Webtide LLC
3   //------------------------------------------------------------------------
4   //All rights reserved. This program and the accompanying materials
5   //are made available under the terms of the Eclipse Public License v1.0
6   //and Apache License v2.0 which accompanies this distribution.
7   //
8   //The Eclipse Public License is available at
9   //http://www.eclipse.org/legal/epl-v10.html
10  //
11  //The Apache License v2.0 is available at
12  //http://www.apache.org/licenses/LICENSE-2.0.txt
13  //
14  //You may elect to redistribute this code under either of these licenses.
15  //========================================================================
16  
17  package org.eclipse.jetty.servlet.jmx;
18  
19  import org.eclipse.jetty.jmx.ObjectMBean;
20  import org.eclipse.jetty.servlet.FilterMapping;
21  
22  public class FilterMappingMBean extends ObjectMBean
23  {
24  
25      public FilterMappingMBean(Object managedObject)
26      {
27          super(managedObject);
28      }
29  
30      public String getObjectNameBasis()
31      {
32          if (_managed != null && _managed instanceof FilterMapping)
33          {
34              FilterMapping mapping = (FilterMapping)_managed;
35              String name = mapping.getFilterName();
36              if (name != null)
37                  return name;
38          }
39          
40          return super.getObjectNameBasis();
41      }
42  }