Internal service which associates the given property name
        to the method, and the (prop_name, method) with the given
        kwargs dictionary. If needed merges the dictionary, if the
        given (prop_name, method) pair was already registered (in this
        case the last registration wins in case of overlapping.)

        If given prop_name and method have been already registered, a
        ValueError exception is raised.

def __register_notification(self, prop_name, method, kwargs):
        """Internal service which associates the given property name
        to the method, and the (prop_name, method) with the given
        kwargs dictionary. If needed merges the dictionary, if the
        given (prop_name, method) pair was already registered (in this
        case the last registration wins in case of overlapping.)

        If given prop_name and method have been already registered, a
        ValueError exception is raised."""

        key = (prop_name, method)
        if key in self.__PAT_METH_TO_KWARGS:
            raise ValueError("In class %s method '%s' has been declared "
                             "to be a notification for pattern '%s' "
                             "multiple times (only one is allowed)." % \
                                 (self.__class__,
                                  method.__name__, prop_name))
        if frozenset(prop_name) & WILDCARDS:
            # checks that at most one pattern is specified per-method:
            # (see ticket:31#comment:7 and following)
            if (method in self.__METH_TO_PAT or
                (method in self.__METH_TO_PROPS and
                 self.__METH_TO_PROPS[method])):
                raise ValueError("In class %s multiple patterns have been "
                                 "used to declare method '%s' to be a "
                                 "notification (only one is allowed.)" % \
                                 (self.__class__, method.__name__))

            # for the sake of efficiency, method to patterns map is kept
            self.__METH_TO_PAT[method] = prop_name

            # the name contains wildcards
            _dict = self.__PAT_TO_METHS

        else:
            # check that it was not used for patterns
            if method in self.__METH_TO_PAT:
                raise ValueError("In class %s multiple patterns have been "
                                 "used to declare method '%s' to be a "
                                 "notification (only one is allowed.)" % \
                                 (self.__class__, method.__name__))

            _dict = self.__PROP_TO_METHS
            if method not in self.__METH_TO_PROPS:
                self.__METH_TO_PROPS[method] = set()

            self.__METH_TO_PROPS[method].add(prop_name)

        # fills the internal structures
        if prop_name not in _dict:
            _dict[prop_name] = set()

        _dict[prop_name].add(method)

        self.__PAT_METH_TO_KWARGS[key] = kwargs