congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
WsnSession.getBufferAllocator
Code IndexAdd Tabnine to your IDE (free)

How to use
getBufferAllocator
method
in
org.kaazing.gateway.transport.wsn.WsnSession

Best Java code snippets using org.kaazing.gateway.transport.wsn.WsnSession.getBufferAllocator (Showing top 4 results out of 315)

origin: kaazing/gateway

if (WebSocketWireProtocol.HYBI_13.equals(wsVersion) || WebSocketWireProtocol.HYBI_8.equals(wsVersion)) {
  final IoBufferAllocatorEx<? extends WsBuffer> allocator = wsnSession.getBufferAllocator();
  ByteBuffer messageNioBuf = allocator.allocate(response.getBytes().length + 4);
  IoBufferEx messageBuf = allocator.wrap(messageNioBuf).setAutoExpander(allocator);
origin: kaazing/gateway

WsBuffer wsBuffer = (ioBufferEx instanceof WsBuffer)
    ? (WsBuffer) ioBufferEx
    : session.getBufferAllocator().wrap(ioBufferEx.buf());
switch (wsMessage.getKind()) {
  case BINARY:
origin: kaazing/gateway

@Override
protected void doFilterWrite(final NextFilter nextFilter,
               final WsnSession wsnSession,
               WriteRequest writeRequest) throws Exception {
  IoSession parent = wsnSession.getParent();
  Encoding encoding = (Encoding) parent.getAttribute("encoding");
  final WsMessage emptyWsMessage;
  final IoBufferAllocatorEx<?> allocator = wsnSession.getBufferAllocator();
  switch(encoding) {
    case TEXT:
      emptyWsMessage = new WsTextMessage(allocator.wrap(allocator.allocate(0)));
      break;
    default:
      emptyWsMessage = new WsBinaryMessage(allocator.wrap(allocator.allocate(0)));
  }
  writeRequest.getFuture().addListener(new IoFutureListener<WriteFuture>() {
    @Override
    public void operationComplete(WriteFuture future) {
      if (logger.isDebugEnabled()) {
        logger.debug("HttpEmptyPacketWriterFilter writing empty packet.");
      }
      wsnSession.getParent().write(emptyWsMessage);
    }
  });
  HttpResponseMessage message = (HttpResponseMessage) writeRequest.getMessage();
  if ( message.getStatus() != HttpStatus.CLIENT_UNAUTHORIZED) {
    wsnSession.getFilterChain().remove(HttpEmptyPacketWriterFilter.this);
  }
  nextFilter.filterWrite(wsnSession, writeRequest);
}
origin: kaazing/gateway

IoBufferAllocatorEx<? extends WsBuffer> allocator = wsnSession.getBufferAllocator();
org.kaazing.gateway.transport.wsnWsnSessiongetBufferAllocator

Popular methods of WsnSession

  • close
  • getParent
  • isBalanceSupported
  • getBalanceeURIs
  • getCloseException
  • getCloseFuture
  • getFilterChain
  • getHandler
  • getLocalAddress
  • getParentHttpRequestURI
  • getProcessor
  • getVersion
  • getProcessor,
  • getVersion,
  • isClosing,
  • reset,
  • setBalanceeURIs,
  • setCloseException,
  • setLoginContext,
  • startupScheduledCommands

Popular in Java

  • Finding current android device location
  • addToBackStack (FragmentTransaction)
  • getSupportFragmentManager (FragmentActivity)
  • setRequestProperty (URLConnection)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Reference (javax.naming)
  • JTextField (javax.swing)
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now