public class AppView implements Display public AppView(HandlerFactory factory) { ToolStripButton addButton = new ToolStripButton(); addButton.addClickHandler(factory.create(Action.ADD)); /* More interfacy stuff */ } public void openDrawer(String text) { /*Some implementation*/ } public void closeDrawer() { /*Some implementation*/ }
final AsyncFilterChain.ResponseTrigger responseTrigger, final AsyncFilterChain chain) throws HttpException, IOException { final AsyncServerExchangeHandler exchangeHandler = handlerFactory.create(request, context); if (exchangeHandler != null) { exchangeHandler.handleRequest(request, entityDetails, new ResponseChannel() {
final AsyncFilterChain.ResponseTrigger responseTrigger, final AsyncFilterChain chain) throws HttpException, IOException { final AsyncServerExchangeHandler exchangeHandler = handlerFactory.create(request, context); if (exchangeHandler != null) { exchangeHandler.handleRequest(request, entityDetails, new ResponseChannel() {
@Override public void consumePromise(final List<Header> headers) throws HttpException, IOException { if (requestState == MessageState.HEADERS) { request = DefaultH2RequestConverter.INSTANCE.convert(headers); final AsyncPushConsumer handler; try { handler = pushHandlerFactory != null ? pushHandlerFactory.create(request, context) : null; } catch (final ProtocolException ex) { throw new H2StreamResetException(H2Error.PROTOCOL_ERROR, ex.getMessage()); } if (handler == null) { throw new H2StreamResetException(H2Error.REFUSED_STREAM, "Stream refused"); } exchangeHandler = handler; context.setProtocolVersion(HttpVersion.HTTP_2); context.setAttribute(HttpCoreContext.HTTP_REQUEST, request); httpProcessor.process(request, null, context); connMetrics.incrementRequestCount(); this.requestState = MessageState.COMPLETE; } else { throw new H2ConnectionException(H2Error.PROTOCOL_ERROR, "Unexpected promise"); } }
handler = exchangeHandlerFactory.create(request, context); } catch (final MisdirectedRequestException ex) { handler = new ImmediateResponseExchangeHandler(HttpStatus.SC_MISDIRECTED_REQUEST, ex.getMessage());
handler = exchangeHandlerFactory.create(request, context); } catch (final MisdirectedRequestException ex) { handler = new ImmediateResponseExchangeHandler(HttpStatus.SC_MISDIRECTED_REQUEST, ex.getMessage());
handler = exchangeHandlerFactory != null ? exchangeHandlerFactory.create(request, context) : null; } catch (final ProtocolException ex) { throw new H2StreamResetException(H2Error.PROTOCOL_ERROR, ex.getMessage());