public ObjectName[] getValveObjectNames() { ArrayList<ObjectName> valveList = new ArrayList<ObjectName>(); Valve current = first; if (current == null) { current = basic; } while (current != null) { if (current instanceof ValveBase) { valveList.add(((ValveBase) current).getObjectName()); } current = current.getNext(); } return valveList.toArray(new ObjectName[0]); }
private void unregisterValve(Valve valve) { if( valve instanceof ValveBase ) { try { ValveBase vb=(ValveBase)valve; if( vb.getController()!=null && vb.getController() == ((ContainerBase)container).getJmxName() ) { ObjectName vname=vb.getObjectName(); Registry.getRegistry(null, null).getMBeanServer() .unregisterMBean(vname); ((ValveBase)valve).setObjectName(null); } } catch( Throwable t ) { log.info( "Can't unregister valve " + valve , t ); } } }
public ObjectName[] getValveObjectNames() { ArrayList valveList = new ArrayList(); Valve current = first; if (current == null) { current = basic; } while (current != null) { if (current instanceof ValveBase) { valveList.add(((ValveBase) current).getObjectName()); } current = current.getNext(); } return ((ObjectName[]) valveList.toArray(new ObjectName[0])); }
/** * Remove an existing Valve. * * @param name MBean Name of the component to remove * * @exception Exception if a component cannot be removed */ public void removeValve(String name) throws Exception { // Acquire a reference to the component to be removed ObjectName oname = new ObjectName(name); ContainerBase container = getParentContainerFromChild(oname); Valve[] valves = container.getPipeline().getValves(); for (int i = 0; i < valves.length; i++) { ObjectName voname = ((ValveBase) valves[i]).getObjectName(); if (voname.equals(oname)) { container.getPipeline().removeValve(valves[i]); } } }
/** * Return the MBean Names of the Valves associated with this Host * * @exception Exception if an MBean cannot be created or registered */ public String [] getValveNames() throws Exception { Valve [] valves = this.getPipeline().getValves(); String [] mbeanNames = new String[valves.length]; for (int i = 0; i < valves.length; i++) { if( valves[i] == null ) continue; if( ((ValveBase)valves[i]).getObjectName() == null ) continue; mbeanNames[i] = ((ValveBase)valves[i]).getObjectName().toString(); } return mbeanNames; }
/** * Remove an existing Valve. * * @param name MBean Name of the comonent to remove * * @exception Exception if a component cannot be removed */ public void removeValve(String name) throws Exception { // Acquire a reference to the component to be removed ObjectName oname = new ObjectName(name); ContainerBase container = getParentContainerFromChild(oname); String sequence = oname.getKeyProperty("seq"); Valve[] valves = (Valve[])container.getValves(); for (int i = 0; i < valves.length; i++) { ObjectName voname = ((ValveBase) valves[i]).getObjectName(); if (voname.equals(oname)) { container.removeValve(valves[i]); } } }
private void registerValve(Valve valve) { if( valve instanceof ValveBase && ((ValveBase)valve).getObjectName()==null ) { try { String domain=((ContainerBase)container).getDomain(); if( container instanceof StandardContext ) { domain=((StandardContext)container).getEngineName(); } if( container instanceof StandardWrapper) { Container ctx=((StandardWrapper)container).getParent(); domain=((StandardContext)ctx).getEngineName(); } ObjectName vname=((ValveBase)valve).createObjectName( domain, ((ContainerBase)container).getJmxName()); if( vname != null ) { ((ValveBase)valve).setObjectName(vname); Registry.getRegistry(null, null).registerComponent (valve, vname, valve.getClass().getName()); ((ValveBase)valve).setController (((ContainerBase)container).getJmxName()); } } catch( Throwable t ) { log.info( "Can't register valve " + valve , t ); } } }
/** * Return the MBean Names of the Valves assoicated with this Host * * @exception Exception if an MBean cannot be created or registered */ public String [] getValveNames() throws Exception { Valve [] valves = this.getValves(); String [] mbeanNames = new String[valves.length]; for (int i = 0; i < valves.length; i++) { if( valves[i] == null ) continue; if( ((ValveBase)valves[i]).getObjectName() == null ) continue; mbeanNames[i] = ((ValveBase)valves[i]).getObjectName().toString(); } return mbeanNames; }
/** * Remove an existing Valve. * * @param name * MBean Name of the component to remove * * @exception Exception * if a component cannot be removed */ public void removeValve(String name) throws Exception { // Acquire a reference to the component to be removed ObjectName oname = new ObjectName(name); ContainerBase container = getParentContainerFromChild(oname); Valve[] valves = container.getPipeline().getValves(); for (int i = 0; i < valves.length; i++) { ObjectName voname = ((ValveBase) valves[i]).getObjectName(); if (voname.equals(oname)) { container.getPipeline().removeValve(valves[i]); } } }
/** * Return the MBean Names of the Valves associated with this Host * * @exception Exception * if an MBean cannot be created or registered */ public String[] getValveNames() throws Exception { Valve[] valves = this.getPipeline().getValves(); String[] mbeanNames = new String[valves.length]; for (int i = 0; i < valves.length; i++) { if (valves[i] == null) continue; if (((ValveBase) valves[i]).getObjectName() == null) continue; mbeanNames[i] = ((ValveBase) valves[i]).getObjectName().toString(); } return mbeanNames; }
TomcatLoginImpl(ValveBase valve, Request request) { this.valve = valve; this.request = request; }