class MessageBus implements IOFogModule {

	public void update() throws Exception {
		logDebug("Start update routes, list of publishers and receivers");
		synchronized (updateLock) {
			if (!messageBusServer.isConnected()) {
				messageBusServer.setConnected(false);
				new Thread(startServer).start();
				throw new JMSException("Not connected to router");
			}

			String tempRouterHost = routerHost;
			int tempRouterPort = routerPort;
			getRouterAddress();
			if (!tempRouterHost.equals(routerHost) || tempRouterPort != routerPort) {
				try {
					stop();
				} catch (Exception ex) {
					logError(MODULE_NAME, new AgentSystemException("unable to update router info", ex));
				} finally {
					messageBusServer.setConnected(false);
					new Thread(startServer).start();
					throw new JMSException("Not connected to router");
				}
			}

			updatePublishersAndReceivers();
		}
		logDebug("Finished update routes, list of publishers and receivers");
	}

	private  MessageBus();

}