商品编码支付接口
@param requ 支付请求类
@param handler 支付结果回调
772902
public void productPay(ProductPayRequest requ, final ProductPayHandler handler) {
        HMSAgentLog.i("productPay:requ=" + StrUtils.objDesc(requ) + "  handler=" + StrUtils.objDesc(handler));

        if (payReq != null) {
            HMSAgentLog.e("productPay:has already a pay to dispose");
            if (handler != null) {
                new Handler(Looper.getMainLooper()).post(new CallbackResultRunnable<ProductPayResultInfo>(handler, HMSAgent.AgentResultCode.REQUEST_REPEATED, null));
            }
            return;
        }

        this.payReq = requ;
        this.handler = handler;
        retryTimes = MAX_RETRY_TIMES;
        connect();
    }
1303500
function handler(req, res, next) {
    next = next || send

    if (pending) return pending.once('ready', function(err) {
      if (err) return next(err)
      return handler(req, res, next)
    })

    if (prevError) return next(prevError)

    res.setHeader('content-type', 'text/css')
    return next(null, buffer)

    function send(err, body) {
      if (err) return res.emit(err)
      res.end(body)
    }
  }
512502
public static View handle(WxHandler wxHandler, HttpServletRequest req, String key)
            throws IOException {
        if (wxHandler == null) {
            log.info("WxHandler is NULL");
            return HttpStatusView.HTTP_502;
        }
        String signature = req.getParameter("signature");
        String timestamp = req.getParameter("timestamp");
        String nonce = req.getParameter("nonce");
        String msg_signature = req.getParameter("msg_signature");
        String encrypt_type = req.getParameter("encrypt_type");
        if (!wxHandler.check(signature, timestamp, nonce, key)) {
            log.info("token is invalid");
            return HttpStatusView.HTTP_502;
        }
        if ("GET".equalsIgnoreCase(req.getMethod())) {
            String echostr = req.getParameter("echostr");
            log.info("GET? return echostr=" + echostr);
            return new ViewWrapper(new RawView(null), echostr);
        }
        String postData = Streams.readAndClose(new InputStreamReader(req.getInputStream(),
                                                                     Encoding.CHARSET_UTF8));

        if ("aes".equals(encrypt_type)) {
            WXBizMsgCrypt msgCrypt = wxHandler.getMsgCrypt();
            try {
                // 若抛出Illegal key size,请更新JDK的加密库为不限制长度
                postData = msgCrypt.decryptMsg(msg_signature, timestamp, nonce, postData);
            }
            catch (AesException e) {
                return new HttpStatusView(403);
            }
        }
        WxInMsg in = Wxs.convert(postData);
        in.setExtkey(key);
        WxOutMsg out = wxHandler.handle(in);
        if (out != null) {
            Wxs.fix(in, out);
        }
        return new ViewWrapper(WxView.me, out);
    }
328938
def handle(self, handler):
        
        with self._hlock:
            self._handler_list.append(handler)
        return self
789346
function handler(req, next) {
  var conf = this.configure();
  var pkg = this.package();
  var copyright = conf.copyright || (pkg ? pkg.copyright : null);
  var opts = [this._version];
  var msg = this._name + ' %s';

  // NOTE: allows deferring to this handler from a custom handler
  if(arguments.length > 1 && typeof(next) !== 'function') {
    opts = opts.concat([].slice.call(arguments, 1));
  }
  opts.unshift(msg);
  // respect vanilla help setting
  if(conf.help.vanilla) {
    opts = [util.format.apply(util, opts)];
  }
  console.log.apply(console, opts);
  if(copyright) {
    console.log();
    copyright = '' + copyright;
    copyright = wrap(copyright, 0, conf.help.maximum);
    console.log(copyright);
  }
  if(conf.exit && req !== true) process.exit();
  return false;
}
641342
public void addHandler(Handler handler) {
        if (null == handlers) {
            handlers = new ArrayList<>();
        }
        handlers.add(handler);
    }
754231
final void addHandler(final HttpHandler handler) {
    if (handler != null) {
      if (!eventHandlers.containsKey(handler.getUriSpecification().toLowerCase())) {
        eventHandlers.put(handler.getUriSpecification().toLowerCase(), handler);
      } else {
        LOG.log(Level.WARNING, "JettyHandler handle is already registered: {0} ", handler.getUriSpecification());
      }
    }
  }
615268
function handler(req, res) {

  var parsedUrl = url.parse(req.url)
  var callback = qs.parse(parsedUrl.query).callback
  var filename = decodeURI(parsedUrl.path.substr(1).split('?')[0])
  var basename = path.basename(filename.split('?')[0])
  var extname = path.extname(basename)
  var response = reswrap(res);
  var notfound = function() {
    response.writeHead(404, 'text').end('');
  };

  if (req.method === 'GET' && parsedUrl.pathname === '/jsonp-request') {
    if (!!exitCountdown) {
      exitCountdown.restart();
    }

    response
      .writeHead(200, 'js')
      .end(callback +'('+ R.get('stamp') +')');

    return;
  }

  var serve;
  if (/^\/template/.test(parsedUrl.pathname)) {
    serve = check(join(__dirname, '..', filename))
  } else if (/^\/node_modules/.test(parsedUrl.pathname)) {
    serve = check(join(__dirname, '..', filename))
  }
  if (serve) {
    serve.pass(function(name, type) {
      response
        .writeHead(200, extname.substr(1))
        .pipeWith(fs.createReadStream(
          path.resolve(name)
        ))
    }).fail(notfound);
    return;
  }

  if (/^\.(md|mkd|markdown|html)$/.test(extname)) {
    check(filename)
      .pass(function() {
        response
          .writeHead(200, 'html')
          .end(template.render({
            title: basename,
            highlight: R.get('highlight') || 'default',
            theme: getTheme(R.get('css')),
            width: R.get('width'),
            body: parser.parse(read(path.resolve(filename)))
          }));
      }).fail(notfound);

    return;
  }

  // Image or some other resources.
  check(filename)
    .pass(function(name) {
      response
        .writeHead(200, name)
        .pipeWith(fs.createReadStream(name));
    }).fail(notfound)
}
666029
public void setHandler(Object handler){
        if(handler instanceof ContentHandler)
            setContentHandler((ContentHandler)handler);
        if(handler instanceof EntityResolver)
            setEntityResolver((EntityResolver)handler);
        if(handler instanceof ErrorHandler)
            setErrorHandler((ErrorHandler)handler);
        if(handler instanceof DTDHandler)
            setDTDHandler((DTDHandler)handler);
        if(handler instanceof LexicalHandler)
            setLexicalHandler((LexicalHandler)handler);
        if(handler instanceof DeclHandler)
            setDeclHandler((DeclHandler)handler);
    }
1254452
private static void registerMiddlewareHandler(Object handler) {
		if(handler instanceof MiddlewareHandler) {
			// register the middleware handler if it is enabled.
			if(((MiddlewareHandler) handler).isEnabled()) {
				((MiddlewareHandler) handler).register();
			}
		}
	}
533453
public void addHandler(AbstractHandler handler) {
    HandlerList handlers = new HandlerList();
    handlers.addHandler(handler);
    for (Handler h : mServer.getHandlers()) {
      handlers.addHandler(h);
    }
    mServer.setHandler(handlers);
  }
118311
public static RequestToken fetchAll(BaasHandler<List<BaasUser>> handler) {
        return fetchAll(null, RequestOptions.DEFAULT, handler);
    }
99831
public void getOrderDetail(OrderRequest request, GetOrderHandler handler) {
        HMSAgentLog.i("getOrderDetail:request=" + StrUtils.objDesc(request) + "  handler=" + StrUtils.objDesc(handler));
        this.checkPayReq = request;
        this.handler = handler;
        this.retryTimes = MAX_RETRY_TIMES;
        connect();
    }
487540
public final boolean handle(HttpServletRequest req, HttpServletResponse res) {
		return handle(req, res, Request.getPath(req));
	}
1069454
public void handlerAppears( IMonitoringHandler handler ) {

		if( handler != null ) {
			this.logger.info( "Monitoring handler '" + handler.getName() + "' is now available." );
			this.handlers.add( handler );
			listHandlers( this.handlers, this.logger );
		}
	}
613900
public CompositeHandler withQueryHandler(final QueryHandler handler) {
        if (handler == null) {
            throw new IllegalArgumentException();
        } // end of if

        // ---

        return new CompositeHandler(this.queryDetection,
                                    handler,
                                    this.updateHandler);
        
    }
997149
private static void initStringDefinedHandler(String handler) {
		// split the class name and its label, if defined
		Tuple<String, Class> namedClass = splitClassAndName(handler);

		// create an instance of the handler
		Object handlerOrProviderObject = null;
		try {
			handlerOrProviderObject = namedClass.second.newInstance();
		} catch (Exception e) {
			logger.error("Exception:", e);
			throw new RuntimeException("Could not instantiate handler class: " + namedClass.second);
		}

		HttpHandler resolvedHandler;
		if (handlerOrProviderObject instanceof HttpHandler) {
			resolvedHandler = (HttpHandler) handlerOrProviderObject;
		} else if (handlerOrProviderObject instanceof HandlerProvider) {
			resolvedHandler = ((HandlerProvider) handlerOrProviderObject).getHandler();
		} else {
			throw new RuntimeException("Unsupported type of handler provided: " + handlerOrProviderObject);
		}
		registerMiddlewareHandler(resolvedHandler);
		handlers.put(namedClass.first, resolvedHandler);
		handlerListById.put(namedClass.first, Collections.singletonList(resolvedHandler));
	}