예제 #1
0
파일: agent.py 프로젝트: rhettg/JoeAgent
 def handleMessageRecievedEvent(self, event):
     # All we will do a receive event is log it.
     # Its up to one of our listeners to care about it.
     log.debug("Received a message of type %s" 
                % str(event.getMessage().__class__))
     if isinstance(event.getMessage(), Request):
         log.debug("Request: %s" % str(event.getMessage()))
     if isinstance(event.getMessage(), Response):
         log.debug("Response: %s" % str(event.getMessage()))
예제 #2
0
파일: agent.py 프로젝트: rhettg/JoeAgent
    def handleMessageSendEvent(self, event):
        log.debug("Sending a message of type %s" 
                   % str(event.getMessage().__class__))
        if isinstance(event.getMessage(), Request):
            log.debug("Request: %s" % event.getMessage().getKey())
        if isinstance(event.getMessage(), Response):
            log.debug("Response: %s" % str(event.getMessage()))

        if isinstance(event.getTarget(), Connection):
            event.getTarget().write(str(event.getMessage()))