'Instantiates a new handler object, which is called remotely
by others. The user can control the effect of the call by
implementing the remote method in the local endpoint class. The
returned reference can be called locally and will behave as a
regular instance.
Arguments:
acl -- Access control list (see ACL class)
handler_clss -- The local (duck) type.
*args -- Constructor arguments for the local type.
**kwargs -- Constructor keyworded arguments for the local
type.'

def new_handler(self, acl, handler_cls, *args, **kwargs):

    argspec = inspect.getargspec(handler_cls.__init__)
    base_argspec = inspect.getargspec(Endpoint.__init__)
    if (argspec == base_argspec):
        result = handler_cls(self, self._client.boundjid.full)
    else:
        result = handler_cls(*args, **kwargs)
        Endpoint.__init__(result, self, self._client.boundjid.full)
    method_dict = result.get_methods()
    for (method_name, method) in method_dict.items():
        self._register_call(result.FQN(), method, method_name)
    self._register_acl(result.FQN(), acl)
    return result
