Requests that the specified invocation request be packaged up and sent to the supplied
invocation oid.
962335
public void sendRequest (
        int invOid, int invCode, int methodId, Object[] args, Transport transport)
    {
        if (_clobj == null) {
            log.warning("Dropping invocation request on shutdown director", "code", invCode,
                        "methodId", methodId);
            return;
        }

        // configure any invocation listener marshallers among the arguments
        int acount = args.length;
        for (int ii = 0; ii < acount; ii++) {
            Object arg = args[ii];
            if (arg instanceof ListenerMarshaller) {
                ListenerMarshaller lm = (ListenerMarshaller)arg;
                lm.requestId = nextRequestId();
                lm.mapStamp = System.currentTimeMillis();
                // create a mapping for this marshaller so that we can properly dispatch responses
                // sent to it
                _listeners.put(lm.requestId, lm);
            }
        }

        // create an invocation request event
        InvocationRequestEvent event = new InvocationRequestEvent(invOid, invCode, methodId, args);
        event.setTransport(transport);

        // because invocation directors are used on the server, we set the source oid here so that
        // invocation requests are properly attributed to the right client object when created by
        // server-side entities only sort of pretending to be a client
        event.setSourceOid(_clobj.getOid());

//         Log.info("Sending invreq " + event + ".");

        // now dispatch the event
        _omgr.postEvent(event);
    }
539451
@SuppressWarnings("deprecation")
	@Override
	public void decorateRequest(HttpServletRequest request) throws IOException {

		request.setAttribute(CACHEBUST_REQATTRNAME, getParameter(request, CACHEBUST_REQPARAMS));

		// Get module lists from request
		RequestedModuleNames requestedModuleNames = setRequestedModuleNames(request);

		// Get the feature list, if any
		request.setAttribute(FEATUREMAP_REQATTRNAME, getFeaturesFromRequest(request, requestedModuleNames.isVersionError()));

		request.setAttribute(OPTIMIZATIONLEVEL_REQATTRNAME, getOptimizationLevelFromRequest(request));

		String value = getParameter(request, EXPANDREQUIRELISTS_REQPARAMS);
		if ("log".equals(value)) { //$NON-NLS-1$
			request.setAttribute(EXPANDREQLOGGING_REQATTRNAME, Boolean.TRUE);
			request.setAttribute(EXPANDREQUIRELISTS_REQATTRNAME, Boolean.TRUE);
		} else {
			request.setAttribute(EXPANDREQUIRELISTS_REQATTRNAME, TypeUtil.asBoolean(value));
		}
		request.setAttribute(DEPENDENCYEXPANSIONLOGGING_REQATTRNAME, TypeUtil.asBoolean(getParameter(request, DEPENDENCYEXPANSIONLOGGING_REQPARAMS)));

		boolean exportModuleNamesDefault = requestedModuleNames.getPreloads().isEmpty() &&
				                           requestedModuleNames.getDeps().isEmpty();
		request.setAttribute(EXPORTMODULENAMES_REQATTRNAME, TypeUtil.asBoolean(getParameter(request, EXPORTMODULENAMES_REQPARAMS), exportModuleNamesDefault));

		request.setAttribute(SHOWFILENAMES_REQATTRNAME, TypeUtil.asBoolean(getParameter(request, SHOWFILENAMES_REQPARAMS)));

		request.setAttribute(NOCACHE_REQATTRNAME, TypeUtil.asBoolean(getParameter(request, NOCACHE_REQPARAMS)));

		request.setAttribute(REQUESTEDLOCALES_REQATTRNAME, getRequestedLocales(request));

		request.setAttribute(INCLUDEREQUIREDEPS_REQATTRNAME, getParameter(request, INCLUDEREQUIREDEPS_REQPARAM));

		request.setAttribute(INCLUDEUNDEFINEDFEATUREDEPS_REQATTRNAME, getParameter(request, INCLUDEUNDEFINEDFEATUREDEPS_REQPARAM));

		request.setAttribute(ASSERTNONLS_REQATTRNAME, getParameter(request, ASSERTNONLS_REQPARAM));

		request.setAttribute(SERVEREXPANDLAYERS_REQATTRNAME, TypeUtil.asBoolean(getParameter(request, SERVEREXPANDLAYERS_REQPARAMS)));

		request.setAttribute(GENERATESOURCEMAPS_REQATTRNAME, TypeUtil.asBoolean(getParameter(request, GENERATESOURCEMAPS_REQPARAMS)));

		if (request.getParameter(CONFIGVARNAME_REQPARAM) != null) {
			request.setAttribute(CONFIGVARNAME_REQATTRNAME, request.getParameter(CONFIGVARNAME_REQPARAM));
		} else if (getAggregator().getConfig().getProperty(CONFIGVARNAME_REQPARAM, String.class) != null) {
			request.setAttribute(CONFIGVARNAME_REQATTRNAME, getAggregator().getConfig().getProperty(CONFIGVARNAME_REQPARAM, String.class).toString());
		}

		// SERVEREXPANDPLAYERS takes precedence over EXPANDREQUIRELISTS
		if (TypeUtil.asBoolean(request.getAttribute(SERVEREXPANDLAYERS_REQATTRNAME))) {
			request.removeAttribute(EXPANDREQUIRELISTS_REQATTRNAME);
		}
	}
933592
public void init (int invOid, int invCode, InvocationDirector invDir)
    {
        _invOid = invOid;
        _invCode = invCode;
        _invdir = invDir;
    }
1344814
def send_request(req=None, method=None, requires_response=True):
    """"""
    if req is None:
        return functools.partial(send_request, method=method,
                                 requires_response=requires_response)

    @functools.wraps(req)
    def wrapper(self, *args, **kwargs):
        params = req(self, *args, **kwargs)
        _id = self.send(method, params, requires_response)
        return _id
    wrapper._sends = method
    return wrapper
160681
protected void doSubscribe(javax.servlet.sip.SipServletRequest req) throws javax.servlet.ServletException, java.io.IOException{
    	if (req.isInitial())
			notImplemented(req);
    }
1252186
def send_requests(self, *args):
        
        threads = [ClientThread(self, req) for req in args]
        for t in threads:
            t.start()
        for t in threads:
            t.join()
        exceptions = [t.exception for t in threads if t.exception]
        if len(exceptions):
            raise exceptions[0]
        return [t.response for t in threads]
1012175
def send_request(self, request):
        """"""
        self.log.debug('send_request: in')

        message = {'callId': self.call_id, 'req': request}
        self.log.debug('send_request: %s', Pretty(message))
        self.send(json.dumps(message))

        call_id = self.call_id
        self.call_id += 1
        return call_id
1136285
def _send_unary_request(self, request):
        
        if request.ack_ids:
            self._client.acknowledge(
                subscription=self._subscription, ack_ids=list(request.ack_ids)
            )

        if request.modify_deadline_ack_ids:
            # Send ack_ids with the same deadline seconds together.
            deadline_to_ack_ids = collections.defaultdict(list)

            for n, ack_id in enumerate(request.modify_deadline_ack_ids):
                deadline = request.modify_deadline_seconds[n]
                deadline_to_ack_ids[deadline].append(ack_id)

            for deadline, ack_ids in six.iteritems(deadline_to_ack_ids):
                self._client.modify_ack_deadline(
                    subscription=self._subscription,
                    ack_ids=ack_ids,
                    ack_deadline_seconds=deadline,
                )

        _LOGGER.debug("Sent request(s) over unary RPC.")
1327086
def do_IHaveRequest(self, apdu):
        """"""
        if _debug: WhoHasIHaveServices._debug("do_IHaveRequest %r", apdu)

        # check for required parameters
        if apdu.deviceIdentifier is None:
            raise MissingRequiredParameter("deviceIdentifier required")
        if apdu.objectIdentifier is None:
            raise MissingRequiredParameter("objectIdentifier required")
        if apdu.objectName is None:
            raise MissingRequiredParameter("objectName required")
76322
def dispatch(self, request, *args, **kwargs):
        '''  '''

        if 'pk' in self.kwargs:
            try:
                self.invoices = Invoice.objects.filter(pk=self.kwargs.get('pk'))[:]
            except ValueError:
                raise Http404()
            if not self.invoices:
                raise Http404()
        else:
            ids = request.GET.get('invoices', '')
            try:
                self.invoices = Invoice.objects.filter(id__in=[x for x in ids.split(',')])[:]
            except ValueError:
                return HttpResponseBadRequest(_('Invalid invoice identifiers specified.'))

        if not self.invoices:
            return HttpResponseBadRequest(_('No invoice identifiers specified.'))

        toNotify = []
        cannotNotify = []

        for invoice in self.invoices:
            if invoice.get_default_recipients():
                toNotify.append(invoice)
            else:
                cannotNotify.append(invoice)
        self.toNotify = toNotify
        self.cannotNotify = cannotNotify

        return super(InvoiceNotificationView, self).dispatch(request, *args, **kwargs)
546356
def batch_call(self, calls):
        """"""
        req = self.protocol.create_batch_request()

        for call_args in calls:
            req.append(self.protocol.create_request(*call_args))

        return self._send_and_handle_reply(req)
460195
def _assemble_and_send_request(self):
        

        # We get an exception like this when specifying an IntegratorId:
        # suds.TypeNotFound: Type not found: 'IntegratorId'
        # Setting it to None does not seem to appease it.
        del self.ClientDetail.IntegratorId
        self.logger.debug(self.WebAuthenticationDetail)
        self.logger.debug(self.ClientDetail)
        self.logger.debug(self.TransactionDetail)
        self.logger.debug(self.VersionId)
        # Fire off the query.
        return self.client.service.validatePostal(
                WebAuthenticationDetail=self.WebAuthenticationDetail,
                ClientDetail=self.ClientDetail,
                TransactionDetail=self.TransactionDetail,
                Version=self.VersionId,
                Address=self.Address,
                ShipDateTime=self.ShipDateTime,
                CarrierCode=self.CarrierCode,
                CheckForMismatch=self.CheckForMismatch,
                RoutingCode=self.RoutingCode)
490738
public void describeMismatch(Invocation invocation, Description description) {
        describe(description, describedWith(expectations, invocation));
    }
339969
def request(self, msgtype, msgid, method, params=[]):
        """"""
        result = None
        error = None
        exception = None

        try:
            result = self.dispatch.call(method, params)
        except Exception as e:
            error = (e.__class__.__name__, str(e))
            exception = e

        if isinstance(result, Deferred):
            result.add_callback(self._result, msgid)
            result.add_errback(self._error, msgid)
        else:
            self.send_response(msgid, error, result)
7065
def _ops_to_requests(self, ops):
        
        request_ops = []
        for op in ops:
            if isinstance(op, transactions.Put):
                request = self._build_put_request(op.key, op.value,
                                                  op.lease, op.prev_kv)
                request_op = etcdrpc.RequestOp(request_put=request)
                request_ops.append(request_op)

            elif isinstance(op, transactions.Get):
                request = self._build_get_range_request(op.key, op.range_end)
                request_op = etcdrpc.RequestOp(request_range=request)
                request_ops.append(request_op)

            elif isinstance(op, transactions.Delete):
                request = self._build_delete_request(op.key, op.range_end,
                                                     op.prev_kv)
                request_op = etcdrpc.RequestOp(request_delete_range=request)
                request_ops.append(request_op)

            elif isinstance(op, transactions.Txn):
                compare = [c.build_message() for c in op.compare]
                success_ops = self._ops_to_requests(op.success)
                failure_ops = self._ops_to_requests(op.failure)
                request = etcdrpc.TxnRequest(compare=compare,
                                             success=success_ops,
                                             failure=failure_ops)
                request_op = etcdrpc.RequestOp(request_txn=request)
                request_ops.append(request_op)

            else:
                raise Exception(
                    'Unknown request class {}'.format(op.__class__))
        return request_ops
1305096
private Object invoke(ServiceRequestContext ctx, HttpRequest req, @Nullable AggregatedHttpMessage message) {
        try (SafeCloseable ignored = ctx.push(false)) {
            final ResolverContext resolverContext = new ResolverContext(ctx, req, message);
            final Object[] arguments = toArguments(resolvers, resolverContext);
            return method.invoke(object, arguments);
        } catch (Throwable cause) {
            return exceptionHandler.handleException(ctx, req, cause);
        }
    }
848319
def _request(self, method, uri_relative, request_bytes, params,
                 custom_headers):
        

        uri_relative_with_params = self._append_params_to_uri(uri_relative,
                                                              params)
        if uri_relative not in self._URIS_NOT_REQUIRING_ACTIVE_SESSION:
            if self._api_context.ensure_session_active():
                from bunq.sdk.context import BunqContext

                BunqContext.update_api_context(self._api_context)

        all_headers = self._get_all_headers(
            method,
            uri_relative_with_params,
            request_bytes,
            custom_headers
        )

        response = requests.request(
            method,
            self._get_uri_full(uri_relative_with_params),
            data=request_bytes,
            headers=all_headers,
            proxies={self._FIELD_PROXY_HTTPS: self._api_context.proxy_url},
        )

        self._assert_response_success(response)

        if self._api_context.installation_context is not None:
            security.validate_response(
                self._api_context.installation_context.public_key_server,
                response.status_code,
                response.content,
                response.headers
            )

        return self._create_bunq_response_raw(response)