Internal method used by AddEventHandler.
		
		Provides functionality of enqueue/dequeue of the events and triggering callbacks.

def _enqueue_function(self):
		"""
		Internal method used by AddEventHandler.
		
		Provides functionality of enqueue/dequeue of the events and triggering callbacks. 
		 """
		from UcsBase import _GenericMO, UcsUtils, WriteObject

		myThread = self._enqueueThread
		self._enqueueThreadSignal.acquire()
		try:
			xmlQuery = '<eventSubscribe cookie="' + self._cookie + '"/>'
			uri = self.Uri() + '/nuova'
			req = urllib2.Request(url=uri, data=xmlQuery)
			self._watchWebResponse = urllib2.urlopen(req)
			self._enqueueThreadSignal.notify()
			self._enqueueThreadSignal.release()

		except:
			self._enqueueThread = None
			self._enqueueThreadSignal.notify()
			self._enqueueThreadSignal.release()
			return

		try:
			sr = self._watchWebResponse
			while (self._watchWebResponse and len(self._wbs)):
				if self._cookie == None:
					break
				rsp = sr.readline()
				rsp = sr.read(int(rsp))
				# TODO:LoadFromXml with raw xml string, if possible
				# doc = xml.dom.minidom.parseString(rsp)
				# rootNode = doc.documentElement

				gmo = _GenericMO(loadXml=rsp)  # Creating Generic Mo
				# gmo.LoadFromXml(rootNode)
				classId = gmo.classId

				if UcsUtils.WordL(
						classId) == NamingId.CONFIG_MO_CHANGE_EVENT:  # Checks if the managed object is of type configMoChangeEvent and adds to queue.
					if myThread == self._enqueueThread:
						for inconfig in gmo.GetChildClassId("inconfig"):
							for moObj in inconfig.GetChild():
								mce = None
								for wb in self._wbs:
									if mce == None:
										mce = UcsMoChangeEvent(eventId=gmo.properties["inEid"],
															   mo=moObj.ToManagedObject(),
															   changeList=moObj.properties.keys())
									if (wb.fmce(mce)):  # TODO: Need to add Filter Support.
										self._enqueueThreadSignal.acquire()  # Acquire the Lock
										wb.Enqueue(mce)
										mce = None
										self._enqueueThreadSignal.notify()  # Notify
										self._enqueueThreadSignal.release()  # Release the Lock

				elif UcsUtils.WordL(
						classId) == NamingId.METHOD_VESSEL:  # Checks if the managed object is of type methodVessel and adds to queue.
					if myThread == self._enqueueThread:
						for instimuli in gmo.GetChildClassId("inStimuli"):
							for cmce in instimuli.GetChildClassId("configMoChangeEvent"):
								for inconfig in cmce.GetChildClassId("inconfig"):
									for moObj in inconfig.GetChild():
										mce = None
										for wb in self._wbs:
											if mce == None:
												mce = UcsMoChangeEvent(eventId=cmce.properties["inEid"],
																	   mo=moObj.ToManagedObject(),
																	   changeList=moObj.properties.keys())
											if (wb.fmce(mce)):  # TODO: Need to add Filter Support.
												self._enqueueThreadSignal.acquire()  # Acquire the Lock
												wb.Enqueue(mce)
												mce = None
												self._enqueueThreadSignal.notify()  # Notify
												self._enqueueThreadSignal.release()  # Release the Lock

			self._enqueueThread = None
			self._watchWebResponse = None
			# if self._enqueueThreadSignal._is_owned():
			self._enqueueThreadSignal.acquire()  # Acquire the Lock
			self._enqueueThreadSignal.notifyAll()
			self._enqueueThreadSignal.release()

		except Exception, err:
			if (self._wbslock == None):
				self._wbslock = Lock()
			self._wbslock.acquire()
			for wb in self._wbs:
				wb.errorCode = -1
			self._wbslock.release()
			self._enqueueThread = None
			self._watchWebResponse = None
			# if self._enqueueThreadSignal._is_owned():
			self._enqueueThreadSignal.acquire()  # Acquire the Lock
			self._enqueueThreadSignal.notifyAll()
			self._enqueueThreadSignal.release()