'Register this servlet with the given HTTP server.'

def register(self, http_server):

    if hasattr(self, 'PATTERNS'):
        patterns = self.PATTERNS
        for method in ('GET', 'PUT', 'POST', 'OPTIONS', 'DELETE'):
            if hasattr(self, ('on_%s' % (method,))):
                method_handler = getattr(self, ('on_%s' % (method,)))
                http_server.register_paths(method, patterns, method_handler)
    else:
        raise NotImplementedError('RestServlet    must    register    something.')
