private static MBeanServer setQueryExpServer ( QueryExp query , MBeanServer toSet ) { // We assume the QueryExp is a QueryEval subclass or uses the QueryEval thread local // mechanism to store any existing MBeanServer. If that's not the case we have no // way to access the old mbeanserver to let us restore it MBeanServer result = QueryEval . getMBeanServer ( ) ; query . setMBeanServer ( toSet ) ; return result ; }
Set the mbean server on the QueryExp and try and pass back any previously set one