class MessageReceiver implements AutoCloseable {

	void disableRealTimeReceiving() {
		LoggingService.logDebug(MODULE_NAME, "Start disable real time receiving");
		try {
			if (consumer == null || listener == null || consumer.getMessageListener() == null)
				return;
			listener = null;
			consumer.setMessageListener(null);
		} catch (Exception exp) {
			logError(MODULE_NAME, "Error in disabling real time listener",
					new AgentSystemException(exp.getMessage()
							, exp));
		}
		LoggingService.logDebug(MODULE_NAME, "Finished disable real time receiving");
	}

	public  MessageReceiver(String name, MessageConsumer consumer);

}