HttpTransport() { acceptor = new HttpAcceptor(); connector = new HttpConnector(); }
@Override public void removeBridgeFilters(IoFilterChain filterChain) { for (HttpAcceptFilter filter : allAcceptFilters) { removeFilter(filterChain, filter.filterName()); } }
@Override protected void doSessionCreated(IoSessionEx session) throws Exception { HTTPXE_SPEC_KEY.set(session, httpxeSpecCompliant); IoFilterChain filterChain = session.getFilterChain(); addBridgeFilters(filterChain); }
@Override protected HttpBinding bindAdditionalAddressesIfNecessary(HttpBinding newHttpBinding) { HttpBinding httpBinding = addBinding0(newHttpBinding); // detect first bind (without race) if (httpBinding == null) { // bind the resources handler by default (no security) ResourceAddress resourcesAddress = getResourcesAddress(newHttpBinding); HttpAcceptor.this.bind(resourcesAddress, httpResourcesHandler, null); } return httpBinding; }
@Override protected boolean unbindAdditionalAddressesIfNecessary(ResourceAddress address, HttpBinding newHttpBinding) { ResourceAddress resourcesAddress = getResourcesAddress(newHttpBinding); if ( newHttpBinding.size()==1 && newHttpBinding.get(resourcesAddress.getResource().getPath()) != null) { HttpAcceptor.this.unbind(resourcesAddress); return true; } return false; }
@Override protected void doSessionClosed(IoSessionEx session) throws Exception { // if iosession is not being closed then a higher level is asking to close out this http session, likely for upgrade if (!session.isClosing()) { IoFilterChain filterChain = session.getFilterChain(); removeBridgeFilters(filterChain); } DefaultHttpSession httpSession = SESSION_KEY.remove(session); if (httpSession != null && !httpSession.isClosing()) { httpSession.reset(new IOException(LoggingUtils.EARLY_TERMINATION_OF_IOSESSION_MESSAGE).fillInStackTrace()); } }