Destroys the protocol handler. @throws Exception if destroy fails
()
| 1081 | * @throws Exception if destroy fails |
| 1082 | */ |
| 1083 | @Override |
| 1084 | public void destroy() throws Exception { |
| 1085 | if (getLog().isInfoEnabled()) { |
| 1086 | getLog().info(sm.getString("abstractProtocolHandler.destroy", getName())); |
| 1087 | logPortOffset(); |
| 1088 | } |
| 1089 | |
| 1090 | try { |
| 1091 | endpoint.destroy(); |
| 1092 | } finally { |
| 1093 | if (oname != null) { |
| 1094 | if (mserver == null) { |
| 1095 | Registry.getRegistry(null).unregisterComponent(oname); |
| 1096 | } else { |
| 1097 | // Possibly registered with a different MBeanServer |
| 1098 | try { |
| 1099 | mserver.unregisterMBean(oname); |
| 1100 | } catch (MBeanRegistrationException | InstanceNotFoundException e) { |
| 1101 | getLog().info(sm.getString("abstractProtocol.mbeanDeregistrationFailed", oname, mserver)); |
| 1102 | } |
| 1103 | } |
| 1104 | } |
| 1105 | |
| 1106 | ObjectName rgOname = getGlobalRequestProcessorMBeanName(); |
| 1107 | if (rgOname != null) { |
| 1108 | Registry.getRegistry(null).unregisterComponent(rgOname); |
| 1109 | } |
| 1110 | } |
| 1111 | } |
| 1112 | |
| 1113 | |
| 1114 | /** |
nothing calls this directly
no test coverage detected