Tabnine Logo
PooledMemoryManager$PoolByteBufferWrapper
Code IndexAdd Tabnine to your IDE (free)

How to use
PooledMemoryManager$PoolByteBufferWrapper
in
org.glassfish.grizzly.memory

Best Java code snippets using org.glassfish.grizzly.memory.PooledMemoryManager$PoolByteBufferWrapper (Showing top 20 results out of 315)

origin: javaee/grizzly

public PoolBuffer allocate() {
  final PoolBuffer buffer =
      (isDirect || FORCE_BYTE_BUFFER_BASED_BUFFERS) ?
      // if isDirect || FORCE_BYTE_BUFFER - allocate ByteBufferWrapper
      new PoolByteBufferWrapper(isDirect ?
          ByteBuffer.allocateDirect(bufferSize) :
          ByteBuffer.allocate(bufferSize), this) :
      
      // otherwise use HeapBuffer
      new PoolHeapBuffer(new byte[bufferSize], this);
      
  
  ProbeNotifier.notifyBufferAllocated(monitoringConfig, bufferSize);
  return buffer;
}
origin: javaee/grizzly

@Override
protected ByteBufferWrapper wrapByteBuffer(final ByteBuffer buffer) {
  final PoolByteBufferWrapper b =
      new PoolByteBufferWrapper(buffer,
          null, // don't keep track of the owner for child buffers
          source, // pass the 'parent' buffer along
          shareCount); // pass the shareCount
  b.allowBufferDispose(true);
  shareCount.incrementAndGet();
  return b;
}

origin: org.glassfish.grizzly/grizzly-http-server-core

private void dispose0() {
  // check shared counter optimistically
  boolean isNotShared = shareCount.get() == 0;
  if (!isNotShared) {
    // try pessimistic check using CAS loop
    isNotShared = (shareCount.getAndDecrement() == 0);
    if (isNotShared) {
      // if the former check is true - the shared counter is negative,
      // so we have to reset it
      shareCount.set(0);
    }
  }
  
  if (isNotShared) {
    // we can now safely return source back to the queue
    source.returnToPool();
  }
}

origin: org.glassfish.grizzly/grizzly-core

private void dispose0() {
  // check shared counter optimistically
  boolean isNotShared = shareCount.get() == 0;
  if (!isNotShared) {
    // try pessimistic check using CAS loop
    isNotShared = (shareCount.getAndDecrement() == 0);
    if (isNotShared) {
      // if the former check is true - the shared counter is negative,
      // so we have to reset it
      shareCount.set(0);
    }
  }
  
  if (isNotShared) {
    // we can now safely return source back to the queue
    source.returnToPool();
  }
}

origin: javaee/grizzly

private void dispose0() {
  // check shared counter optimistically
  boolean isNotShared = shareCount.get() == 0;
  if (!isNotShared) {
    // try pessimistic check using CAS loop
    isNotShared = (shareCount.getAndDecrement() == 0);
    if (isNotShared) {
      // if the former check is true - the shared counter is negative,
      // so we have to reset it
      shareCount.set(0);
    }
  }
  
  if (isNotShared) {
    // we can now safely return source back to the queue
    source.returnToPool();
  }
}

origin: javaee/grizzly

private void dispose0() {
  // check shared counter optimistically
  boolean isNotShared = shareCount.get() == 0;
  if (!isNotShared) {
    // try pessimistic check using CAS loop
    isNotShared = (shareCount.getAndDecrement() == 0);
    if (isNotShared) {
      // if the former check is true - the shared counter is negative,
      // so we have to reset it
      shareCount.set(0);
    }
  }
  
  if (isNotShared) {
    // we can now safely return source back to the queue
    source.returnToPool();
  }
}

origin: javaee/grizzly

private void dispose0() {
  // check shared counter optimistically
  boolean isNotShared = shareCount.get() == 0;
  if (!isNotShared) {
    // try pessimistic check using CAS loop
    isNotShared = (shareCount.getAndDecrement() == 0);
    if (isNotShared) {
      // if the former check is true - the shared counter is negative,
      // so we have to reset it
      shareCount.set(0);
    }
  }
  
  if (isNotShared) {
    // we can now safely return source back to the queue
    source.returnToPool();
  }
}

origin: org.glassfish.grizzly/grizzly-websockets-server

private void dispose0() {
  // check shared counter optimistically
  boolean isNotShared = shareCount.get() == 0;
  if (!isNotShared) {
    // try pessimistic check using CAS loop
    isNotShared = (shareCount.getAndDecrement() == 0);
    if (isNotShared) {
      // if the former check is true - the shared counter is negative,
      // so we have to reset it
      shareCount.set(0);
    }
  }
  
  if (isNotShared) {
    // we can now safely return source back to the queue
    source.returnToPool();
  }
}

origin: org.mule.glassfish.grizzly/grizzly-framework

private void dispose0() {
  // check shared counter optimistically
  boolean isNotShared = shareCount.get() == 0;
  if (!isNotShared) {
    // try pessimistic check using CAS loop
    isNotShared = (shareCount.getAndDecrement() == 0);
    if (isNotShared) {
      // if the former check is true - the shared counter is negative,
      // so we have to reset it
      shareCount.set(0);
    }
  }
  
  if (isNotShared) {
    // we can now safely return source back to the queue
    source.returnToPool();
  }
}

origin: javaee/grizzly

private void dispose0() {
  // check shared counter optimistically
  boolean isNotShared = shareCount.get() == 0;
  if (!isNotShared) {
    // try pessimistic check using CAS loop
    isNotShared = (shareCount.getAndDecrement() == 0);
    if (isNotShared) {
      // if the former check is true - the shared counter is negative,
      // so we have to reset it
      shareCount.set(0);
    }
  }
  
  if (isNotShared) {
    // we can now safely return source back to the queue
    source.returnToPool();
  }
}

origin: javaee/grizzly

private void dispose0() {
  // check shared counter optimistically
  boolean isNotShared = shareCount.get() == 0;
  if (!isNotShared) {
    // try pessimistic check using CAS loop
    isNotShared = (shareCount.getAndDecrement() == 0);
    if (isNotShared) {
      // if the former check is true - the shared counter is negative,
      // so we have to reset it
      shareCount.set(0);
    }
  }
  
  if (isNotShared) {
    // we can now safely return source back to the queue
    source.returnToPool();
  }
}

origin: javaee/grizzly

private void dispose0() {
  // check shared counter optimistically
  boolean isNotShared = shareCount.get() == 0;
  if (!isNotShared) {
    // try pessimistic check using CAS loop
    isNotShared = (shareCount.getAndDecrement() == 0);
    if (isNotShared) {
      // if the former check is true - the shared counter is negative,
      // so we have to reset it
      shareCount.set(0);
    }
  }
  
  if (isNotShared) {
    // we can now safely return source back to the queue
    source.returnToPool();
  }
}

origin: javaee/grizzly

private void dispose0() {
  // check shared counter optimistically
  boolean isNotShared = shareCount.get() == 0;
  if (!isNotShared) {
    // try pessimistic check using CAS loop
    isNotShared = (shareCount.getAndDecrement() == 0);
    if (isNotShared) {
      // if the former check is true - the shared counter is negative,
      // so we have to reset it
      shareCount.set(0);
    }
  }
  
  if (isNotShared) {
    // we can now safely return source back to the queue
    source.returnToPool();
  }
}

origin: javaee/grizzly

private void dispose0() {
  // check shared counter optimistically
  boolean isNotShared = shareCount.get() == 0;
  if (!isNotShared) {
    // try pessimistic check using CAS loop
    isNotShared = (shareCount.getAndDecrement() == 0);
    if (isNotShared) {
      // if the former check is true - the shared counter is negative,
      // so we have to reset it
      shareCount.set(0);
    }
  }
  
  if (isNotShared) {
    // we can now safely return source back to the queue
    source.returnToPool();
  }
}

origin: org.glassfish.grizzly/grizzly-core

@Override
public void dispose() {
  if (free) {
    return;
  }
  free = true;
  
  dispose0();
}
origin: javaee/grizzly

@Override
public void dispose() {
  if (free) {
    return;
  }
  free = true;
  
  dispose0();
}
origin: javaee/grizzly

@Override
public void dispose() {
  if (free) {
    return;
  }
  free = true;
  
  dispose0();
}
origin: org.glassfish.grizzly/grizzly-core

@Override
protected ByteBufferWrapper wrapByteBuffer(final ByteBuffer buffer) {
  final PoolByteBufferWrapper b =
      new PoolByteBufferWrapper(buffer,
          null, // don't keep track of the owner for child buffers
          source, // pass the 'parent' buffer along
          shareCount); // pass the shareCount
  b.allowBufferDispose(true);
  shareCount.incrementAndGet();
  return b;
}

origin: javaee/grizzly

@Override
protected ByteBufferWrapper wrapByteBuffer(final ByteBuffer buffer) {
  final PoolByteBufferWrapper b =
      new PoolByteBufferWrapper(buffer,
          null, // don't keep track of the owner for child buffers
          source, // pass the 'parent' buffer along
          shareCount); // pass the shareCount
  b.allowBufferDispose(true);
  shareCount.incrementAndGet();
  return b;
}

origin: javaee/grizzly

@Override
protected ByteBufferWrapper wrapByteBuffer(final ByteBuffer buffer) {
  final PoolByteBufferWrapper b =
      new PoolByteBufferWrapper(buffer,
          null, // don't keep track of the owner for child buffers
          source, // pass the 'parent' buffer along
          shareCount); // pass the shareCount
  b.allowBufferDispose(true);
  shareCount.incrementAndGet();
  return b;
}

org.glassfish.grizzly.memoryPooledMemoryManager$PoolByteBufferWrapper

Most used methods

  • <init>
    Creates a new PoolBuffer instance wrapping the specified java.nio.ByteBuffer.
  • allowBufferDispose
  • dispose0
  • returnToPool

Popular in Java

  • Making http requests using okhttp
  • addToBackStack (FragmentTransaction)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Top 12 Jupyter Notebook extensions
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