def handlemsg(self, msg):
        serverlist = []
        handle_locally = False
        # Do not forward messages when in definition state 
        # (for e.g. configuring services)
        if self.session.getstate() == coreapi.CORE_EVENT_DEFINITION_STATE:
            handle_locally = True
            return not handle_locally
        # Decide whether message should be handled locally or forwarded, or both
        if msg.msgtype == coreapi.CORE_API_NODE_MSG:
            (handle_locally, serverlist) = self.handlenodemsg(msg)
        elif msg.msgtype == coreapi.CORE_API_EVENT_MSG:
            # broadcast events everywhere
            serverlist = self.getserverlist()
        elif msg.msgtype == coreapi.CORE_API_CONF_MSG:
            # broadcast location and services configuration everywhere
            confobj = msg.gettlv(coreapi.CORE_TLV_CONF_OBJ)
            if confobj == "location" or confobj == "services" or \
               confobj == "session" or confobj == "all":
                serverlist = self.getserverlist()
        elif msg.msgtype == coreapi.CORE_API_FILE_MSG:
            # broadcast hook scripts and custom service files everywhere
            filetype = msg.gettlv(coreapi.CORE_TLV_FILE_TYPE)
            if filetype is not None and \
                (filetype[:5] == "hook:" or filetype[:8] == "service:"):
                serverlist = self.getserverlist()

        if msg.msgtype == coreapi.CORE_API_LINK_MSG:
            # prepare a serverlist from two node numbers in link message
            (handle_locally, serverlist, msg) = self.handlelinkmsg(msg)
        elif len(serverlist) == 0:
            # check for servers based on node numbers in all messages but link
            nn = msg.nodenumbers()
            if len(nn) == 0:
                return False
            serverlist = self.getserversbynode(nn[0])

        if len(serverlist) == 0: 
            handle_locally = True

        # allow other handlers to process this message
        # (this is used by e.g. EMANE to use the link add message to keep counts
        # of interfaces on other servers)
        for handler in self.handlers:
            handler(msg)

        # Perform any message forwarding
        handle_locally = self.forwardmsg(msg, serverlist, handle_locally)
        return not handle_locally
See #764
dataset/ETHPy150Open coreemu/core/daemon/core/broker.py/CoreBroker.handlemsg--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/lib/PyAMF-0.6.1/pyamf/tests/adapters/test_django.py/ClassAliasTestCase.test_properties