Binds a singleton instance to a key: whenever the requested key is resolved,
        if the instance is still None, it is created by calling factoryMethod(container, key);
        otherwise, it is just returned.

        When the client calls dispose() on the container, disposeMethod(instance) is called
        if the instance was previously created.

def registerSingleton(self, key, factoryMethod, disposeMethod=None):
        """
        Binds a singleton instance to a key: whenever the requested key is resolved,
        if the instance is still None, it is created by calling factoryMethod(container, key);
        otherwise, it is just returned.

        When the client calls dispose() on the container, disposeMethod(instance) is called
        if the instance was previously created.
        """
        return self.addRegistration(key, SingletonRegistration(factoryMethod, disposeMethod))