Remove an existing Valve. @param name MBean Name of the component to remove @exception Exception if a component cannot be removed
(String name)
| 845 | * @exception Exception if a component cannot be removed |
| 846 | */ |
| 847 | public void removeValve(String name) throws Exception { |
| 848 | |
| 849 | // Acquire a reference to the component to be removed |
| 850 | ObjectName oname = new ObjectName(name); |
| 851 | Container container = getParentContainerFromChild(oname); |
| 852 | if (container == null) { |
| 853 | return; |
| 854 | } |
| 855 | Valve[] valves = container.getPipeline().getValves(); |
| 856 | for (Valve valve : valves) { |
| 857 | if (valve instanceof JmxEnabled) { |
| 858 | ObjectName voname = ((JmxEnabled) valve).getObjectName(); |
| 859 | if (voname.equals(oname)) { |
| 860 | container.getPipeline().removeValve(valve); |
| 861 | } |
| 862 | } |
| 863 | } |
| 864 | } |
| 865 | |
| 866 | } |
| 867 |
nothing calls this directly
no test coverage detected