// if we ever want to change this so the server does pick up
// persisted preferences, replace the following line with:
// config = prepareConfigurationPreferences();
ServerConfiguration config = reloadConfiguration();
ServiceContainer container = (null == m_container) ? new ServiceContainer() : m_container;
AutoDiscoveryListener listener = new ServerAutoDiscoveryListener(m_knownAgents);
container.addDiscoveryListener(listener);
container.start(config.getServiceContainerPreferences().getPreferences(), config
.getClientCommandSenderConfiguration(), m_mbs);
// now let's add our additional handler to support the remote clients (e.g. CLI)
m_remoteApiHandler = new RemoteSafeInvocationHandler();
m_remoteApiHandler.registerMetricsMBean(container.getMBeanServer());
container.addInvocationHandler(REMOTE_API_SUBSYSTEM, m_remoteApiHandler);
m_container = container;
m_configuration = config;
m_started = true;
}