proj_name stringclasses 131
values | relative_path stringlengths 30 228 | class_name stringlengths 1 68 | func_name stringlengths 1 48 | masked_class stringlengths 78 9.82k | func_body stringlengths 46 9.61k | len_input int64 29 2.01k | len_output int64 14 1.94k | total int64 55 2.05k | relevant_context stringlengths 0 38.4k |
|---|---|---|---|---|---|---|---|---|---|
jeequan_jeepay | jeepay/jeepay-payment/src/main/java/com/jeequan/jeepay/pay/mq/ResetIsvMchAppInfoMQReceiver.java | ResetIsvMchAppInfoMQReceiver | modifyMchApp | class ResetIsvMchAppInfoMQReceiver implements ResetIsvMchAppInfoConfigMQ.IMQReceiver {
@Autowired
private ConfigContextService configContextService;
@Override
public void receive(ResetIsvMchAppInfoConfigMQ.MsgPayload payload) {
if(payload.getResetType() == ResetIsvMchAppInfoConfigMQ.RESET_TYP... |
log.info("成功接收 [商户应用支付参数配置信息] 的消息, mchNo={}, appId={}", mchNo, appId);
configContextService.initMchAppConfigContext(mchNo, appId);
log.info(" [商户应用支付参数配置信息] 已重置");
| 491 | 83 | 574 | <no_super_class> |
jeequan_jeepay | jeepay/jeepay-payment/src/main/java/com/jeequan/jeepay/pay/rqrs/division/DivisionReceiverBindRS.java | DivisionReceiverBindRS | buildByRecord | class DivisionReceiverBindRS extends AbstractRS {
/**
* 分账接收者ID
*/
private Long receiverId;
/**
* 接收者账号别名
*/
private String receiverAlias;
/**
* 组ID(便于商户接口使用)
*/
private Long receiverGroupId;
/**
* 商户号
*/
private String mchNo;
/**
* ... |
if(record == null){
return null;
}
DivisionReceiverBindRS result = new DivisionReceiverBindRS();
BeanUtils.copyProperties(record, result);
result.setBindSuccessTime(record.getBindSuccessTime() != null ? record.getBindSuccessTime().getTime() : null);
return... | 528 | 89 | 617 | <methods>public non-sealed void <init>() ,public java.lang.String toJSONString() <variables> |
jeequan_jeepay | jeepay/jeepay-payment/src/main/java/com/jeequan/jeepay/pay/rqrs/payorder/CommonPayDataRS.java | CommonPayDataRS | buildPayData | class CommonPayDataRS extends UnifiedOrderRS {
/** 跳转地址 **/
private String payUrl;
/** 二维码地址 **/
private String codeUrl;
/** 二维码图片地址 **/
private String codeImgUrl;
/** 表单内容 **/
private String formContent;
@Override
public String buildPayDataType(){
if(StringUtils.is... |
if(StringUtils.isNotEmpty(payUrl)){
return payUrl;
}
if(StringUtils.isNotEmpty(codeUrl)){
return codeUrl;
}
if(StringUtils.isNotEmpty(codeImgUrl)){
return codeImgUrl;
}
if(StringUtils.isNotEmpty(formContent)){
r... | 288 | 108 | 396 | <methods>public non-sealed void <init>() ,public java.lang.String buildPayData() ,public java.lang.String buildPayDataType() <variables>private com.jeequan.jeepay.pay.rqrs.msg.ChannelRetMsg channelRetMsg,private java.lang.String errCode,private java.lang.String errMsg,private java.lang.String mchOrderNo,private java.la... |
jeequan_jeepay | jeepay/jeepay-payment/src/main/java/com/jeequan/jeepay/pay/rqrs/payorder/QueryPayOrderRS.java | QueryPayOrderRS | buildByPayOrder | class QueryPayOrderRS extends AbstractRS {
/**
* 支付订单号
*/
private String payOrderId;
/**
* 商户号
*/
private String mchNo;
/**
* 商户应用ID
*/
private String appId;
/**
* 商户订单号
*/
private String mchOrderNo;
/**
* 支付接口代码
*/
private S... |
if(payOrder == null){
return null;
}
QueryPayOrderRS result = new QueryPayOrderRS();
BeanUtils.copyProperties(payOrder, result);
result.setSuccessTime(payOrder.getSuccessTime() == null ? null : payOrder.getSuccessTime().getTime());
result.setCreatedAt(payOr... | 496 | 116 | 612 | <methods>public non-sealed void <init>() ,public java.lang.String toJSONString() <variables> |
jeequan_jeepay | jeepay/jeepay-payment/src/main/java/com/jeequan/jeepay/pay/rqrs/refund/QueryRefundOrderRS.java | QueryRefundOrderRS | buildByRefundOrder | class QueryRefundOrderRS extends AbstractRS {
/**
* 退款订单号(支付系统生成订单号)
*/
private String refundOrderId;
/**
* 支付订单号(与t_pay_order对应)
*/
private String payOrderId;
/**
* 商户号
*/
private String mchNo;
/**
* 应用ID
*/
private String appId;
/**
... |
if(refundOrder == null){
return null;
}
QueryRefundOrderRS result = new QueryRefundOrderRS();
BeanUtils.copyProperties(refundOrder, result);
result.setSuccessTime(refundOrder.getSuccessTime() == null ? null : refundOrder.getSuccessTime().getTime());
result.... | 450 | 121 | 571 | <methods>public non-sealed void <init>() ,public java.lang.String toJSONString() <variables> |
jeequan_jeepay | jeepay/jeepay-payment/src/main/java/com/jeequan/jeepay/pay/rqrs/refund/RefundOrderRS.java | RefundOrderRS | buildByRefundOrder | class RefundOrderRS extends AbstractRS {
/** 支付系统退款订单号 **/
private String refundOrderId;
/** 商户发起的退款订单号 **/
private String mchRefundNo;
/** 订单支付金额 **/
private Long payAmount;
/** 申请退款金额 **/
private Long refundAmount;
/** 退款状态 **/
private Byte state;
/** 渠道退款单号 **/
... |
if(refundOrder == null){
return null;
}
RefundOrderRS result = new RefundOrderRS();
BeanUtils.copyProperties(refundOrder, result);
return result;
| 209 | 58 | 267 | <methods>public non-sealed void <init>() ,public java.lang.String toJSONString() <variables> |
jeequan_jeepay | jeepay/jeepay-payment/src/main/java/com/jeequan/jeepay/pay/rqrs/transfer/QueryTransferOrderRS.java | QueryTransferOrderRS | buildByRecord | class QueryTransferOrderRS extends AbstractRS {
/**
* 转账订单号
*/
private String transferId;
/**
* 商户号
*/
private String mchNo;
/**
* 应用ID
*/
private String appId;
/**
* 商户订单号
*/
private String mchOrderNo;
/**
* 支付接口代码
*/
privat... |
if(record == null){
return null;
}
QueryTransferOrderRS result = new QueryTransferOrderRS();
BeanUtils.copyProperties(record, result);
result.setSuccessTime(record.getSuccessTime() == null ? null : record.getSuccessTime().getTime());
result.setCreatedAt(rec... | 573 | 111 | 684 | <methods>public non-sealed void <init>() ,public java.lang.String toJSONString() <variables> |
jeequan_jeepay | jeepay/jeepay-payment/src/main/java/com/jeequan/jeepay/pay/rqrs/transfer/TransferOrderRS.java | TransferOrderRS | buildByRecord | class TransferOrderRS extends AbstractRS {
/** 转账单号 **/
private String transferId;
/** 商户单号 **/
private String mchOrderNo;
/** 转账金额 **/
private Long amount;
/**
* 收款账号
*/
private String accountNo;
/**
* 收款人姓名
*/
private String accountName;
/**
... |
if(record == null){
return null;
}
TransferOrderRS result = new TransferOrderRS();
BeanUtils.copyProperties(record, result);
return result;
| 243 | 52 | 295 | <methods>public non-sealed void <init>() ,public java.lang.String toJSONString() <variables> |
jeequan_jeepay | jeepay/jeepay-payment/src/main/java/com/jeequan/jeepay/pay/service/ChannelOrderReissueService.java | ChannelOrderReissueService | processPayOrder | class ChannelOrderReissueService {
@Autowired private ConfigContextQueryService configContextQueryService;
@Autowired private PayOrderService payOrderService;
@Autowired private PayOrderProcessService payOrderProcessService;
@Autowired private RefundOrderProcessService refundOrderProcessService;
... |
try {
String payOrderId = payOrder.getPayOrderId();
//查询支付接口是否存在
IPayOrderQueryService queryService = SpringBeansUtil.getBean(payOrder.getIfCode() + "PayOrderQueryService", IPayOrderQueryService.class);
// 支付通道接口实现不存在
if(queryService == null){
... | 522 | 528 | 1,050 | <no_super_class> |
jeequan_jeepay | jeepay/jeepay-payment/src/main/java/com/jeequan/jeepay/pay/service/ConfigContextQueryService.java | ConfigContextQueryService | queryIsvParams | class ConfigContextQueryService {
@Autowired ConfigContextService configContextService;
@Autowired private MchInfoService mchInfoService;
@Autowired private MchAppService mchAppService;
@Autowired private PayInterfaceConfigService payInterfaceConfigService;
private boolean isCache(){
retur... |
if(isCache()){
IsvConfigContext isvConfigContext = configContextService.getIsvConfigContext(isvNo);
return isvConfigContext == null ? null : isvConfigContext.getIsvParamsByIfCode(ifCode);
}
// 查询商户的所有支持的参数配置
PayInterfaceConfig payInterfaceConfig = payInterfaceC... | 1,738 | 249 | 1,987 | <no_super_class> |
jeequan_jeepay | jeepay/jeepay-payment/src/main/java/com/jeequan/jeepay/pay/service/PayOrderProcessService.java | PayOrderProcessService | updatePayOrderAutoDivision | class PayOrderProcessService {
@Autowired private PayOrderService payOrderService;
@Autowired private PayMchNotifyService payMchNotifyService;
@Autowired private IMQSender mqSender;
/** 明确成功的处理逻辑(除更新订单其他业务) **/
public void confirmSuccess(PayOrder payOrder){
// 查询查询订单详情
payOrder =... |
try {
//默认不分账 || 其他非【自动分账】逻辑时, 不处理
if(payOrder == null || payOrder.getDivisionMode() == null || payOrder.getDivisionMode() != PayOrder.DIVISION_MODE_AUTO){
return ;
}
//更新订单表分账状态为: 等待分账任务处理
boolean updDivisionState = payOrderServic... | 260 | 318 | 578 | <no_super_class> |
jeequan_jeepay | jeepay/jeepay-payment/src/main/java/com/jeequan/jeepay/pay/service/RefundOrderProcessService.java | RefundOrderProcessService | handleRefundOrder4Channel | class RefundOrderProcessService {
@Autowired private RefundOrderService refundOrderService;
@Autowired private PayMchNotifyService payMchNotifyService;
/** 根据通道返回的状态,处理退款订单业务 **/
public boolean handleRefundOrder4Channel(ChannelRetMsg channelRetMsg, RefundOrder refundOrder){<FILL_FUNCTION_BODY>}
} |
boolean updateOrderSuccess = true; //默认更新成功
String refundOrderId = refundOrder.getRefundOrderId();
// 明确退款成功
if(channelRetMsg.getChannelState() == ChannelRetMsg.ChannelState.CONFIRM_SUCCESS) {
updateOrderSuccess = refundOrderService.updateIng2Success(refundOrderId, channelRe... | 103 | 334 | 437 | <no_super_class> |
jeequan_jeepay | jeepay/jeepay-payment/src/main/java/com/jeequan/jeepay/pay/service/TransferOrderReissueService.java | TransferOrderReissueService | processOrder | class TransferOrderReissueService {
@Autowired private ConfigContextQueryService configContextQueryService;
@Autowired private TransferOrderService transferOrderService;
@Autowired private PayMchNotifyService payMchNotifyService;
/** 处理转账订单 **/
public ChannelRetMsg processOrder(TransferOrder tran... |
try {
String transferId = transferOrder.getTransferId();
// 查询转账接口是否存在
ITransferService transferService = SpringBeansUtil.getBean(transferOrder.getIfCode() + "TransferService", ITransferService.class);
// 支付通道转账接口实现不存在
if(transferService == null){... | 892 | 530 | 1,422 | <no_super_class> |
jeequan_jeepay | jeepay/jeepay-payment/src/main/java/com/jeequan/jeepay/pay/service/ValidateService.java | ValidateService | validate | class ValidateService {
@Autowired private Validator validator;
public void validate(Object obj){<FILL_FUNCTION_BODY>}
} |
Set<ConstraintViolation<Object>> resultSet = validator.validate(obj);
if(resultSet == null || resultSet.isEmpty()){
return ;
}
resultSet.stream().forEach(item -> {throw new BizException(item.getMessage());});
| 44 | 71 | 115 | <no_super_class> |
jeequan_jeepay | jeepay/jeepay-payment/src/main/java/com/jeequan/jeepay/pay/task/PayOrderDivisionRecordReissueTask.java | PayOrderDivisionRecordReissueTask | start | class PayOrderDivisionRecordReissueTask {
private static final int QUERY_PAGE_SIZE = 100; //每次查询数量
@Autowired private PayOrderDivisionRecordService payOrderDivisionRecordService;
@Autowired private ConfigContextQueryService configContextQueryService;
@Autowired private PayOrderService payOrderService;... |
log.info("处理分账补单任务 开始");
//当前时间 减去5分钟。
Date offsetDate = DateUtil.offsetMinute(new Date(), -5);
//查询条件: 受理中的订单 & ( 订单创建时间 + 5分钟 >= 当前时间 )
LambdaQueryWrapper<PayOrderDivisionRecord> lambdaQueryWrapper = PayOrderDivisionRecord.gw().
eq(PayOrderDivisionRecord::ge... | 136 | 1,298 | 1,434 | <no_super_class> |
jeequan_jeepay | jeepay/jeepay-payment/src/main/java/com/jeequan/jeepay/pay/task/PayOrderReissueTask.java | PayOrderReissueTask | start | class PayOrderReissueTask {
private static final int QUERY_PAGE_SIZE = 100; //每次查询数量
@Autowired private PayOrderService payOrderService;
@Autowired private ChannelOrderReissueService channelOrderReissueService;
@Scheduled(cron="0 0/1 * * * ?") // 每分钟执行一次
public void start() {<FILL_FUNCTION_BODY>}... |
//当前时间 减去10分钟。
Date offsetDate = DateUtil.offsetMinute(new Date(), -10);
//查询条件: 支付中的订单 & ( 订单创建时间 + 10分钟 >= 当前时间 )
LambdaQueryWrapper<PayOrder> lambdaQueryWrapper = PayOrder.gw().eq(PayOrder::getState, PayOrder.STATE_ING).le(PayOrder::getCreatedAt, offsetDate);
int currentPa... | 117 | 355 | 472 | <no_super_class> |
jeequan_jeepay | jeepay/jeepay-payment/src/main/java/com/jeequan/jeepay/pay/task/RefundOrderReissueTask.java | RefundOrderReissueTask | start | class RefundOrderReissueTask {
private static final int QUERY_PAGE_SIZE = 100; //每次查询数量
@Autowired private RefundOrderService refundOrderService;
@Autowired private ChannelOrderReissueService channelOrderReissueService;
@Scheduled(cron="0 0/1 * * * ?") // 每分钟执行一次
public void start() {<FILL_FUNCTI... |
//查询条件: 退款中的订单
LambdaQueryWrapper<RefundOrder> lambdaQueryWrapper = RefundOrder.gw().eq(RefundOrder::getState, RefundOrder.STATE_ING);
int currentPageIndex = 1; //当前页码
while(true){
try {
IPage<RefundOrder> refundOrderIPage = refundOrderService.page(new Pag... | 119 | 301 | 420 | <no_super_class> |
jeequan_jeepay | jeepay/jeepay-payment/src/main/java/com/jeequan/jeepay/pay/task/TransferOrderReissueTask.java | TransferOrderReissueTask | start | class TransferOrderReissueTask {
private static final int QUERY_PAGE_SIZE = 100; //每次查询数量
@Autowired private TransferOrderService transferOrderService;
@Autowired private TransferOrderReissueService transferOrderReissueService;
@Scheduled(cron="0 0/1 * * * ?") // 每分钟执行一次
public void start() {<FIL... |
//查询条件:
LambdaQueryWrapper<TransferOrder> lambdaQueryWrapper = TransferOrder.gw()
.eq(TransferOrder::getState, TransferOrder.STATE_ING) // 转账中
.ge(TransferOrder::getCreatedAt, DateUtil.offsetDay(new Date(), -1)); // 只查询一天内的转账单;
int currentPageIndex = 1; //当前页码
... | 117 | 321 | 438 | <no_super_class> |
jeequan_jeepay | jeepay/jeepay-payment/src/main/java/com/jeequan/jeepay/pay/util/ApiResBuilder.java | ApiResBuilder | buildSuccess | class ApiResBuilder {
/** 构建自定义响应对象, 默认响应成功 **/
public static <T extends AbstractRS> T buildSuccess(Class<? extends AbstractRS> T){<FILL_FUNCTION_BODY>}
} |
try {
T result = (T)T.newInstance();
return result;
} catch (Exception e) { return null; }
| 66 | 40 | 106 | <no_super_class> |
jeequan_jeepay | jeepay/jeepay-payment/src/main/java/com/jeequan/jeepay/pay/util/ChannelCertConfigKitBean.java | ChannelCertConfigKitBean | downloadFile | class ChannelCertConfigKitBean {
@Autowired private OssYmlConfig ossYmlConfig;
@Autowired private IOssService ossService;
public String getCertFilePath(String certFilePath){
return getCertFile(certFilePath).getAbsolutePath();
}
public File getCertFile(String certFilePath){
File ce... |
//请求文件并写入
boolean isSuccess = ossService.downloadFile(OssSavePlaceEnum.PRIVATE, dbCertFilePath, certFile.getAbsolutePath());
// 下载成功 返回新的File对象
if(isSuccess) {
return new File(certFile.getAbsolutePath());
}
// 下载失败, 写入.notexists文件, 避免那下次再次下载影响效率。
... | 409 | 161 | 570 | <no_super_class> |
jeequan_jeepay | jeepay/jeepay-payment/src/main/java/com/jeequan/jeepay/pay/util/PaywayUtil.java | PaywayUtil | getRealPaywayV3Service | class PaywayUtil {
private static final String PAYWAY_PACKAGE_NAME = "payway";
private static final String PAYWAYV3_PACKAGE_NAME = "paywayV3";
/** 获取真实的支付方式Service **/
public static IPaymentService getRealPaywayService(Object obj, String wayCode){
try {
//下划线转换驼峰 & 首字母大写
... |
try {
//下划线转换驼峰 & 首字母大写
String clsName = StrUtil.upperFirst(StrUtil.toCamelCase(wayCode.toLowerCase()));
return (IPaymentService) SpringBeansUtil.getBean(
Class.forName(obj.getClass().getPackage().getName()
+ "." + PAYWAYV3_P... | 279 | 140 | 419 | <no_super_class> |
jeequan_jeepay | jeepay/jeepay-service/src/main/java/com/jeequan/jeepay/service/impl/IsvInfoService.java | IsvInfoService | removeByIsvNo | class IsvInfoService extends ServiceImpl<IsvInfoMapper, IsvInfo> {
@Autowired private MchInfoService mchInfoService;
@Autowired private IsvInfoService isvInfoService;
@Autowired private PayInterfaceConfigService payInterfaceConfigService;
@Transactional
public void removeByIsvNo(String isvNo) {<... |
// 0.当前服务商是否存在
IsvInfo isvInfo = isvInfoService.getById(isvNo);
if (isvInfo == null) {
throw new BizException("该服务商不存在");
}
// 1.查询当前服务商下是否存在商户
int mchCount = mchInfoService.count(MchInfo.gw().eq(MchInfo::getIsvNo, isvNo).eq(MchInfo::getType, CS.MCH_TYPE_ISV... | 107 | 298 | 405 | <no_super_class> |
jeequan_jeepay | jeepay/jeepay-service/src/main/java/com/jeequan/jeepay/service/impl/MchAppService.java | MchAppService | selectPage | class MchAppService extends ServiceImpl<MchAppMapper, MchApp> {
@Autowired private PayOrderService payOrderService;
@Autowired private MchPayPassageService mchPayPassageService;
@Autowired private PayInterfaceConfigService payInterfaceConfigService;
@Transactional(rollbackFor = Exception.class)
pu... |
LambdaQueryWrapper<MchApp> wrapper = MchApp.gw();
if (StringUtils.isNotBlank(mchApp.getMchNo())) {
wrapper.eq(MchApp::getMchNo, mchApp.getMchNo());
}
if (StringUtils.isNotEmpty(mchApp.getAppId())) {
wrapper.eq(MchApp::getAppId, mchApp.getAppId());
}
... | 556 | 289 | 845 | <no_super_class> |
jeequan_jeepay | jeepay/jeepay-service/src/main/java/com/jeequan/jeepay/service/impl/MchInfoService.java | MchInfoService | addMch | class MchInfoService extends ServiceImpl<MchInfoMapper, MchInfo> {
@Autowired private SysUserService sysUserService;
@Autowired private PayOrderService payOrderService;
@Autowired private MchPayPassageService mchPayPassageService;
@Autowired private PayInterfaceConfigService payInterfaceConfigServic... |
// 校验特邀商户信息
if (mchInfo.getType() == CS.MCH_TYPE_ISVSUB && StringUtils.isNotEmpty(mchInfo.getIsvNo())) {
// 当前服务商状态是否正确
IsvInfo isvInfo = isvInfoService.getById(mchInfo.getIsvNo());
if (isvInfo == null || isvInfo.getState() == CS.NO) {
throw new BizE... | 992 | 681 | 1,673 | <no_super_class> |
jeequan_jeepay | jeepay/jeepay-service/src/main/java/com/jeequan/jeepay/service/impl/MchPayPassageService.java | MchPayPassageService | selectAvailablePayInterfaceList | class MchPayPassageService extends ServiceImpl<MchPayPassageMapper, MchPayPassage> {
@Autowired private PayInterfaceDefineService payInterfaceDefineService;
/**
* @Author: ZhuXiao
* @Description: 根据支付方式查询可用的支付接口列表
* @Date: 9:56 2021/5/10
*/
public List<JSONObject> selectAvailablePayInte... |
Map params = new HashMap();
params.put("wayCode", wayCode);
params.put("appId", appId);
params.put("infoType", infoType);
params.put("mchType", mchType);
List<JSONObject> list = baseMapper.selectAvailablePayInterfaceList(params);
if (CollectionUtils.isEmpty(list)... | 810 | 366 | 1,176 | <no_super_class> |
jeequan_jeepay | jeepay/jeepay-service/src/main/java/com/jeequan/jeepay/service/impl/PayInterfaceConfigService.java | PayInterfaceConfigService | selectAllPayIfConfigListByAppId | class PayInterfaceConfigService extends ServiceImpl<PayInterfaceConfigMapper, PayInterfaceConfig> {
@Autowired
private PayInterfaceDefineService payInterfaceDefineService;
@Autowired
private MchInfoService mchInfoService;
@Autowired
private MchAppService mchAppService;
/**
* @Author... |
MchApp mchApp = mchAppService.getById(appId);
if (mchApp == null|| mchApp.getState() != CS.YES) {
throw new BizException(ApiCodeEnum.SYS_OPERATION_FAIL_SELETE);
}
MchInfo mchInfo = mchInfoService.getById(mchApp.getMchNo());
if (mchInfo == null || mchInfo.getState() ... | 783 | 863 | 1,646 | <no_super_class> |
jeequan_jeepay | jeepay/jeepay-service/src/main/java/com/jeequan/jeepay/service/impl/PayOrderDivisionRecordService.java | PayOrderDivisionRecordService | updateResendState | class PayOrderDivisionRecordService extends ServiceImpl<PayOrderDivisionRecordMapper, PayOrderDivisionRecord> {
@Autowired private PayOrderMapper payOrderMapper;
/** 更新分账记录为分账成功 ( 单条 ) 将: 已受理 更新为: 其他状态 **/
public void updateRecordSuccessOrFailBySingleItem(Long recordId, Byte state, String channelRe... |
PayOrder updateRecord = new PayOrder();
updateRecord.setDivisionState(PayOrder.DIVISION_STATE_WAIT_TASK);
// 更新订单
int payOrderUpdateRow = payOrderMapper.update(updateRecord, PayOrder.gw().eq(PayOrder::getPayOrderId, payOrderId).eq(PayOrder::getDivisionState, PayOrder.DIVISION_STATE_FI... | 519 | 355 | 874 | <no_super_class> |
jeequan_jeepay | jeepay/jeepay-service/src/main/java/com/jeequan/jeepay/service/impl/RefundOrderService.java | RefundOrderService | updateInit2Ing | class RefundOrderService extends ServiceImpl<RefundOrderMapper, RefundOrder> {
@Autowired private PayOrderMapper payOrderMapper;
/** 查询商户订单 **/
public RefundOrder queryMchOrder(String mchNo, String mchRefundNo, String refundOrderId){
if(StringUtils.isNotEmpty(refundOrderId)){
return g... |
RefundOrder updateRecord = new RefundOrder();
updateRecord.setState(RefundOrder.STATE_ING);
updateRecord.setChannelOrderNo(channelOrderNo);
return update(updateRecord, new LambdaUpdateWrapper<RefundOrder>()
.eq(RefundOrder::getRefundOrderId, refundOrderId).eq(RefundOrd... | 1,908 | 104 | 2,012 | <no_super_class> |
jeequan_jeepay | jeepay/jeepay-service/src/main/java/com/jeequan/jeepay/service/impl/SysConfigService.java | SysConfigService | updateByConfigKey | class SysConfigService extends ServiceImpl<SysConfigMapper, SysConfig> implements ISysConfigService {
/** 是否启用缓存
* true: 表示将使用内存缓存, 将部分系统配置项 或 商户应用/服务商信息进行缓存并读取
* false: 直接查询DB
* **/
public static boolean IS_USE_CACHE = false;
@Autowired
private SysConfigService sysConfigService;
/... |
int count = 0;
Set<String> set = updateMap.keySet();
for(String k : set) {
SysConfig sysConfig = new SysConfig();
sysConfig.setConfigKey(k);
sysConfig.setConfigVal(updateMap.get(k));
boolean update = sysConfigService.saveOrUpdate(sysConfig);
... | 564 | 113 | 677 | <no_super_class> |
jeequan_jeepay | jeepay/jeepay-service/src/main/java/com/jeequan/jeepay/service/impl/SysRoleEntRelaService.java | SysRoleEntRelaService | resetRela | class SysRoleEntRelaService extends ServiceImpl<SysRoleEntRelaMapper, SysRoleEntRela> {
@Autowired private SysEntitlementService sysEntitlementService;
/** 根据人查询出所有权限ID集合 */
public List<String> selectEntIdsByUserId(Long userId, Byte isAdmin, String sysType){
if(isAdmin == CS.YES){
... |
//1. 删除
this.remove(SysRoleEntRela.gw().eq(SysRoleEntRela::getRoleId, roleId));
//2. 插入
for (String entId : entIdList) {
SysRoleEntRela r = new SysRoleEntRela();
r.setRoleId(roleId); r.setEntId(entId);
this.save(r);
}
| 308 | 116 | 424 | <no_super_class> |
jeequan_jeepay | jeepay/jeepay-service/src/main/java/com/jeequan/jeepay/service/impl/SysRoleService.java | SysRoleService | removeRole | class SysRoleService extends ServiceImpl<SysRoleMapper, SysRole> {
@Autowired private SysUserRoleRelaService sysUserRoleRelaService;
@Autowired private SysRoleEntRelaService sysRoleEntRelaService;
/** 根据用户查询全部角色集合 **/
public List<String> findListByUser(Long sysUserId){
List<String> result = ... |
if(sysUserRoleRelaService.count(SysUserRoleRela.gw().eq(SysUserRoleRela::getRoleId, roleId)) > 0){
throw new BizException("当前角色已分配到用户, 不可删除!");
}
//删除当前表
removeById(roleId);
//删除关联表
sysRoleEntRelaService.remove(SysRoleEntRela.gw().eq(SysRoleEntRela::getRol... | 213 | 133 | 346 | <no_super_class> |
jeequan_jeepay | jeepay/jeepay-service/src/main/java/com/jeequan/jeepay/service/impl/SysUserAuthService.java | SysUserAuthService | resetAuthInfo | class SysUserAuthService extends ServiceImpl<SysUserAuthMapper, SysUserAuth> {
/** 根据登录信息查询用户认证信息 **/
public SysUserAuth selectByLogin(String identifier, Byte identityType, String sysType){
return baseMapper.selectByLogin(identifier, identityType, sysType);
}
/** 添加用户认证表 **/
@Transactiona... |
//更改登录用户名
// if(StringKit.isNotEmpty(authLoginUserName)){
// SysUserAuth updateRecord = new SysUserAuth();
// updateRecord.setIdentifier(authLoginUserName);
// update(updateRecord, SysUserAuth.gw().eq(SysUserAuth::getSystem, system).eq(SysUserAuth::getUserId, resetUserI... | 621 | 462 | 1,083 | <no_super_class> |
jeequan_jeepay | jeepay/jeepay-service/src/main/java/com/jeequan/jeepay/service/impl/SysUserService.java | SysUserService | addSysUser | class SysUserService extends ServiceImpl<SysUserMapper, SysUser> {
@Autowired private SysUserAuthService sysUserAuthService;
@Autowired private SysUserRoleRelaService sysUserRoleRelaService;
/** 添加系统用户 **/
@Transactional
public void addSysUser(SysUser sysUser, String sysType){<FILL_FUNCTION_BODY>... |
//判断获取到选择的角色集合
// String roleIdListStr = sysUser.extv().getString("roleIdListStr");
// if(StringKit.isEmpty(roleIdListStr)) throw new BizException("请选择角色信息!");
//
// List<String> roleIdList = JSONArray.parseArray(roleIdListStr, String.class);
// if(roleIdList.isEmpty()) throw new B... | 987 | 786 | 1,773 | <no_super_class> |
jeequan_jeepay | jeepay/jeepay-service/src/main/java/com/jeequan/jeepay/service/impl/TransferOrderService.java | TransferOrderService | pageList | class TransferOrderService extends ServiceImpl<TransferOrderMapper, TransferOrder> {
/** 更新转账订单状态 【转账订单生成】 --》 【转账中】 **/
public boolean updateInit2Ing(String transferId){
TransferOrder updateRecord = new TransferOrder();
updateRecord.setState(TransferOrder.STATE_ING);
return update(... |
if (StringUtils.isNotEmpty(transferOrder.getTransferId())) {
wrapper.eq(TransferOrder::getTransferId, transferOrder.getTransferId());
}
if (StringUtils.isNotEmpty(transferOrder.getMchOrderNo())) {
wrapper.eq(TransferOrder::getMchOrderNo, transferOrder.getMchOrderNo());
... | 945 | 537 | 1,482 | <no_super_class> |
jeequan_jeepay | jeepay/jeepay-z-codegen/src/main/java/com/gen/MainGen.java | MainGen | main | class MainGen {
public static final String THIS_MODULE_NAME = "jeepay-z-codegen"; //当前项目名称
public static final String DB_URL = "jdbc:mysql://127.0.0.1:3306/jeepay?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8";
public static final String DB_USERNAME = "root";
public static final Strin... |
// 代码生成器
AutoGenerator mpg = new AutoGenerator();
// 全局配置
GlobalConfig gc = new GlobalConfig();
String projectPath = System.getProperty("user.dir"); //获取当前项目的 文件夹地址
if(!projectPath.endsWith(THIS_MODULE_NAME)){ //解决IDEA中 项目目录问题
projectPath += File.separat... | 222 | 807 | 1,029 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/org/zeromq/ManagedContext.java | ManagedContext | close | class ManagedContext
{
static {
// Release ManagedSocket resources when catching SIGINT
Runtime.getRuntime().addShutdownHook(new Thread(() -> getInstance().close()));
}
private final Lock lock;
private final Ctx ctx;
private final Set<SocketBase> sockets;
... |
lock.lock();
try {
for (SocketBase s : sockets) {
try {
s.setSocketOpt(ZMQ.ZMQ_LINGER, 0);
s.close();
}
catch (Exception ignore) {
}
}
sockets.clear();
}
... | 416 | 98 | 514 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/org/zeromq/ZActor.java | Double | renews | class Double implements EventsHandler, Star
{
// poller used for the loop
private final ZPoller poller;
// control pipe for Backstage side
private final Socket pipe;
// managed sockets
private final List<Socket> sockets;
// actor responsible for processing ... |
// close every managed sockets
Iterator<Socket> iter = sockets.iterator();
while (iter.hasNext()) {
final Socket socket = iter.next();
iter.remove();
if (socket != null) {
poller.unregister(socket);
... | 648 | 138 | 786 | <methods>public transient void <init>(org.zeromq.ZAgent.SelectorCreator, org.zeromq.ZStar.Fortune, java.lang.String, java.lang.Object[]) ,public transient void <init>(org.zeromq.ZStar.Fortune, java.lang.String, java.lang.Object[]) ,public transient void <init>(org.zeromq.ZContext, org.zeromq.ZAgent.SelectorCreator, org... |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/org/zeromq/ZBeacon.java | Builder | build | class Builder
{
private InetAddress clientHost = DEFAULT_BROADCAST_HOST_ADDRESS;
private InetAddress serverAddr = DEFAULT_BROADCAST_ADDRESS;
private int port;
private long broadcastInterval = DEFAULT_BROADCAST_INTERVAL;
private byte[] beacon;
private ... |
ZBeacon zbeacon = new ZBeacon(clientHost, serverAddr, port, beacon, broadcastInterval, ignoreLocalAddress, blocking);
if (listener != null) {
zbeacon.setListener(listener);
}
if (prefix != null) {
zbeacon.setPrefix(prefix);
}
... | 816 | 164 | 980 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/org/zeromq/ZCert.java | ZCert | publicConfig | class ZCert
{
private final byte[] publicKey; // Public key in binary
private final byte[] secretKey; // Secret key in binary
private final String publicTxt; // Public key in Z85 text
private final String secretTxt; // S... |
ZConfig conf = new ZConfig("root", null);
add(metadata, conf);
conf.addComment(" ZeroMQ CURVE Public Certificate");
conf.addComment(" Exchange securely, or use a secure mechanism to verify the contents");
conf.addComment(" of this file after exchange. Store public certific... | 1,584 | 129 | 1,713 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/org/zeromq/ZCertStore.java | Hasher | visitFile | class Hasher implements Fingerprinter
{
// temporary buffer used for digest. Instance member for performance reasons.
private final byte[] buffer = new byte[8192];
@Override
public byte[] print(File path)
{
InputStream input = stream(path);
if (input ... |
try {
ZConfig zconf = ZConfig.load(file.getAbsolutePath());
String publicKey = zconf.getValue("curve/public-key");
if (publicKey == null) {
System.out.printf(
"Warning!! File %s... | 1,239 | 239 | 1,478 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/org/zeromq/ZEvent.java | ZEvent | equals | class ZEvent
{
/**
* An interface used to consume events in monitor
*/
public interface ZEventConsummer extends zmq.ZMQ.EventConsummer
{
void consume(ZEvent ev);
default void consume(zmq.ZMQ.Event event)
{
consume(new ZEvent(event, SelectableChannel.class::cast... |
if (this == o) {
return true;
}
else if (o == null || getClass() != o.getClass()) {
return false;
}
else {
ZEvent zEvent = (ZEvent) o;
return event == zEvent.event && Objects.equals(value, zEvent.value) && address.equals(zEvent.add... | 1,790 | 100 | 1,890 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/org/zeromq/ZLoop.java | STimer | addPoller | class STimer
{
final int delay;
int times;
final IZLoopHandler handler;
final Object arg;
long when; // Clock time when alarm goes off
public STimer(int delay, int times, IZLoopHandler handler, Object arg)
{
... |
if (pollItem.getRawSocket() == null && pollItem.getSocket() == null) {
return -1;
}
SPoller poller = new SPoller(pollItem, handler, arg);
pollers.add(poller);
dirty = true;
if (verbose) {
System.out.printf(
"I: zloo... | 996 | 166 | 1,162 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/org/zeromq/ZMonitor.java | MonitorActor | stage | class MonitorActor extends ZActor.SimpleActor
{
private static final String ERROR = "ERROR";
private static final String OK = "OK";
private final Socket monitored; // the monitored socket
private final String address; // the address where events will be collected
priva... |
final zmq.ZMQ.Event event = zmq.ZMQ.Event.read(socket.base());
assert (event != null);
final int code = event.event;
final String address = event.addr;
assert (address != null);
final Event type = Event.findByCode(code);
assert (type !... | 1,410 | 232 | 1,642 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/org/zeromq/ZProxy.java | State | start | class State
{
@Override
public String toString()
{
return "State [alive=" + alive + ", started=" + started + ", paused=" + paused + ", restart=" + restart
+ ", hot=" + hot + "]";
}
// are we alive ?
... |
boolean success = true;
if (!state.started) {
try {
success = false;
success |= provider.configure(frontend, Plug.FRONT, args);
success |= provider.configure(backend, Plug.BACK, args);
success |= pro... | 1,247 | 170 | 1,417 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/org/zeromq/ZStar.java | SimpleSet | lights | class SimpleSet implements Set
{
@Override
public boolean fire()
{
return Thread.currentThread().isInterrupted();
}
@Override
public void lights(String name, int id)
{<FILL_FUNCTION_BODY>}
public static String createDefaultName(final Stri... |
if (name == null) {
name = createDefaultName("Star-%d", id);
}
Thread.currentThread().setName(name);
| 107 | 42 | 149 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/org/zeromq/ZThread.java | ShimThread | fork | class ShimThread extends Thread
{
private ZContext ctx;
private IAttachedRunnable attachedRunnable;
private IDetachedRunnable detachedRunnable;
private final Object[] args;
private Socket pipe;
protected ShimThread(ZContext ctx, IAttachedRunnab... |
Socket pipe = ctx.createSocket(SocketType.PAIR);
assert (pipe != null);
pipe.bind(String.format(Locale.ENGLISH, "inproc://zctx-pipe-%d", pipe.hashCode()));
// Connect child pipe to our pipe
ZContext ccontext = ctx.shadow();
Socket cpipe = ccontext.createSocket(SocketTy... | 607 | 194 | 801 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/org/zeromq/ZTimer.java | Timer | add | class Timer
{
private final org.zeromq.timer.ZTimer.Timer delegate;
Timer(org.zeromq.timer.ZTimer.Timer delegate)
{
this.delegate = delegate;
}
}
/**
* @deprecated use {@link org.zeromq.timer.TimerHandler} instead
*/
@Deprecated
public interfac... |
if (handler == null) {
return null;
}
return new Timer(timer.add(interval, handler, args));
| 267 | 37 | 304 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/org/zeromq/proto/ZNeedle.java | ZNeedle | toString | class ZNeedle
{
private final ByteBuffer needle; // Read/write pointer for serialization
public ZNeedle(ZFrame frame)
{
this(frame.getData());
}
private ZNeedle(byte[] data)
{
needle = ByteBuffer.wrap(data);
}
private void checkAvailable(int size)
{
Utils.... |
return "ZNeedle [position=" + needle.position() + ", ceiling=" + needle.limit() + "]";
| 1,654 | 33 | 1,687 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/org/zeromq/timer/ZTicker.java | ZTicker | timeout | class ZTicker
{
private final ZTimer timer;
private final ZTicket ticket;
public ZTicker()
{
timer = new ZTimer();
ticket = new ZTicket();
}
ZTicker(Supplier<Long> clock)
{
timer = new ZTimer(clock);
ticket = new ZTicket(clock);
}
public Ticket add... |
long timer = this.timer.timeout();
long ticket = this.ticket.timeout();
if (timer < 0 || ticket < 0) {
return Math.max(timer, ticket);
}
else {
return Math.min(timer, ticket);
}
| 227 | 71 | 298 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/org/zeromq/timer/ZTicket.java | Ticket | add | class Ticket implements Comparable<Ticket>
{
private final ZTicket parent;
private final TimerHandler handler;
private final Object[] args;
private long start;
private long delay;
private boolean alive = true;
p... |
if (handler == null) {
return null;
}
Utils.checkArgument(delay > 0, "Delay of a ticket has to be strictly greater than 0");
final Ticket ticket = new Ticket(this, now(), delay, handler, args);
insert(ticket);
return ticket;
| 746 | 79 | 825 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/org/zeromq/timer/ZTimer.java | Timer | add | class Timer
{
private final Timers.Timer delegate;
Timer(Timers.Timer delegate)
{
this.delegate = delegate;
}
/**
* Changes the interval of the timer.
* <p>
* This method is slow, canceling existing and adding a new timer yield better ... |
if (handler == null) {
return null;
}
return new Timer(timer.add(interval, handler, args));
| 445 | 37 | 482 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/org/zeromq/util/ZData.java | ZData | toString | class ZData
{
private static final String HEX_CHAR = "0123456789ABCDEF";
private final byte[] data;
public ZData(byte[] data)
{
this.data = data;
}
/**
* String equals.
* Uses String compareTo for the comparison (lexigraphical)
* @param str String to compare with data
... |
if (data == null) {
return "";
}
// Dump message as text or hex-encoded string
boolean isText = true;
for (byte aData : data) {
if (aData < 32 || aData > 127) {
isText = false;
break;
}
}
if (isT... | 1,050 | 128 | 1,178 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/org/zeromq/util/ZDigest.java | ZDigest | update | class ZDigest
{
private final byte[] buffer;
private final MessageDigest sha1;
/**
* Creates a new digester.
*/
public ZDigest()
{
this(new byte[8192]);
}
/**
* Creates a new digester.
* @param buffer the temp buffer used for computation of streams.
*/
... |
int read = input.read(buffer);
while (read != -1) {
sha1.update(buffer, 0, read);
read = input.read(buffer);
}
return this;
| 349 | 58 | 407 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/org/zeromq/util/ZMetadata.java | ZMetadata | read | class ZMetadata
{
private final Metadata metadata;
public ZMetadata()
{
this(new Metadata());
}
public ZMetadata(Metadata metadata)
{
this.metadata = metadata;
}
public Set<String> keySet()
{
return metadata.keySet();
}
public String get(String key... |
if (meta == null || meta.isEmpty()) {
return null;
}
try {
ByteBuffer buffer = ZMQ.CHARSET.newEncoder().encode(CharBuffer.wrap(meta));
Metadata data = new Metadata();
data.read(buffer, 0, null);
return new ZMetadata(data);
}
... | 1,413 | 118 | 1,531 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/Command.java | Command | toString | class Command
{
// Object to process the command.
final ZObject destination;
final Type type;
final Object arg;
public enum Type
{
// Sent to I/O thread to let it know that it should
// terminate itself.
STOP,
// Sent to I/O object to make it register wit... |
return "Cmd" + "[" + destination + ", " + (destination == null ? "Reaper" : destination.getTid() + ", ") + type
+ (arg == null ? "" : ", " + arg) + "]";
| 779 | 59 | 838 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/Ctx.java | ChannelForwardHolder | terminate | class ChannelForwardHolder
{
private final AtomicInteger handleSource = new AtomicInteger(0);
private final Map<Integer, WeakReference<SelectableChannel>> map = new ConcurrentHashMap<>();
// The WeakReference is empty when the reference is empty, so keep a reverse empty to clean the direct m... |
slotSync.lock();
try {
// Connect up any pending inproc connections, otherwise we will hang
for (Entry<PendingConnection, String> pending : pendingConnections.entries()) {
SocketBase s = createSocket(ZMQ.ZMQ_PAIR);
// create_socket might fail eg: ... | 800 | 472 | 1,272 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/Mailbox.java | Mailbox | recv | class Mailbox implements IMailbox
{
// The pipe to store actual commands.
private final Deque<Command> cpipe;
// Signaler to pass signals from writer thread to reader thread.
// kept it although a ConcurrentLinkedDeque, because the signaler channel is used in many places.
private final Signaler s... |
Command cmd = cpipe.pollFirst();
while (cmd == null) {
// Wait for signal from the command sender.
boolean rc = signaler.waitEvent(timeout);
if (!rc) {
assert (errno.get() == ZError.EAGAIN || errno.get() == ZError.EINTR) : errno.get();
... | 352 | 188 | 540 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/MailboxSafe.java | MailboxSafe | recv | class MailboxSafe implements IMailbox
{
// The pipe to store actual commands.
private final YPipe<Command> cpipe;
// Synchronize access to the mailbox from receivers and senders
private final ReentrantLock sync;
// Condition variable to pass signals from writer thread to reader thread.
priv... |
Command cmd;
// Try to get the command straight away.
cmd = cpipe.read();
if (cmd != null) {
return cmd;
}
// If the timeout is zero, it will be quicker to release the lock, giving other a chance to send a command
// and immediately relock it.
... | 636 | 289 | 925 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/Msg.java | Builder | put | class Builder extends Msg
{
private final ByteArrayOutputStream out = new ByteArrayOutputStream();
public Builder()
{
super();
}
@Override
public int size()
{
return out.size();
}
@Override
protected Msg put(i... |
if (src == null) {
return this;
}
out.write(src, off, len);
setWriteIndex(getWriteIndex() + len);
return this;
| 421 | 50 | 471 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/Proxy.java | Proxy | start | class Proxy
{
public static boolean proxy(SocketBase frontend, SocketBase backend, SocketBase capture)
{
return new Proxy().start(frontend, backend, capture, null);
}
public static boolean proxy(SocketBase frontend, SocketBase backend, SocketBase capture, SocketBase control)
{
retur... |
// The algorithm below assumes ratio of requests and replies processed
// under full load to be 1:1.
// TODO: The current implementation drops messages when
// any of the pipes becomes full.
int rc;
int more;
Msg msg;
int count = control == null ? 2... | 578 | 933 | 1,511 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/Reaper.java | Reaper | processReaped | class Reaper extends ZObject implements IPollEvents, Closeable
{
// Reaper thread accesses incoming commands via this mailbox.
private final Mailbox mailbox;
// Handle associated with mailbox' file descriptor.
private final Poller.Handle mailboxHandle;
// I/O multiplexing is performed using a p... |
--socketsReaping;
// If reaped was already asked to terminate and there are no more sockets,
// finish immediately.
if (socketsReaping == 0 && terminating.get()) {
finishTerminating();
}
| 658 | 66 | 724 | <methods>public final zmq.Ctx getCtx() ,public final int getTid() <variables>private final non-sealed zmq.Ctx ctx,private int tid |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/Signaler.java | Signaler | recv | class Signaler implements Closeable
{
private interface IoOperation<O>
{
O call() throws IOException;
}
// Underlying write & read file descriptor.
private final Pipe.SinkChannel w;
private final Pipe.SourceChannel r;
private final Selector selector;
private final T... |
int nbytes = 0;
// On windows, there may be a need to try several times until it succeeds
while (nbytes == 0) {
try {
rdummy.get().clear();
nbytes = maksInterrupt(() -> r.read(rdummy.get()));
}
catch (ClosedChannelException e) ... | 1,355 | 150 | 1,505 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/ZError.java | IOException | exccode | class IOException extends UncheckedZMQException
{
private static final long serialVersionUID = 9202470691157986262L;
public IOException(java.io.IOException e)
{
super(e);
}
}
public static final int ENOENT = 2;
public static final int EINTR ... |
if (e instanceof SocketException) {
return ESOCKET;
}
else if (e instanceof ClosedByInterruptException) {
return EINTR;
}
else if (e instanceof ClosedChannelException) {
return ENOTCONN;
}
else {
return EIOEXC;
... | 802 | 89 | 891 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/io/HelloMsgSession.java | HelloMsgSession | pullMsg | class HelloMsgSession extends SessionBase
{
boolean newPipe;
public HelloMsgSession(IOThread ioThread, boolean connect, SocketBase socket, Options options, Address addr)
{
super(ioThread, connect, socket, options, addr);
newPipe = true;
}
@Override
protected Msg pullMsg()
{... |
if (newPipe) {
newPipe = false;
return options.helloMsg;
}
return super.pullMsg();
| 136 | 40 | 176 | <methods>public void <init>(zmq.io.IOThread, boolean, zmq.SocketBase, zmq.Options, zmq.io.net.Address) ,public void attachPipe(zmq.pipe.Pipe) ,public void destroy() ,public void engineError(boolean, zmq.io.StreamEngine.ErrorReason) ,public void flush() ,public java.lang.String getEndpoint() ,public zmq.SocketBase getSo... |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/io/IOThread.java | IOThread | inEvent | class IOThread extends ZObject implements IPollEvents, Closeable
{
// I/O thread accesses incoming commands via this mailbox.
private final Mailbox mailbox;
// Handle associated with mailbox' file descriptor.
private final Poller.Handle mailboxHandle;
// I/O multiplexing is performed using a po... |
// TODO: Do we want to limit number of commands I/O thread can
// process in a single go?
while (true) {
// Get the next command. If there is none, exit.
Command cmd = mailbox.recv(0);
if (cmd == null) {
break;
}
/... | 429 | 103 | 532 | <methods>public final zmq.Ctx getCtx() ,public final int getTid() <variables>private final non-sealed zmq.Ctx ctx,private int tid |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/io/Msgs.java | Msgs | startsWith | class Msgs
{
private Msgs()
{
// no possible instantiation
}
/**
* Checks if the message starts with the given string.
*
* @param msg the message to check.
* @param data the string to check the message with. Shall be shorter than 256 characters.
* @param includeLength t... |
final int length = data.length();
assert (length < 256);
int start = includeLength ? 1 : 0;
if (msg.size() < length + start) {
return false;
}
boolean comparison = !includeLength || length == (msg.get(0) & 0xff);
if (comparison) {
for (in... | 163 | 156 | 319 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/io/coder/Decoder.java | OneByteSizeReady | sizeReady | class OneByteSizeReady implements Step
{
@Override
public Step.Result apply()
{
return oneByteSizeReady();
}
}
protected final long maxmsgsize;
// the message decoded so far
protected Msg inProgress;
protected final Step oneByteSizeReady = new One... |
// Message size must not exceed the maximum allowed size.
if (maxmsgsize >= 0) {
if (size > maxmsgsize) {
errno(ZError.EMSGSIZE);
return Step.Result.ERROR;
}
}
// Message size must fit within range of size_t data type.
i... | 236 | 203 | 439 | <methods>public void <init>(zmq.util.Errno, int) ,public zmq.io.coder.IDecoder.Step.Result decode(java.nio.ByteBuffer, int, ValueReference<java.lang.Integer>) ,public void destroy() ,public int errno() ,public java.nio.ByteBuffer getBuffer() <variables>private final non-sealed java.nio.ByteBuffer buf,private final non-... |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/io/coder/DecoderBase.java | DecoderBase | nextStep | class DecoderBase implements IDecoder
{
// Where to store the read data.
private ByteBuffer readPos;
// TODO V4 remove zeroCopy boolean
private boolean zeroCopy;
// How much data to read before taking next step.
private int toRead;
// The buffer for data to decode.
private final int... |
readPos = ByteBuffer.wrap(buf);
readPos.limit(toRead);
this.toRead = toRead;
this.next = next;
| 1,078 | 43 | 1,121 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/io/coder/EncoderBase.java | EncoderBase | encode | class EncoderBase implements IEncoder
{
// Where to get the data to write from.
private ByteBuffer writeBuf;
// Next step. If set to null, it means that associated data stream
// is dead.
private Runnable next;
// If true, first byte of the message is being written.
private boolean new... |
int bufferSize = size;
ByteBuffer buf = data.get();
if (buf == null) {
buf = this.buffer;
bufferSize = this.bufferSize;
buffer.clear();
}
if (inProgress == null) {
return 0;
}
int pos = 0;
buf.limit(buf.c... | 933 | 567 | 1,500 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/io/coder/v1/V1Decoder.java | V1Decoder | oneByteSizeReady | class V1Decoder extends Decoder
{
private final ByteBuffer tmpbuf;
public V1Decoder(Errno errno, int bufsize, long maxmsgsize, MsgAllocator allocator)
{
super(errno, bufsize, maxmsgsize, allocator);
tmpbuf = ByteBuffer.allocate(8);
tmpbuf.limit(1);
// At the beginning, re... |
// First byte of size is read. If it is 0xff read 8-byte size.
// Otherwise allocate the buffer for message data and read the
// message data into it.
int size = tmpbuf.get(0) & 0xff;
if (size == 0xff) {
tmpbuf.position(0);
tmpbuf.limit(8);
... | 575 | 256 | 831 | <methods>public void <init>(zmq.util.Errno, int, long, zmq.msg.MsgAllocator) ,public zmq.Msg msg() <variables>private final non-sealed zmq.msg.MsgAllocator allocator,protected final zmq.io.coder.IDecoder.Step eightByteSizeReady,protected final zmq.io.coder.IDecoder.Step flagsReady,protected zmq.Msg inProgress,protected... |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/io/coder/v1/V1Encoder.java | V1Encoder | messageReady | class V1Encoder extends Encoder
{
private final ByteBuffer tmpbufWrap;
public V1Encoder(Errno errno, int bufsize)
{
super(errno, bufsize);
tmpbufWrap = ByteBuffer.allocate(10);
// Write 0 bytes to the batch and go to messageReady state.
initStep(messageReady, true);
}
... |
// Get the message size.
int size = inProgress.size();
// Account for the 'flags' byte.
size++;
// For messages less than 255 bytes long, write one byte of message size.
// For longer messages write 0xff escape character followed by 8-byte
// message size.... | 177 | 240 | 417 | <methods><variables>protected final java.lang.Runnable messageReady,protected final java.lang.Runnable sizeReady |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/io/coder/v2/V2Decoder.java | V2Decoder | flagsReady | class V2Decoder extends Decoder
{
private final ByteBuffer tmpbuf;
private int msgFlags;
public V2Decoder(Errno errno, int bufsize, long maxmsgsize, MsgAllocator allocator)
{
super(errno, bufsize, maxmsgsize, allocator);
tmpbuf = ByteBuffer.allocate(8);
tmpbuf.limit(1);
... |
// Store the flags from the wire into the message structure.
this.msgFlags = 0;
int first = tmpbuf.get(0) & 0xff;
if ((first & V2Protocol.MORE_FLAG) > 0) {
this.msgFlags |= Msg.MORE;
}
if ((first & V2Protocol.COMMAND_FLAG) > 0) {
this.msgFlags |=... | 537 | 241 | 778 | <methods>public void <init>(zmq.util.Errno, int, long, zmq.msg.MsgAllocator) ,public zmq.Msg msg() <variables>private final non-sealed zmq.msg.MsgAllocator allocator,protected final zmq.io.coder.IDecoder.Step eightByteSizeReady,protected final zmq.io.coder.IDecoder.Step flagsReady,protected zmq.Msg inProgress,protected... |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/io/coder/v2/V2Encoder.java | V2Encoder | messageReady | class V2Encoder extends Encoder
{
private final ByteBuffer tmpbufWrap;
public V2Encoder(Errno errno, int bufsize)
{
super(errno, bufsize);
tmpbufWrap = ByteBuffer.allocate(9);
// Write 0 bytes to the batch and go to messageReady state.
initStep(messageReady, true);
}
... |
// Encode flags.
byte protocolFlags = 0;
if (inProgress.hasMore()) {
protocolFlags |= V2Protocol.MORE_FLAG;
}
if (inProgress.size() > 255) {
protocolFlags |= V2Protocol.LARGE_FLAG;
}
if (inProgress.isCommand()) {
protocolFlag... | 176 | 292 | 468 | <methods><variables>protected final java.lang.Runnable messageReady,protected final java.lang.Runnable sizeReady |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/io/mechanism/NullMechanism.java | NullMechanism | nextHandshakeCommand | class NullMechanism extends Mechanism
{
private static final String OK = "200";
private static final String READY = "READY";
private static final String ERROR = "ERROR";
private boolean readyCommandSent;
private boolean errorCommandSent;
private boolean readyCommandReceived;
private boo... |
if (readyCommandSent || errorCommandSent) {
return ZError.EAGAIN;
}
if (zapConnected && !zapReplyReceived) {
if (zapRequestSent) {
return ZError.EAGAIN;
}
sendZapRequest(Mechanisms.NULL, false);
zapRequestSent = true;... | 782 | 350 | 1,132 | <methods>public zmq.Msg decode(zmq.Msg) ,public void destroy() ,public zmq.Msg encode(zmq.Msg) ,public final zmq.util.Blob getUserId() ,public abstract int nextHandshakeCommand(zmq.Msg) ,public final zmq.Msg peerIdentity() ,public abstract int processHandshakeCommand(zmq.Msg) ,public abstract zmq.io.mechanism.Mechanism... |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/io/mechanism/curve/Curve.java | Curve | keypair | class Curve
{
enum Size
{
NONCE {
@Override
public int bytes()
{
return curve25519xsalsa20poly1305.crypto_secretbox_NONCEBYTES;
}
},
ZERO {
@Override
public int bytes()
{
r... |
byte[][] pair = new byte[2][];
byte[] publicKey = new byte[Size.PUBLICKEY.bytes()];
byte[] secretKey = new byte[Size.SECRETKEY.bytes()];
int rc = curve25519xsalsa20poly1305.crypto_box_keypair(publicKey, secretKey);
assert (rc == 0);
pair[0] = publicKey;
pair[1... | 1,773 | 130 | 1,903 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/io/mechanism/plain/PlainClientMechanism.java | PlainClientMechanism | nextHandshakeCommand | class PlainClientMechanism extends Mechanism
{
private enum State
{
SENDING_HELLO,
WAITING_FOR_WELCOME,
SENDING_INITIATE,
WAITING_FOR_READY,
ERROR_COMMAND_RECEIVED,
READY
}
private State state;
public PlainClientMechanism(SessionBase session, Options... |
int rc;
switch (state) {
case SENDING_HELLO:
rc = produceHello(msg);
if (rc == 0) {
state = State.WAITING_FOR_WELCOME;
}
break;
case SENDING_INITIATE:
rc = produceInitiate(msg);
if (rc == 0) {
... | 1,087 | 154 | 1,241 | <methods>public zmq.Msg decode(zmq.Msg) ,public void destroy() ,public zmq.Msg encode(zmq.Msg) ,public final zmq.util.Blob getUserId() ,public abstract int nextHandshakeCommand(zmq.Msg) ,public final zmq.Msg peerIdentity() ,public abstract int processHandshakeCommand(zmq.Msg) ,public abstract zmq.io.mechanism.Mechanism... |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/io/mechanism/plain/PlainServerMechanism.java | PlainServerMechanism | produceHello | class PlainServerMechanism extends Mechanism
{
private enum State
{
WAITING_FOR_HELLO,
SENDING_WELCOME,
WAITING_FOR_INITIATE,
SENDING_READY,
WAITING_FOR_ZAP_REPLY,
SENDING_ERROR,
ERROR_COMMAND_SENT,
READY
}
private State state;
public... |
int bytesLeft = msg.size();
int index = 0;
if (bytesLeft < 6 || !compare(msg, "HELLO", true)) {
return ZError.EPROTO;
}
bytesLeft -= 6;
index += 6;
if (bytesLeft < 1) {
return ZError.EPROTO;
}
byte length = msg.get(index);
... | 1,264 | 505 | 1,769 | <methods>public zmq.Msg decode(zmq.Msg) ,public void destroy() ,public zmq.Msg encode(zmq.Msg) ,public final zmq.util.Blob getUserId() ,public abstract int nextHandshakeCommand(zmq.Msg) ,public final zmq.Msg peerIdentity() ,public abstract int processHandshakeCommand(zmq.Msg) ,public abstract zmq.io.mechanism.Mechanism... |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/io/net/Address.java | Address | toString | class Address
{
public interface IZAddress
{
ProtocolFamily family();
String toString(int port);
InetSocketAddress resolve(String name, boolean ipv6, boolean local);
SocketAddress address();
SocketAddress sourceAddress();
}
private final NetProtocol protocol;... |
if (isResolved()) {
return resolved.toString();
}
else if (protocol != null && !address.isEmpty()) {
return protocol.name() + "://" + address;
}
else {
return "";
}
| 544 | 66 | 610 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/io/net/ipc/IpcAddress.java | IpcAddressMask | resolve | class IpcAddressMask extends TcpAddress
{
public IpcAddressMask(String addr, boolean ipv6)
{
super(addr, ipv6);
}
public boolean matchAddress(SocketAddress addr)
{
return address().equals(addr);
}
}
private String nam... |
this.name = name;
int hash = name.hashCode();
if ("*".equals(name)) {
hash = 0;
}
else {
if (hash < 0) {
hash = -hash;
}
hash = hash % 55536;
hash += 10000;
}
return new InetSocketAddre... | 378 | 113 | 491 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/io/net/ipc/IpcListener.java | IpcListener | setAddress | class IpcListener extends TcpListener
{
private IpcAddress address;
public IpcListener(IOThread ioThread, SocketBase socket, final Options options)
{
super(ioThread, socket, options);
}
// Get the bound address for use with wildcards
@Override
public String getAddress()
{
... |
address = new IpcAddress(addr);
InetSocketAddress sock = (InetSocketAddress) address.address();
return super.setAddress(sock);
| 170 | 45 | 215 | <methods>public void <init>(zmq.io.IOThread, zmq.SocketBase, zmq.Options) ,public void acceptEvent() ,public void destroy() ,public java.lang.String getAddress() ,public boolean setAddress(java.lang.String) ,public java.lang.String toString() <variables>private zmq.io.net.tcp.TcpAddress address,private java.lang.String... |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/io/net/ipc/IpcNetworkProtocolProvider.java | IpcNetworkProtocolProvider | startConnecting | class IpcNetworkProtocolProvider implements NetworkProtocolProvider
{
@Override
public boolean handleProtocol(NetProtocol protocol)
{
return protocol == NetProtocol.ipc;
}
@Override
public Listener getListener(IOThread ioThread, SocketBase socket,
Options... |
IpcConnecter connecter = new IpcConnecter(ioThread, session, options, addr, delayedStart);
launchChild.accept(connecter);
| 255 | 40 | 295 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/io/net/norm/NormNetworkProtocolProvider.java | NormNetworkProtocolProvider | startConnecting | class NormNetworkProtocolProvider implements NetworkProtocolProvider
{
@Override
public boolean handleProtocol(NetProtocol protocol)
{
// TODO Auto-generated method stub
return false;
}
@Override
public Listener getListener(IOThread ioThread, SocketBase socket,
... |
// At this point we'll create message pipes to the session straight
// away. There's no point in delaying it as no concept of 'connect'
// exists with NORM anyway.
if (options.type == ZMQ.ZMQ_PUB || options.type == ZMQ.ZMQ_XPUB) {
// NORM sender.
NormEngine n... | 239 | 224 | 463 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/io/net/pgm/PgmNetworkProtocolProvider.java | PgmNetworkProtocolProvider | startConnecting | class PgmNetworkProtocolProvider implements NetworkProtocolProvider
{
@Override
public boolean handleProtocol(NetProtocol protocol)
{
return protocol == NetProtocol.pgm;
}
@Override
public Listener getListener(IOThread ioThread, SocketBase socket,
Options... |
assert (options.type == ZMQ.ZMQ_PUB || options.type == ZMQ.ZMQ_XPUB || options.type == ZMQ.ZMQ_SUB
|| options.type == ZMQ.ZMQ_XSUB);
// For EPGM transport with UDP encapsulation of PGM is used.
boolean udpEncapsulation = withUdpEncapsulation();
... | 241 | 352 | 593 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/io/net/tcp/SocksConnecter.java | SocksConnecter | processTerm | class SocksConnecter extends TcpConnecter
{
private enum Status
{
UNPLUGGED,
WAITING_FOR_RECONNECT_TIME,
WAITING_FOR_PROXY_CONNECTION,
SENDING_GREETING,
WAITING_FOR_CHOICE,
SENDING_REQUEST,
WAITING_FOR_RESPONSE
}
Status status;
// String repr... |
switch (status) {
case UNPLUGGED:
break;
case WAITING_FOR_RECONNECT_TIME:
ioObject.cancelTimer(RECONNECT_TIMER_ID);
break;
case WAITING_FOR_PROXY_CONNECTION:
case SENDING_GREETING:
case WAITING_FOR_CHOICE:
case SENDING_REQUEST:... | 732 | 156 | 888 | <methods>public void <init>(zmq.io.IOThread, zmq.io.SessionBase, zmq.Options, zmq.io.net.Address, boolean) ,public void connectEvent() ,public void inEvent() ,public void outEvent() ,public void timerEvent(int) ,public java.lang.String toString() <variables>protected static final int RECONNECT_TIMER_ID,private final no... |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/io/net/tcp/TcpAddress.java | TcpAddressMask | resolve | class TcpAddressMask extends TcpAddress
{
public TcpAddressMask(String addr, boolean ipv6)
{
super(addr, ipv6);
}
public boolean matchAddress(SocketAddress addr)
{
return address().equals(addr);
}
}
private final InetSocketAddress add... |
// Find the ':' at end that separates address from the port number.
int delimiter = name.lastIndexOf(':');
if (delimiter < 0) {
throw new IllegalArgumentException(name);
}
// Separate the address/port.
String addrStr = name.substring(0, delimiter);
... | 596 | 672 | 1,268 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/io/net/tcp/TcpNetworkProtocolProvider.java | TcpNetworkProtocolProvider | formatSocketAddress | class TcpNetworkProtocolProvider implements NetworkProtocolProvider
{
@Override
public boolean handleProtocol(NetProtocol protocol)
{
return protocol == NetProtocol.tcp;
}
@Override
public Listener getListener(IOThread ioThread, SocketBase socket,
Options... |
InetSocketAddress isa = (InetSocketAddress) socketAddress;
return isa.getAddress().getHostAddress() + ":" + isa.getPort();
| 440 | 44 | 484 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/io/net/tcp/TcpUtils.java | TcpUtils | tuneTcpKeepalives | class TcpUtils
{
private TcpUtils()
{
}
// The explicit IOException is useless, but kept for API compatibility
public static void tuneTcpSocket(Channel channel) throws IOException
{
// Disable Nagle's algorithm. We are doing data batching on 0MQ level,
// so using Nagle wouldn't... |
if (tcpKeepAlive != -1) {
if (channel instanceof SocketChannel) {
setOption(channel, StandardSocketOptions.SO_KEEPALIVE, tcpKeepAlive == 1);
}
if (tcpKeepAlive == 1) {
if (tcpKeepAliveCnt > 0) {
setOption(channel, ExtendedS... | 758 | 215 | 973 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/io/net/tipc/TipcNetworkProtocolProvider.java | TipcNetworkProtocolProvider | startConnecting | class TipcNetworkProtocolProvider implements NetworkProtocolProvider
{
@Override
public boolean handleProtocol(NetProtocol protocol)
{
// TODO Auto-generated method stub
return false;
}
@Override
public Listener getListener(IOThread ioThread, SocketBase socket,
... |
TipcConnecter connecter = new TipcConnecter(ioThread, session, options, addr, delayedStart);
launchChild.accept(connecter);
| 239 | 40 | 279 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/msg/MsgAllocatorThreshold.java | MsgAllocatorThreshold | allocate | class MsgAllocatorThreshold implements MsgAllocator
{
private static final MsgAllocator direct = new MsgAllocatorDirect();
private static final MsgAllocator heap = new MsgAllocatorHeap();
public final int threshold;
public MsgAllocatorThreshold()
{
this(Config.MSG_ALLOCATION_HEAP_THRESHO... |
if (threshold > 0 && size > threshold) {
return direct.allocate(size);
}
else {
return heap.allocate(size);
}
| 162 | 47 | 209 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/pipe/DBuffer.java | DBuffer | read | class DBuffer<T extends Msg>
{
private T back;
private T front;
private final Lock sync = new ReentrantLock();
private boolean hasMsg;
public T back()
{
return back;
}
public T front()
{
return front;
}
void write(T msg)
{
assert (msg.check())... |
sync.lock();
try {
if (!hasMsg) {
return null;
}
assert (front.check());
// TODO front->init (); // avoid double free
hasMsg = false;
return front;
}
finally {
sync.unlock();
... | 261 | 82 | 343 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/pipe/YPipe.java | YPipe | write | class YPipe<T> implements YPipeBase<T>
{
// Allocation-efficient queue to store pipe items.
// Front of the queue points to the first prefetched item, back of
// the pipe points to last un-flushed item. Front is used only by
// reader thread, while back is used only by writer thread.
private fin... |
// Place the value to the queue, add new terminator element.
queue.push(value);
// Move the "flush up to here" pointer.
if (!incomplete) {
f = queue.backPos();
}
| 1,253 | 63 | 1,316 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/pipe/YPipeConflate.java | YPipeConflate | read | class YPipeConflate<T extends Msg> implements YPipeBase<T>
{
private boolean readerAwake;
private final DBuffer<T> dbuffer = new DBuffer<>();
// Following function (write) deliberately copies uninitialised data
// when used with zmq_msg. Initialising the VSM body for
// non-VSM messages won't b... |
// Try to prefetch a value.
if (!checkRead()) {
return null;
}
// There was at least one value prefetched.
// Return it to the caller.
return dbuffer.read();
| 459 | 65 | 524 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/pipe/YQueue.java | Chunk | push | class Chunk<T>
{
final T[] values;
final int[] pos;
Chunk<T> prev;
Chunk<T> next;
@SuppressWarnings("unchecked")
public Chunk(int size, int memoryPtr)
{
values = (T[]) new Object[size];
pos = new int[size];
for (int... |
backChunk.values[backPos] = val;
backChunk = endChunk;
backPos = endPos;
if (++endPos != size) {
return;
}
Chunk<T> sc = spareChunk;
if (sc != beginChunk) {
spareChunk = spareChunk.next;
endChunk.next = sc;
sc.pre... | 649 | 181 | 830 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/poll/PollItem.java | PollItem | getChannel | class PollItem
{
private final SocketBase socket;
private final SelectableChannel channel;
private final int zinterest;
private final int interest;
private int ready;
public PollItem(SocketBase socket, int ops)
{
this(socket, nu... |
if (socket != null) {
// If the poll item is a 0MQ socket we are interested in input on the
// notification file descriptor retrieved by the ZMQ_FD socket option.
return socket.getFD();
}
else {
// Else, the poll item is a raw file descriptor. ... | 1,038 | 110 | 1,148 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/poll/Poller.java | Handle | hashCode | class Handle
{
private final SelectableChannel fd;
private final IPollEvents handler;
private int ops;
private boolean cancelled;
public Handle(SelectableChannel fd, IPollEvents handler)
{
assert (fd != null);
assert (handler != nul... |
final int prime = 31;
int result = 1;
result = prime * result + fd.hashCode();
result = prime * result + handler.hashCode();
return result;
| 264 | 51 | 315 | <methods>public void addTimer(long, zmq.poll.IPollEvents, int) ,public void cancelTimer(zmq.poll.IPollEvents, int) ,public final int getLoad() <variables>private boolean changed,private final java.util.concurrent.atomic.AtomicInteger load,private final MultiMap<java.lang.Long,zmq.poll.PollerBase.TimerInfo> timers,prote... |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/poll/PollerBase.java | TimerInfo | toString | class TimerInfo
{
private final IPollEvents sink;
private final int id;
private boolean cancelled;
public TimerInfo(IPollEvents sink, int id)
{
assert (sink != null);
this.sink = sink;
this.id = id;
}
@Override
... |
return "TimerInfo [id=" + id + ", sink=" + sink + "]";
| 284 | 26 | 310 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/socket/Channel.java | Channel | xsend | class Channel extends SocketBase
{
private Pipe pipe;
private Pipe lastIn;
private Blob savedCredential;
public Channel(Ctx parent, int tid, int sid)
{
super(parent, tid, sid, true);
options.type = ZMQ.ZMQ_CHANNEL;
}
@Override
protected void destroy()
{
sup... |
// CHANNEL sockets do not allow multipart data (ZMQ_SNDMORE)
if (msg.hasMore()) {
errno.set(ZError.EINVAL);
return false;
}
if (pipe == null || !pipe.write(msg)) {
errno.set(ZError.EAGAIN);
return false;
}
pipe.flush();
... | 797 | 113 | 910 | <methods>public final boolean bind(java.lang.String) ,public final void cancel(java.util.concurrent.atomic.AtomicBoolean) ,public final void close() ,public final boolean connect(java.lang.String) ,public final int connectPeer(java.lang.String) ,public boolean disconnectPeer(int) ,public final int errno() ,public final... |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/socket/FQ.java | FQ | recvPipe | class FQ
{
// Inbound pipes.
private final List<Pipe> pipes;
// Number of active pipes. All the active pipes are located at the
// beginning of the pipes array.
private int active;
// the last pipe we received message from.
// NULL when no message has been received or the pipe
// ... |
// Round-robin over the pipes to get the next message.
while (active > 0) {
// Try to fetch new message. If we've already read part of the message
// subsequent part should be immediately available.
final Pipe currentPipe = pipes.get(current);
final Ms... | 800 | 380 | 1,180 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/socket/LB.java | LB | terminated | class LB
{
// List of outbound pipes.
private final List<Pipe> pipes;
// Number of active pipes. All the active pipes are located at the
// beginning of the pipes array.
private int active;
// Points to the last pipe that the most recent message was sent to.
private int current;
/... |
final int index = pipes.indexOf(pipe);
// If we are in the middle of multipart message and current pipe
// have disconnected, we have to drop the remainder of the message.
if (index == current && more) {
dropping = true;
}
// Remove the pipe from the lis... | 800 | 150 | 950 | <no_super_class> |
zeromq_jeromq | jeromq/jeromq-core/src/main/java/zmq/socket/Pair.java | Pair | xreadActivated | class Pair extends SocketBase
{
private Pipe pipe;
private Pipe lastIn;
private Blob savedCredential;
public Pair(Ctx parent, int tid, int sid)
{
super(parent, tid, sid);
options.type = ZMQ.ZMQ_PAIR;
}
@Override
protected void destroy()
{
super.destroy();
... |
// There's just one pipe. No lists of active and inactive pipes.
// There's nothing to do here.
| 762 | 35 | 797 | <methods>public final boolean bind(java.lang.String) ,public final void cancel(java.util.concurrent.atomic.AtomicBoolean) ,public final void close() ,public final boolean connect(java.lang.String) ,public final int connectPeer(java.lang.String) ,public boolean disconnectPeer(int) ,public final int errno() ,public final... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.