def Subscriber(self, channel_name, registrationId=""):
self._mgr_lock.acquire()
self._logger.debug("Requesting Subscriber for Channel:" + str(channel_name) )
sub = None
try:
if self._ecm:
ereg = EventChannelManager.EventRegistration( channel_name = channel_name, reg_id = registrationId)
self._logger.debug("Requesting Channel:" + str(channel_name) + " from Domain's EventChannelManager ")
registration = self._ecm.registerResource( ereg )
sub = EM_Subscriber( self, registration )
self._logger.debug("Channel:" + str(channel_name) + " Reg-Id:" + str(registration.reg.reg_id))
self._registrations.append( registration )
except:
#print traceback.format_exc()
self._logger.error("Unable to create Subscriber for Channel:" + str(channel_name ))
finally:
self._mgr_lock.release()
return sub
评论列表
文章目录