class MessageReceiver implements AutoCloseable {

	void enableRealTimeReceiving() {
		LoggingService.logDebug(MODULE_NAME, "Start enable real time receiving");

		listener = new IOMessageListener(new MessageCallback(name));
		try {
			consumer.setMessageListener(listener);
		} catch (Exception e) {
			listener = null;
			LoggingService.logError(MODULE_NAME, "Error in enabling real time listener",
					new AgentSystemException(e.getMessage(), e));
		}
		LoggingService.logDebug(MODULE_NAME, "Finished enable real time receiving");
	}

	public  MessageReceiver(String name, MessageConsumer consumer);

}