@Override public void dispatchSendMessage(TBase<?, ?> tBase) { // mark accepted time acceptedTimeService.accept(); // TODO consider to change dispatch table automatically SimpleHandler simpleHandler = getSimpleHandler(tBase); if (simpleHandler != null) { if (logger.isTraceEnabled()) { logger.trace("simpleHandler name:{}", simpleHandler.getClass().getName()); } simpleHandler.handleSimple(tBase); return; } Handler handler = getHandler(tBase); if (handler != null) { if (logger.isTraceEnabled()) { logger.trace("handler name:{}", handler.getClass().getName()); } handler.handle(tBase); return; } throw new UnsupportedOperationException( "Handler not found. Unknown type of data received. tBase=" + tBase); }
public TBase dispatchRequestMessage(TBase<?, ?> tBase) { // mark accepted time acceptedTimeService.accept(); RequestResponseHandler requestResponseHandler = getRequestResponseHandler(tBase); if (requestResponseHandler != null) { if (logger.isTraceEnabled()) { logger.trace("requestResponseHandler name:{}", requestResponseHandler.getClass().getName()); } return requestResponseHandler.handleRequest(tBase); } throw new UnsupportedOperationException( "Handler not found. Unknown type of data received. tBase=" + tBase); }