@Component public class ControllerContext extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
private BitactorApplicationProperties |
bitactorApplicationProperties |
protected ConcurrentHashMap<Integer,MappingInfo> |
COMMAND_ID_BY_APP_GROUP_JSON |
protected ConcurrentHashMap<Integer,MappingInfo> |
COMMAND_ID_BY_APP_GROUP_PROTO |
private ConnectManager |
connectManager |
private List<ConnectorMsgHandler> |
connectorMsgHandlers |
protected ConcurrentHashMap<Integer,ControllerInvoker> |
CONTROLLER_JSON_INVOKER_MAP |
protected ConcurrentHashMap<Integer,ControllerInvoker> |
CONTROLLER_PROTO_INVOKER_MAP |
protected Set<String> |
controllerList |
private static com.bitactor.framework.core.logger.Logger |
logger |
| 构造器和说明 |
|---|
ControllerContext() |
private static final com.bitactor.framework.core.logger.Logger logger
protected final ConcurrentHashMap<Integer,MappingInfo> COMMAND_ID_BY_APP_GROUP_JSON
protected final ConcurrentHashMap<Integer,MappingInfo> COMMAND_ID_BY_APP_GROUP_PROTO
protected final ConcurrentHashMap<Integer,ControllerInvoker> CONTROLLER_JSON_INVOKER_MAP
protected final ConcurrentHashMap<Integer,ControllerInvoker> CONTROLLER_PROTO_INVOKER_MAP
@Autowired(required=false) private List<ConnectorMsgHandler> connectorMsgHandlers
@Autowired(required=false) private ConnectManager connectManager
@Autowired private BitactorApplicationProperties bitactorApplicationProperties
public BitactorApplicationProperties getBitactorApplicationProperties()
public void addControllerBean(Object bean)
bean - private void addControllerInvoker(ControllerInvoker invoker) throws IllegalAccessException
public void boundCommandIdToAppGroup(MappingInfo mappingInfo)
mappingInfo - public void boundCommandIdToAppGroup(List<MappingInfo> mappingInfos)
public MappingInfo buildMappingInfo(ControllerInvoker invoker)
invoker - public boolean existInvoker(int commandId,
ProtocolType protocolType)
commandId - protocolType - public ControllerInvoker get(int commandId, ProtocolType protocolType)
commandId - 命令idpublic MappingInfo getBackendMapping(int commandId, ProtocolType protocolType)
commandId - protocolType - public boolean existMapping(int commandId,
ProtocolType protocolType)
commandId - protocolType - public void doConnectRequest(com.bitactor.framework.core.net.api.Channel channel,
ClientNetSession session,
MessageConnectorData messageMvcData)
public MessageBytes buildErrorMessageByte(Throwable exception, int msgErrorType, ClientNetSession session, ProtocolType type, int msgId, int commandId)
exception - msgErrorType - session - type - msgId - commandId - public boolean checkNeedAuth(ClientNetSession session)
session - public MappingReqParam buildRequestMethodArgs(ClientNetSession session, Method method, BitactorRequestMapping mapping, byte[] msg) throws Exception
public ConcurrentHashMap<Integer,ControllerInvoker> getControllerJsonInvoker()
public ConcurrentHashMap<Integer,ControllerInvoker> getControllerProtoInvoker()
Copyright © 2021. All rights reserved.