| | |
| | | |
| | | public class PrefixedDataAvailableHandleImp implements PrefixedDataAvailableHandle { |
| | | |
| | | private static Logger log = LogManager.getLogger(PrefixedDataAvailableHandleImp.class) ; |
| | | private static final Logger log = LogManager.getLogger(PrefixedDataAvailableHandleImp.class) ; |
| | | |
| | | |
| | | /** |
| | | * 在多线程环境中运行 |
| | | * 分析上线数据(网络连接后第一包数据)是否可获得 |
| | | * @param in |
| | | * @return |
| | | * @throws Exception |
| | | * @param in IoBuffer |
| | | * @return PrefixedDataAvailableStatus |
| | | */ |
| | | public PrefixedDataAvailableStatus forOnLine(IoBuffer in){ |
| | | int remain = in.remaining() ; |
| | |
| | | |
| | | HashMap<String, AnnotationPrefixedDataAvailableVo> prefixedDataAvailableMap = ProtocolCach.getPrefixedDataAvailableMap() ; |
| | | Collection<AnnotationPrefixedDataAvailableVo> set = prefixedDataAvailableMap.values() ; |
| | | if(set == null || set.size() == 0){ |
| | | if(set.size() == 0){ |
| | | throw new Exception("上线数据完整性检查时,得到的协议完整性检查类集合为空。") ; |
| | | } |
| | | int prority = ProtocolConstant.firstPriority ; |
| | |
| | | /** |
| | | * 在多线程环境中运行 |
| | | * 分析上行数据(网络连接后第二(包含)包以后数据)是否可获得 |
| | | * @param in |
| | | * @param clientProtocol |
| | | * @param maxDataLength |
| | | * @return |
| | | * @throws Exception |
| | | * @param in IoBuffer |
| | | * @return PrefixedDataAvailableStatus |
| | | */ |
| | | public PrefixedDataAvailableStatus forUpData(IoBuffer in){ |
| | | int remain = in.remaining() ; |
| | |
| | | |
| | | HashMap<String, AnnotationPrefixedDataAvailableVo> prefixedDataAvailableMap = ProtocolCach.getPrefixedDataAvailableMap() ; |
| | | Collection<AnnotationPrefixedDataAvailableVo> set = prefixedDataAvailableMap.values() ; |
| | | if(set == null || set.size() == 0){ |
| | | if(set.size() == 0){ |
| | | throw new Exception("上线数据完整性检查时,得到的协议集合为空。") ; |
| | | } |
| | | int prority = ProtocolConstant.firstPriority ; |
| | |
| | | |
| | | /** |
| | | * 得到处理类对象 |
| | | * @param prority |
| | | * @param set |
| | | * @return |
| | | * @throws Exception |
| | | * @param prority 优先级 |
| | | * @param set 集合 |
| | | * @return Object[] |
| | | * @throws Exception 异常 |
| | | */ |
| | | private Object[] getClassObjAndAnnotationVo(int prority, Collection<AnnotationPrefixedDataAvailableVo> set) throws Exception{ |
| | | PrefixedDataAvailable obj = null ; |