Source Code Cross Referenced for Poll.java in  » Sevlet-Container » apache-tomcat-6.0.14 » org » apache » tomcat » jni » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Sevlet Container » apache tomcat 6.0.14 » org.apache.tomcat.jni 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  Licensed to the Apache Software Foundation (ASF) under one or more
003:         *  contributor license agreements.  See the NOTICE file distributed with
004:         *  this work for additional information regarding copyright ownership.
005:         *  The ASF licenses this file to You under the Apache License, Version 2.0
006:         *  (the "License"); you may not use this file except in compliance with
007:         *  the License.  You may obtain a copy of the License at
008:         *
009:         *      http://www.apache.org/licenses/LICENSE-2.0
010:         *
011:         *  Unless required by applicable law or agreed to in writing, software
012:         *  distributed under the License is distributed on an "AS IS" BASIS,
013:         *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         *  See the License for the specific language governing permissions and
015:         *  limitations under the License.
016:         */
017:
018:        package org.apache.tomcat.jni;
019:
020:        /** Poll
021:         *
022:         * @author Mladen Turk
023:         * @version $Revision: 467222 $, $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $
024:         */
025:
026:        public class Poll {
027:
028:            /**
029:             * Poll options
030:             */
031:            public static final int APR_POLLIN = 0x001;
032:            /** Can read without blocking */
033:            public static final int APR_POLLPRI = 0x002;
034:            /** Priority data available */
035:            public static final int APR_POLLOUT = 0x004;
036:            /** Can write without blocking */
037:            public static final int APR_POLLERR = 0x010;
038:            /** Pending error */
039:            public static final int APR_POLLHUP = 0x020;
040:            /** Hangup occurred */
041:            public static final int APR_POLLNVAL = 0x040;
042:            /** Descriptior invalid */
043:
044:            /**
045:             * Pollset Flags
046:             */
047:            /** Adding or Removing a Descriptor is thread safe */
048:            public static final int APR_POLLSET_THREADSAFE = 0x001;
049:
050:            /** Used in apr_pollfd_t to determine what the apr_descriptor is
051:             * apr_datatype_e enum
052:             */
053:            public static final int APR_NO_DESC = 0;
054:            /** nothing here */
055:            public static final int APR_POLL_SOCKET = 1;
056:            /** descriptor refers to a socket */
057:            public static final int APR_POLL_FILE = 2;
058:            /** descriptor refers to a file */
059:            public static final int APR_POLL_LASTDESC = 3;
060:
061:            /** descriptor is the last one in the list */
062:
063:            /**
064:             * Setup a pollset object.
065:             * If flags equals APR_POLLSET_THREADSAFE, then a pollset is
066:             * created on which it is safe to make concurrent calls to
067:             * apr_pollset_add(), apr_pollset_remove() and apr_pollset_poll() from
068:             * separate threads.  This feature is only supported on some
069:             * platforms; the apr_pollset_create() call will fail with
070:             * APR_ENOTIMPL on platforms where it is not supported.
071:             * @param size The maximum number of descriptors that this pollset can hold
072:             * @param p The pool from which to allocate the pollset
073:             * @param flags Optional flags to modify the operation of the pollset.
074:             * @param ttl Maximum time to live for a particular socket.
075:             * @return  The pointer in which to return the newly created object
076:             */
077:            public static native long create(int size, long p, int flags,
078:                    long ttl) throws Error;
079:
080:            /**
081:             * Destroy a pollset object
082:             * @param pollset The pollset to destroy
083:             */
084:            public static native int destroy(long pollset);
085:
086:            /**
087:             * Add a socket or to a pollset
088:             * If you set client_data in the descriptor, that value
089:             * will be returned in the client_data field whenever this
090:             * descriptor is signalled in apr_pollset_poll().
091:             * @param pollset The pollset to which to add the descriptor
092:             * @param sock The sockets to add
093:             * @param data Client data to add
094:             * @param reqevents requested events
095:             */
096:            public static native int add(long pollset, long sock, int reqevents);
097:
098:            /**
099:             * Remove a descriptor from a pollset
100:             * @param pollset The pollset from which to remove the descriptor
101:             * @param sock The socket to remove
102:             */
103:            public static native int remove(long pollset, long sock);
104:
105:            /**
106:             * Block for activity on the descriptor(s) in a pollset
107:             * @param pollset The pollset to use
108:             * @param timeout Timeout in microseconds
109:             * @param descriptors Array of signalled descriptors (output parameter)
110:             *        The desctiptor array must be two times the size of pollset.
111:             *        and are populated as follows:
112:             * <PRE>
113:             * descriptors[n + 0] -> returned events
114:             * descriptors[n + 1] -> socket
115:             * </PRE>
116:             * @param remove Remove signaled descriptors from pollset
117:             * @return Number of signalled descriptors (output parameter)
118:             *         or negative APR error code.
119:             */
120:            public static native int poll(long pollset, long timeout,
121:                    long[] descriptors, boolean remove);
122:
123:            /**
124:             * Maintain on the descriptor(s) in a pollset
125:             * @param pollset The pollset to use
126:             * @param descriptors Array of signalled descriptors (output parameter)
127:             *        The desctiptor array must be the size of pollset.
128:             *        and are populated as follows:
129:             * <PRE>
130:             * descriptors[n] -> socket
131:             * </PRE>
132:             * @param remove Remove signaled descriptors from pollset
133:             * @return Number of signalled descriptors (output parameter)
134:             *         or negative APR error code.
135:             */
136:            public static native int maintain(long pollset, long[] descriptors,
137:                    boolean remove);
138:
139:            /**
140:             * Set the socket time to live.
141:             * @param pollset The pollset to use
142:             * @param ttl Timeout in microseconds
143:             */
144:            public static native void setTtl(long pollset, long ttl);
145:
146:            /**
147:             * Get the socket time to live.
148:             * @param pollset The pollset to use
149:             * @return Timeout in microseconds
150:             */
151:            public static native long getTtl(long pollset);
152:
153:            /**
154:             * Return all descriptor(s) in a pollset
155:             * @param pollset The pollset to use
156:             * @param descriptors Array of descriptors (output parameter)
157:             *        The desctiptor array must be two times the size of pollset.
158:             *        and are populated as follows:
159:             * <PRE>
160:             * descriptors[n + 0] -> returned events
161:             * descriptors[n + 1] -> socket
162:             * </PRE>
163:             * @return Number of descriptors (output parameter) in the Poll
164:             *         or negative APR error code.
165:             */
166:            public static native int pollset(long pollset, long[] descriptors);
167:
168:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.