WsnTransport(Properties configuration) { acceptor = new WsnAcceptor(); acceptor.setConfiguration(configuration); connector = new WsnConnector(); connector.setConfiguration(configuration); }
@Override protected void doExceptionCaught(WsnSession session, Throwable cause) throws Exception { // trigger sessionClosed to update connection capabilities accordingly session.close(true); }
@Override public void removeBridgeFilters(IoFilterChain filterChain) { removeFilter(filterChain, postUpgrade); removeFilter(filterChain, codec); removeFilter(filterChain, base64); removeFilter(filterChain, text); removeFilter(filterChain, WsAcceptor.CLOSE_FILTER); }
@Override protected void doMessageReceived(HttpAcceptSession session, Object message) throws Exception { final WsnHttpBridgeHandler handler = (WsnHttpBridgeHandler) session.getAttribute(WSN_HTTP_BRIDGE_HANDLER); if (handler != null ) { handler.messageReceived(session, message); return; } super.doMessageReceived(session, message); }
@Override public Binding addBinding(Binding newBinding) { ResourceAddress bindAddress = newBinding.bindAddress(); WsnBinding wsnBinding = getBinding0(bindAddress); if (wsnBinding == null) { wsnBinding = new WsnBinding(newBinding.bindAddress(), newBinding.handler(), newBinding.initializer()); } return super.addBinding0(wsnBinding); }
@Override protected IoProcessorEx<WsnSession> initProcessor() { return new WsnAcceptProcessor(); }
@Override public void setLoginContext(IoSession session, ResultAwareLoginContext loginContext) { WsnSession wsnSession = SESSION_KEY.get(session); assert wsnSession != null; wsnSession.setLoginContext(loginContext); }
@Override protected void doMessageReceived(HttpAcceptSession session, Object message) throws Exception { IoBufferEx key3 = (IoBufferEx) message; doUpgrade76(session, key3); }
@Override public void bind(ResourceAddress address, IoHandler handler, BridgeSessionInitializer<? extends IoFuture> initializer) { bind0(address, handler, initializer); }
@Override public <T extends Message> IoBufferEx encode(MessageEncoder<T> encoder, T message, IoBufferAllocatorEx<?> allocator, int flags) { return encode("ws/rcf6455", encoder, message, allocator, flags); }
@Override public <T extends Message> IoBufferEx encode(MessageEncoder<T> encoder, T message, IoBufferAllocatorEx<?> allocator, int flags) { return encode("ws/draft-7x", encoder, message, allocator, flags); }
@Override protected WsnBindings initBindings() { return new WsnBindings(); }
@Override public Transport newTransport(Map<String, ?> configuration) { Properties properties = new Properties(); properties.putAll(configuration); return new WsnTransport(properties); }
@Override public boolean removeBinding(ResourceAddress address, Binding binding) { WsnBinding wsnBinding = super.getBinding0(address); return wsnBinding != null && removeBinding0(address, wsnBinding); }
@Override protected void doSessionOpened(WsnSession session) throws Exception { session.close(false); }
@Override protected IoProcessorEx<WsnSession> initProcessor() { return new WsnAcceptProcessor(); }
@Override public void setLoginContext(IoSession session, ResultAwareLoginContext loginContext) { WsnSession wsnSession = SESSION_KEY.get(session); assert wsnSession != null; wsnSession.setLoginContext(loginContext); }
@Override protected void doSessionCreated(WsnSession session) throws Exception { session.close(false); }
@Override public void closeWebSocketConnection(IoSession session) { WsnSession wsnSession = SESSION_KEY.get(session); assert wsnSession != null; wsnSession.close(false); }
@Override public void closeWebSocketConnection(IoSession session) { WsnSession wsnSession = SESSION_KEY.get(session); assert wsnSession != null; wsnSession.close(false); }