Source Code Cross Referenced for OS.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:        /** OS
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 OS {
027:
028:            /* OS Enums */
029:            private static final int UNIX = 1;
030:            private static final int NETWARE = 2;
031:            private static final int WIN32 = 3;
032:            private static final int WIN64 = 4;
033:            private static final int LINUX = 5;
034:            private static final int SOLARIS = 6;
035:            private static final int BSD = 7;
036:
037:            public static final int LOG_EMERG = 1;
038:            public static final int LOG_ERROR = 2;
039:            public static final int LOG_NOTICE = 3;
040:            public static final int LOG_WARN = 4;
041:            public static final int LOG_INFO = 5;
042:            public static final int LOG_DEBUG = 6;
043:
044:            /**
045:             * Check for OS type.
046:             * @param type OS type to test.
047:             */
048:            private static native boolean is(int type);
049:
050:            public static final boolean IS_UNIX = is(UNIX);
051:            public static final boolean IS_NETWARE = is(NETWARE);
052:            public static final boolean IS_WIN32 = is(WIN32);
053:            public static final boolean IS_WIN64 = is(WIN64);
054:            public static final boolean IS_LINUX = is(LINUX);
055:            public static final boolean IS_SOLARIS = is(SOLARIS);
056:            public static final boolean IS_BSD = is(BSD);
057:
058:            /**
059:             * Get the name of the system default characer set.
060:             * @param pool the pool to allocate the name from, if needed
061:             */
062:            public static native String defaultEncoding(long pool);
063:
064:            /**
065:             * Get the name of the current locale character set.
066:             * Defers to apr_os_default_encoding if the current locale's
067:             * data can't be retreved on this system.
068:             * @param pool the pool to allocate the name from, if needed
069:             */
070:            public static native String localeEncoding(long pool);
071:
072:            /**
073:             * Generate random bytes.
074:             * @param buf Buffer to fill with random bytes
075:             * @param len Length of buffer in bytes
076:             */
077:            public static native int random(byte[] buf, int len);
078:
079:            /**
080:             * Gather system info.
081:             * <PRE>
082:             * On exit the inf array will be filled with:
083:             * inf[0]  - Total usable main memory size
084:             * inf[1]  - Available memory size
085:             * inf[2]  - Total page file/swap space size
086:             * inf[3]  - Page file/swap space still available
087:             * inf[4]  - Amount of shared memory
088:             * inf[5]  - Memory used by buffers
089:             * inf[6]  - Memory Load
090:             *
091:             * inf[7]  - Idle Time in microseconds
092:             * inf[8]  - Kernel Time in microseconds
093:             * inf[9]  - User Time in microseconds
094:             *
095:             * inf[10] - Process creation time (apr_time_t)
096:             * inf[11] - Process Kernel Time in microseconds
097:             * inf[12] - Process User Time in microseconds
098:             *
099:             * inf[13] - Current working set size.
100:             * inf[14] - Peak working set size.
101:             * inf[15] - Number of page faults.
102:             * </PRE>
103:             * @param inf array that will be filled with system information.
104:             *            Array length must be at least 16.
105:             */
106:            public static native int info(long[] inf);
107:
108:            /**
109:             * Expand environment variables.
110:             * @param str String to expand
111:             * @return Expanded string with replaced environment variables.
112:             */
113:            public static native String expand(String str);
114:
115:            /**
116:             * Initialize system logging.
117:             * @param domain String that will be prepended to every message
118:             */
119:            public static native void sysloginit(String domain);
120:
121:            /**
122:             * Log message.
123:             * @param level Log message severity. See LOG_XXX enums.
124:             * @param message Message to log
125:             */
126:            public static native void syslog(int level, String message);
127:
128:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.