KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > tomcat > jni > Mmap


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17
18 package org.apache.tomcat.jni;
19
20 /** Mmap
21  *
22  * @author Mladen Turk
23  * @version $Revision: 467222 $, $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $
24  */

25
26 public class Mmap {
27     /** MMap opened for reading */
28     public static final int APR_MMAP_READ = 1;
29     /** MMap opened for writing */
30     public static final int APR_MMAP_WRITE = 2;
31
32
33     /**
34      * Create a new mmap'ed file out of an existing APR file.
35      * @param file The file turn into an mmap.
36      * @param offset The offset into the file to start the data pointer at.
37      * @param size The size of the file
38      * @param flag bit-wise or of:
39      * <PRE>
40      * APR_MMAP_READ MMap opened for reading
41      * APR_MMAP_WRITE MMap opened for writing
42      * </PRE>
43      * @param pool The pool to use when creating the mmap.
44      * @return The newly created mmap'ed file.
45      */

46     public static native long create(long file, long offset, long size, int flag, long pool)
47         throws Error JavaDoc;
48
49     /**
50      * Duplicate the specified MMAP.
51      * @param mmap The mmap to duplicate.
52      * @param pool The pool to use for new_mmap.
53      * @return Duplicated mmap'ed file.
54      */

55     public static native long dup(long mmap, long pool)
56         throws Error JavaDoc;
57
58     /**
59      * Remove a mmap'ed.
60      * @param mm The mmap'ed file.
61      */

62     public static native int delete(long mm);
63
64     /**
65      * Move the pointer into the mmap'ed file to the specified offset.
66      * @param mm The mmap'ed file.
67      * @param offset The offset to move to.
68      * @return The pointer to the offset specified.
69      */

70     public static native long offset(long mm, long offset)
71         throws Error JavaDoc;
72
73 }
74
Popular Tags