public void uninstallMBean(ObjectName on) { try { serviceController.stop(on); serviceController.destroy(on); serviceController.remove(on); removeParentDependency(on); if(server.isRegistered(on)) server.unregisterMBean(on); else log.warn(on + " is not registered"); } catch (Exception e) { throw new RuntimeException(e); } }
/** * Stops all the containers of this application. */ @Override protected void stopService() throws Exception { ListIterator iter = containerOrdering.listIterator(containerOrdering.size()); while (iter.hasPrevious()) { Container con = (Container) iter.previous(); try { ObjectName jmxName = con.getJmxName(); // The container may already be destroyed so validate metaData BeanMetaData metaData = con.getBeanMetaData(); String ejbName = metaData != null ? metaData.getEjbName() : "Unknown"; log.debug("stopService, stopping container: " + ejbName); serviceController.stop(jmxName); } catch (Exception e) { log.error("unexpected exception stopping Container: " + con.getJmxName(), e); } // end of try-catch } }
public void stop() throws Exception { if(cacheInvalidator != null) { cacheInvalidator.unregister(); } if(cacheName != null) { serviceController.stop(cacheName); serviceController.destroy(cacheName); serviceController.remove(cacheName); } serviceController = null; }