@Override
public void start(final StartContext context) throws StartException {
log.tracef("Starting %s", EndpointRegistryService.class.getName());
if (injectedMBeanServer.getValue() != null) {
final ManagedEndpointRegistry managedEndpointRegistry = new ManagedEndpointRegistry();
managedEndpointRegistry.setMbeanServer(injectedMBeanServer.getValue());
registry = managedEndpointRegistry;
} else {
registry = new DefaultEndpointRegistry();
}
}