if (mbeanServer != null) {
try {
ObjectName objectName = createConnectorObjectName(connector);
connector = connector.asManagedConnector(getManagementContext().getMBeanServer(), objectName);
ConnectorViewMBean view = new ConnectorView(connector);
mbeanServer.registerMBean(view, objectName);
registeredMBeanNames.add(objectName);
return connector;
} catch (Throwable e) {
throw IOExceptionSupport.create("Transport Connector could not be registered in JMX: " + e.getMessage(), e);