 url = require "url"
 http = require "http"
 util = require "util"
-events = require "eventemitter2"
+async = require "async"
+assert = require "assert"
 colors = require "colors"
 logger = require "winston"
 

    # override it and provie support for more methods, up to you.
    @SUPPORTED = ["GET", "PUT", "POST", "DELETE", "OPTIONS", "PATCH"]

    # This method is intended for indicating to a client that the
    # method that has been used to make the request is not supported
    # by this service of the internals that are comprising service.

        @emit "unsupported", request, response, next
        return response.send descriptor if doesJson
        response.send message; this

    # This method determines whether the supplied HTTP request
    # matches this service. This is determined by examining the
    # domain/host and the path, in accordance with the patterns
    # that were used for configuring the class of this service.
    # It is async, so be sure to call the `decide` with boolean!
    matches: (request, response, decide) ->
        conditions = @constructor.condition?()
        conditions = [] unless _.isArray conditions
        identify = @constructor?.identify().underline
        p = (i, c) -> i.limitation request, response, c
        fails = "service #{identify} fails some conditions"
        super request, response, (decision) =>
            return decide no unless decision
            async.every conditions, p, (confirms) ->
                return decide yes if confirms
                logger.debug fails.yellow
                decide no; return this

    # Process the already macted HTTP request according to the REST
    # specification. That is, see if the request method conforms to
