publicstaticEntryentry(Stringname,EntryTypetrafficType,intbatc
hCount,Object...args)
throwsBlockException{
returnEnv.sph.entry(name,trafficType,batchCount,args);
}
publicEntryentry(Stringname,EntryTypetype,intcount,Object...a
rgs)throwsBlockException{
//将资源名称和流量类型进行包装
StringResourceWrapperresource=newStringResourceWrapper(name,t
ype);
returnentry(resource,count,args);
}
privateEntryentryWithPriority(ResourceWrapperresourceWrapper,intc
ount,booleanprioritized,Object...args)
throwsBlockException{
//这里前往当前线程持有的 context
Contextcontext=ContextUtil.getContext();
if(contextinstanceofNullContext){
returnnewCtEntry(resourceWrapper,null,context);
}
if(context==null){
//为空创建一个默认
context=InternalContextUtil.internalEnter(Constants.CONTEXT_
DEFAULT_NAME);
}
//全局开关不进行规章检查
if(!Constants.ON){
returnnewCtEntry(resourceWrapper,null,context);
}
//添加一个规章检查调用链
ProcessorSlotchain=lookProcessChain(resourceWrapper);
//创建一个流量入口,将 contextcurEntry 进行指定
Entrye=newCtEntry(resourceWrapper,chain,context);
try{
//开头规章检查
chain.entry(context,resourceWrapper,null,count,prioritized
,args);