Package sun.misc

Examples of sun.misc.Cleaner.clean()


    }

    private static void unmap(MappedByteBuffer bb) {
        Cleaner cl = ((DirectBuffer) bb).cleaner();
        if (cl != null)
            cl.clean();
    }

    public long index() {
        return index;
    }
View Full Code Here


    private void unmapBuffer(MappedByteBuffer b) {
        if(b!=null){
            Cleaner cleaner = ((sun.nio.ch.DirectBuffer) b).cleaner();
            if(cleaner!=null)
                cleaner.clean();
        }
    }

    public ByteBuffer read(long pageNumber) throws IOException {
        FileChannel f = getChannel(pageNumber);
View Full Code Here

            cleaner = (Cleaner) getObject(buffer, CLEANER_FIELD_OFFSET);
            if (cleaner == null) {
                throw new IllegalArgumentException(
                        "attempted to deallocate the buffer which was allocated via JNIEnv->NewDirectByteBuffer()");
            }
            cleaner.clean();
        } catch (Throwable t) {
            // Nothing we can do here.
        }
    }
View Full Code Here

    return AccessController.doPrivileged(new PrivilegedAction<Object>() {
      public Object run() {
        try {
          Cleaner cleaner = ((DirectBuffer)buffer).cleaner();
          if (cleaner != null) cleaner.clean(); // Already cleaned otherwise
          return null;
        }
        catch (Exception e) {
          return buffer;
        }
View Full Code Here

        if (byteBuffer.isDirect()) {
          ((MappedByteBuffer) byteBuffer).force();
          final Cleaner cleaner = ((sun.nio.ch.DirectBuffer) byteBuffer)
              .cleaner();
          if (cleaner != null) {
            cleaner.clean();
          }
        } else {
          writeByteBuffer(byteBuffer, index);
        }
      } else {
View Full Code Here

      } else {
        if (byteBuffer.isDirect()) {
          final Cleaner cleaner = ((sun.nio.ch.DirectBuffer) byteBuffer)
              .cleaner();
          if (cleaner != null) {
            cleaner.clean();
          }
        }
      }
    } catch (Exception exception) {
      String fileSize;
View Full Code Here

    }

    private static void unmap(MappedByteBuffer bb) {
        Cleaner cl = ((DirectBuffer)bb).cleaner();
        if (cl != null)
            cl.clean();
    }

    private static final int MAP_RO = 0;
    private static final int MAP_RW = 1;
    private static final int MAP_PV = 2;
View Full Code Here

    }

    private static void unmap(MappedByteBuffer bb) {
        Cleaner cl = ((DirectBuffer)bb).cleaner();
        if (cl != null)
            cl.clean();
    }

    private static final int MAP_RO = 0;
    private static final int MAP_RW = 1;
    private static final int MAP_PV = 2;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.