try {
connectionProvider.getMBeanServer().unregisterMBean(getObjectName());
} catch (MBeanRegistrationException e) {
e.printStackTrace();
} catch (InstanceNotFoundException e) {
throw new EmsBeanNotFoundException("Could not unregister bean, instance not found [" + getObjectName().getCanonicalName() + "]", e);
}
// TODO: Shouldn't we remove the MBean from our map too?
//connectionProvider.getExistingConnection().removeMBean(getObjectName().toString());
}