author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Mon, 20 Dec 2010 07:13:27 +0000 | |
branch | jv |
changeset 17814 | b75a7f0c346b |
parent 17807 | 06cc6c49e291 |
child 17834 | 04ff72c5039a |
permissions | -rw-r--r-- |
17766
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17763
diff
changeset
|
1 |
" |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17763
diff
changeset
|
2 |
COPYRIGHT (c) 2006 by eXept Software AG |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17763
diff
changeset
|
3 |
All Rights Reserved |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17763
diff
changeset
|
4 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17763
diff
changeset
|
5 |
This software is furnished under a license and may be used |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17763
diff
changeset
|
6 |
only in accordance with the terms of that license and with the |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17763
diff
changeset
|
7 |
inclusion of the above copyright notice. This software may not |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17763
diff
changeset
|
8 |
be provided or otherwise made available to, or used by, any |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17763
diff
changeset
|
9 |
other person. No title to or ownership of the software is |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17763
diff
changeset
|
10 |
hereby transferred. |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17763
diff
changeset
|
11 |
" |
17763 | 12 |
"{ Package: 'stx:libbasic' }" |
13 |
||
14 |
Object subclass:#OSProcess |
|
15 |
instanceVariableNames:'pid parentPid commandLine' |
|
16 |
classVariableNames:'' |
|
17 |
poolDictionaries:'' |
|
18 |
category:'System-Support' |
|
19 |
! |
|
20 |
||
21 |
!OSProcess class methodsFor:'documentation'! |
|
22 |
||
17766
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17763
diff
changeset
|
23 |
copyright |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17763
diff
changeset
|
24 |
" |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17763
diff
changeset
|
25 |
COPYRIGHT (c) 2006 by eXept Software AG |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17763
diff
changeset
|
26 |
All Rights Reserved |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17763
diff
changeset
|
27 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17763
diff
changeset
|
28 |
This software is furnished under a license and may be used |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17763
diff
changeset
|
29 |
only in accordance with the terms of that license and with the |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17763
diff
changeset
|
30 |
inclusion of the above copyright notice. This software may not |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17763
diff
changeset
|
31 |
be provided or otherwise made available to, or used by, any |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17763
diff
changeset
|
32 |
other person. No title to or ownership of the software is |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17763
diff
changeset
|
33 |
hereby transferred. |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17763
diff
changeset
|
34 |
" |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17763
diff
changeset
|
35 |
! |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17763
diff
changeset
|
36 |
|
17763 | 37 |
documentation |
38 |
" |
|
39 |
OSProcess is an abstract class. Instances represent operating system processes |
|
40 |
(as opposed to Smalltalk processes). |
|
41 |
||
42 |
[author:] |
|
43 |
Stefan Vogel (stefan@zwerg) |
|
44 |
||
45 |
[instance variables:] |
|
46 |
pid SmallInteger the process id |
|
47 |
parentPid SmallInteger the process id of the parent process |
|
48 |
commandLine String the command line of the running command. |
|
49 |
||
50 |
[class variables:] |
|
51 |
||
52 |
[see also:] |
|
53 |
Process |
|
54 |
||
55 |
" |
|
56 |
! ! |
|
57 |
||
58 |
!OSProcess methodsFor:'accessing'! |
|
59 |
||
60 |
commandLine |
|
61 |
^ commandLine |
|
62 |
! |
|
63 |
||
64 |
commandLine:something |
|
65 |
commandLine := something. |
|
66 |
! |
|
67 |
||
68 |
parentPid |
|
69 |
^ parentPid |
|
70 |
! |
|
71 |
||
72 |
parentPid:something |
|
73 |
parentPid := something. |
|
74 |
! |
|
75 |
||
76 |
pid |
|
77 |
^ pid |
|
78 |
! |
|
79 |
||
80 |
pid:something |
|
81 |
pid := something. |
|
82 |
! ! |
|
83 |
||
84 |
!OSProcess methodsFor:'queries'! |
|
85 |
||
86 |
getProcessHandle |
|
87 |
"some OperatingSystems redefine this to resolve this to a processHandle |
|
88 |
(which must be explicitely freed later). |
|
89 |
Others simply return the pid here" |
|
90 |
||
91 |
^ self subclassResponsibility |
|
92 |
! |
|
93 |
||
94 |
isAlive |
|
95 |
"answer true, if the process is still alive" |
|
96 |
||
97 |
^ self subclassResponsibility |
|
98 |
! |
|
99 |
||
100 |
isDead |
|
101 |
"answer true, if the process is no longer alive" |
|
102 |
||
103 |
^ self isAlive not |
|
104 |
! ! |
|
105 |
||
106 |
!OSProcess methodsFor:'terminating'! |
|
107 |
||
108 |
kill |
|
109 |
"kill the process - the process does not get the chance to clean up" |
|
110 |
||
111 |
^ self subclassResponsibility. |
|
112 |
! |
|
113 |
||
114 |
killGroup |
|
115 |
"killl the processGroup - the processes does not get the chance to clean up" |
|
116 |
||
117 |
^ self subclassResponsibility. |
|
118 |
! |
|
119 |
||
120 |
killWithAllChildren |
|
121 |
"terminate gracefully the process with all of its child processes" |
|
122 |
||
123 |
^ self subclassResponsibility. |
|
124 |
! |
|
125 |
||
126 |
terminate |
|
127 |
"terminate the process gracefully" |
|
128 |
||
129 |
^ self subclassResponsibility. |
|
130 |
! |
|
131 |
||
132 |
terminateGroup |
|
133 |
"terminate the process group. |
|
134 |
Under Windows, these is the same as terminateWithhAllChildren, |
|
135 |
under unix, this terminates a subset of all children" |
|
136 |
||
137 |
^ self subclassResponsibility. |
|
138 |
! |
|
139 |
||
140 |
terminateWithAllChildren |
|
141 |
"terminate gracefully the process with all of its child processes" |
|
142 |
||
143 |
^ self subclassResponsibility. |
|
144 |
! ! |
|
145 |
||
146 |
!OSProcess class methodsFor:'documentation'! |
|
147 |
||
148 |
version_CVS |
|
17814 | 149 |
^ 'Header: /cvs/stx/stx/libbasic/OSProcess.st,v 1.1 2010/04/27 08:07:00 stefan Exp ' |
17766
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17763
diff
changeset
|
150 |
! |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17763
diff
changeset
|
151 |
|
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17763
diff
changeset
|
152 |
version_SVN |
0acf634e6550
initial implementation of selector namespaces
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17763
diff
changeset
|
153 |
^ '$Id$' |
17763 | 154 |
! ! |
17767 | 155 |
|
17772
6e0b3c06c364
Method reverted to r10532
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17767
diff
changeset
|
156 |
|
17780 | 157 |
|
17807 | 158 |
|
17814 | 159 |