Spawn new agency, returns the reference. Usage:
        > spawn_agency()
        Also takes a list of components to switch into production mode.
        By default all the components work in test mode.
        Components are the canonical names of interfaces classes used by
        dependencies (example: flt.agents.hapi.interface.IServerFactory).

def spawn_agency(self, *components, **kwargs):
        '''
        Spawn new agency, returns the reference. Usage:
        > spawn_agency()
        Also takes a list of components to switch into production mode.
        By default all the components work in test mode.
        Components are the canonical names of interfaces classes used by
        dependencies (example: flt.agents.hapi.interface.IServerFactory).
        '''
        hostdef = kwargs.pop('hostdef', None)
        ip = kwargs.pop('ip', None)
        hostname = kwargs.pop('hostname', None)
        start_host = kwargs.pop('start_host', True)
        disable_monitoring = kwargs.pop('disable_monitoring', True)
        if kwargs:
            raise AttributeError("Unexpected kwargs argument %r" % (kwargs, ))

        ag = agency.Agency()
        ag.set_host_def(hostdef)
        self._agencies.append(ag)
        for canonical_name in components:
            comp = reflect.named_object(canonical_name)
            ag.set_mode(comp, ExecMode.production)

        tun_backend = tunneling.EmuBackend(version=self._tunneling_version,
                                           bridge=self._tunneling_bridge)
        if disable_monitoring:
            ag.disable_protocol('setup-monitoring', 'Task')

        counter = getattr(self, '_agency_counter', -1)
        self._agency_counter = counter + 1
        queue_name = "agency_%d" % (self._agency_counter, )
        msg = rabbitmq.Client(self._messaging, queue_name)
        tun = tunneling.Tunneling(tun_backend)

        d = ag.initiate(self._database, self._journaler, self, ip, hostname,
                        start_host, msg, tun)
        d.addCallback(defer.override_result, ag)
        d.addCallback(defer.bridge_param, self.wait_for_idle)
        return d