Source Code Cross Referenced for Proc.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:        /** Proc
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 Proc {
027:
028:            /*
029:             * apr_cmdtype_e enum
030:             */
031:            public static final int APR_SHELLCM = 0;
032:            /** use the shell to invoke the program */
033:            public static final int APR_PROGRAM = 1;
034:            /** invoke the program directly, no copied env */
035:            public static final int APR_PROGRAM_ENV = 2;
036:            /** invoke the program, replicating our environment */
037:            public static final int APR_PROGRAM_PATH = 3;
038:            /** find program on PATH, use our environment */
039:            public static final int APR_SHELLCMD_ENV = 4;
040:            /** use the shell to invoke the program,
041:             *   replicating our environment
042:             */
043:
044:            /*
045:             * apr_wait_how_e enum
046:             */
047:            public static final int APR_WAIT = 0;
048:            /** wait for the specified process to finish */
049:            public static final int APR_NOWAIT = 1;
050:            /** do not wait -- just see if it has finished */
051:
052:            /*
053:             * apr_exit_why_e enum
054:             */
055:            public static final int APR_PROC_EXIT = 1;
056:            /** process exited normally */
057:            public static final int APR_PROC_SIGNAL = 2;
058:            /** process exited due to a signal */
059:            public static final int APR_PROC_SIGNAL_CORE = 4;
060:            /** process exited and dumped a core file */
061:
062:            public static final int APR_NO_PIPE = 0;
063:            public static final int APR_FULL_BLOCK = 1;
064:            public static final int APR_FULL_NONBLOCK = 2;
065:            public static final int APR_PARENT_BLOCK = 3;
066:            public static final int APR_CHILD_BLOCK = 4;
067:
068:            public static final int APR_LIMIT_CPU = 0;
069:            public static final int APR_LIMIT_MEM = 1;
070:            public static final int APR_LIMIT_NPROC = 2;
071:            public static final int APR_LIMIT_NOFILE = 3;
072:
073:            /** child has died, caller must call unregister still */
074:            public static final int APR_OC_REASON_DEATH = 0;
075:            /** write_fd is unwritable */
076:            public static final int APR_OC_REASON_UNWRITABLE = 1;
077:            /** a restart is occuring, perform any necessary cleanup (including
078:             * sending a special signal to child)
079:             */
080:            public static final int APR_OC_REASON_RESTART = 2;
081:            /** unregister has been called, do whatever is necessary (including
082:             * kill the child)
083:             */
084:            public static final int APR_OC_REASON_UNREGISTER = 3;
085:            /** somehow the child exited without us knowing ... buggy os? */
086:            public static final int APR_OC_REASON_LOST = 4;
087:            /** a health check is occuring, for most maintainence functions
088:             * this is a no-op.
089:             */
090:            public static final int APR_OC_REASON_RUNNING = 5;
091:
092:            /* apr_kill_conditions_e enumeration */
093:            /** process is never sent any signals */
094:            public static final int APR_KILL_NEVER = 0;
095:            /** process is sent SIGKILL on apr_pool_t cleanup */
096:            public static final int APR_KILL_ALWAYS = 1;
097:            /** SIGTERM, wait 3 seconds, SIGKILL */
098:            public static final int APR_KILL_AFTER_TIMEOUT = 2;
099:            /** wait forever for the process to complete */
100:            public static final int APR_JUST_WAIT = 3;
101:            /** send SIGTERM and then wait */
102:            public static final int APR_KILL_ONLY_ONCE = 4;
103:
104:            public static final int APR_PROC_DETACH_FOREGROUND = 0;
105:            /** Do not detach */
106:            public static final int APR_PROC_DETACH_DAEMONIZE = 1;
107:            /** Detach */
108:
109:            /* Maximum number of arguments for create process call */
110:            public static final int MAX_ARGS_SIZE = 1024;
111:            /* Maximum number of environment variables for create process call */
112:            public static final int MAX_ENV_SIZE = 1024;
113:
114:            /**
115:             * Allocate apr_proc_t stucture from pool
116:             * This is not an apr function.
117:             * @param cont The pool to use.
118:             */
119:            public static native long alloc(long cont);
120:
121:            /**
122:             * This is currently the only non-portable call in APR.  This executes
123:             * a standard unix fork.
124:             * @param proc The resulting process handle.
125:             * @param cont The pool to use.
126:             * @return APR_INCHILD for the child, and APR_INPARENT for the parent
127:             * or an error.
128:             */
129:            public static native int fork(long[] proc, long cont);
130:
131:            /**
132:             * Create a new process and execute a new program within that process.
133:             * This function returns without waiting for the new process to terminate;
134:             * use apr_proc_wait for that.
135:             * @param progname The program to run
136:             * @param args The arguments to pass to the new program.  The first
137:             *             one should be the program name.
138:             * @param env The new environment table for the new process.  This
139:             *            should be a list of NULL-terminated strings. This argument
140:             *            is ignored for APR_PROGRAM_ENV, APR_PROGRAM_PATH, and
141:             *            APR_SHELLCMD_ENV types of commands.
142:             * @param attr The procattr we should use to determine how to create the new
143:             * process
144:             * @param pool The pool to use.
145:             * @return The resulting process handle.
146:             */
147:            public static native int create(long proc, String progname,
148:                    String[] args, String[] env, long attr, long pool);
149:
150:            /**
151:             * Wait for a child process to die
152:             * @param proc The process handle that corresponds to the desired child process
153:             * @param exit exit[0] The returned exit status of the child, if a child process
154:             *                dies, or the signal that caused the child to die.
155:             *                On platforms that don't support obtaining this information,
156:             *                the status parameter will be returned as APR_ENOTIMPL.
157:             * exit[1] Why the child died, the bitwise or of:
158:             * <PRE>
159:             * APR_PROC_EXIT         -- process terminated normally
160:             * APR_PROC_SIGNAL       -- process was killed by a signal
161:             * APR_PROC_SIGNAL_CORE  -- process was killed by a signal, and
162:             *                          generated a core dump.
163:             * </PRE>
164:             * @param waithow How should we wait.  One of:
165:             * <PRE>
166:             * APR_WAIT   -- block until the child process dies.
167:             * APR_NOWAIT -- return immediately regardless of if the
168:             *               child is dead or not.
169:             * </PRE>
170:             * @return The childs status is in the return code to this process.  It is one of:
171:             * <PRE>
172:             * APR_CHILD_DONE     -- child is no longer running.
173:             * APR_CHILD_NOTDONE  -- child is still running.
174:             * </PRE>
175:             */
176:            public static native int wait(long proc, int[] exit, int waithow);
177:
178:            /**
179:             * Wait for any current child process to die and return information
180:             * about that child.
181:             * @param proc Pointer to NULL on entry, will be filled out with child's
182:             *             information
183:             * @param exit exit[0] The returned exit status of the child, if a child process
184:             *                dies, or the signal that caused the child to die.
185:             *                On platforms that don't support obtaining this information,
186:             *                the status parameter will be returned as APR_ENOTIMPL.
187:             * exit[1] Why the child died, the bitwise or of:
188:             * <PRE>
189:             * APR_PROC_EXIT         -- process terminated normally
190:             * APR_PROC_SIGNAL       -- process was killed by a signal
191:             * APR_PROC_SIGNAL_CORE  -- process was killed by a signal, and
192:             *                          generated a core dump.
193:             * </PRE>
194:             * @param waithow How should we wait.  One of:
195:             * <PRE>
196:             * APR_WAIT   -- block until the child process dies.
197:             * APR_NOWAIT -- return immediately regardless of if the
198:             *               child is dead or not.
199:             * </PRE>
200:             * @param pool Pool to allocate child information out of.
201:             */
202:            public static native int waitAllProcs(long proc, int[] exit,
203:                    int waithow, long pool);
204:
205:            /**
206:             * Detach the process from the controlling terminal.
207:             * @param daemonize set to non-zero if the process should daemonize
208:             *                  and become a background process, else it will
209:             *                  stay in the foreground.
210:             */
211:            public static native int detach(int daemonize);
212:
213:            /**
214:             * Terminate a process.
215:             * @param proc The process to terminate.
216:             * @param sig How to kill the process.
217:             */
218:            public static native int kill(long proc, int sig);
219:
220:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.