     loginPromise = null
     messageQueueHolder = new MessageQueueHolder(messageBuffer)
 
-    fnWrapperMap = {} # handlers are wrapped, so we have to keep track
+    fnWrapperMap = new SimpleMap # handlers are wrapped, so we have to keep track
 
     if enabled and vertxEventBus
       vertxEventBus.onopen = ->

    first: -> @items.shift(0)
    size: -> @items.length

  options = angular.extend({}, DEFAULT_OPTIONS)

  # private

      registerHandler : (address, callback) ->
        return unless typeof callback is 'function'
        console.debug("[VertX EB Service] Register handler for #{address}") if debugEnabled
        return fnWrapperMap.get(callback) if fnWrapperMap.containsKey(callback) # already known
        fnWrapperMap.put(callback, (message, replyTo) ->
          callback(message, replyTo)
          $rootScope.$digest()
        )
        vertxEventBus.registerHandler address, fnWrapperMap.get(callback)
      # Remove a callback handler for the specified address match.
      unregisterHandler : (address, callback) ->
        return unless typeof callback is 'function'
        console.debug("[VertX EB Service] Unregister handler for #{address}") if debugEnabled
        vertxEventBus.unregisterHandler address, fnWrapperMap.get(callback)
        fnWrapperMap.remove(callback)
        return #void
      # Send a message to the specified address (using EventBus.send).
      # @param address a required string for the targeting address in the bus
