749
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger
|
|
3 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
|
|
4 |
SWING Research Group, Czech Technical University in Prague
|
|
5 |
|
|
6 |
Parts of the code written by Claus Gittinger are under following
|
|
7 |
license:
|
|
8 |
|
|
9 |
This software is furnished under a license and may be used
|
|
10 |
only in accordance with the terms of that license and with the
|
|
11 |
inclusion of the above copyright notice. This software may not
|
|
12 |
be provided or otherwise made available to, or used by, any
|
|
13 |
other person. No title to or ownership of the software is
|
|
14 |
hereby transferred.
|
|
15 |
|
|
16 |
Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
|
|
17 |
|
|
18 |
Permission is hereby granted, free of charge, to any person
|
|
19 |
obtaining a copy of this software and associated documentation
|
|
20 |
files (the 'Software'), to deal in the Software without
|
|
21 |
restriction, including without limitation the rights to use,
|
|
22 |
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
23 |
copies of the Software, and to permit persons to whom the
|
|
24 |
Software is furnished to do so, subject to the following
|
|
25 |
conditions:
|
|
26 |
|
|
27 |
The above copyright notice and this permission notice shall be
|
|
28 |
included in all copies or substantial portions of the Software.
|
|
29 |
|
|
30 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
31 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
32 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
33 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
34 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
35 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
36 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
37 |
OTHER DEALINGS IN THE SOFTWARE.
|
|
38 |
|
|
39 |
[1] Code written at SWING Research Group contain a signature
|
|
40 |
of one of the above copright owners.
|
|
41 |
"
|
|
42 |
"{ Package: 'stx:libjava' }"
|
|
43 |
|
|
44 |
StandaloneStartup subclass:#JavaStartup
|
|
45 |
instanceVariableNames:''
|
|
46 |
classVariableNames:'ClassPath'
|
|
47 |
poolDictionaries:''
|
|
48 |
category:'Languages-Java-Support'
|
|
49 |
!
|
|
50 |
|
|
51 |
!JavaStartup class methodsFor:'documentation'!
|
|
52 |
|
|
53 |
copyright
|
|
54 |
"
|
|
55 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger
|
|
56 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
|
|
57 |
SWING Research Group, Czech Technical University in Prague
|
|
58 |
|
|
59 |
Parts of the code written by Claus Gittinger are under following
|
|
60 |
license:
|
|
61 |
|
|
62 |
This software is furnished under a license and may be used
|
|
63 |
only in accordance with the terms of that license and with the
|
|
64 |
inclusion of the above copyright notice. This software may not
|
|
65 |
be provided or otherwise made available to, or used by, any
|
|
66 |
other person. No title to or ownership of the software is
|
|
67 |
hereby transferred.
|
|
68 |
|
|
69 |
Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
|
|
70 |
|
|
71 |
Permission is hereby granted, free of charge, to any person
|
|
72 |
obtaining a copy of this software and associated documentation
|
|
73 |
files (the 'Software'), to deal in the Software without
|
|
74 |
restriction, including without limitation the rights to use,
|
|
75 |
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
76 |
copies of the Software, and to permit persons to whom the
|
|
77 |
Software is furnished to do so, subject to the following
|
|
78 |
conditions:
|
|
79 |
|
|
80 |
The above copyright notice and this permission notice shall be
|
|
81 |
included in all copies or substantial portions of the Software.
|
|
82 |
|
|
83 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
84 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
85 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
86 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
87 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
88 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
89 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
90 |
OTHER DEALINGS IN THE SOFTWARE.
|
|
91 |
|
|
92 |
[1] Code written at SWING Research Group contain a signature
|
|
93 |
of one of the above copright owners.
|
|
94 |
|
|
95 |
"
|
|
96 |
! !
|
|
97 |
|
|
98 |
!JavaStartup class methodsFor:'constants & defaults'!
|
|
99 |
|
|
100 |
applicationRegistryPath
|
|
101 |
"the key under which this application stores its process ID in the registry
|
|
102 |
as a collection of path-components.
|
|
103 |
i.e. if #('foo' 'bar' 'baz') is returned here, the current applications ID will be stored
|
|
104 |
in HKEY_CURRENT_USER\Software\foo\bar\baz\CurrentID.
|
|
105 |
(would also be used as a relative path for a temporary lock file under unix).
|
|
106 |
Used to detect if another instance of this application is already running."
|
|
107 |
|
|
108 |
^ #('stx' 'java_x')
|
|
109 |
|
|
110 |
"Created: / 07-02-2011 / 10:55:08 / Marcel Hlopko <hlopik@gmail.com>"
|
|
111 |
!
|
|
112 |
|
|
113 |
applicationUUID
|
|
114 |
"answer an application-specific unique uuid.
|
|
115 |
This is used as the name of some exclusive OS-resource, which is used to find out,
|
|
116 |
if another instance of this application is already running.
|
|
117 |
Under win32, a mutex is used; under unix, an exclusive file in the tempDir could be used."
|
|
118 |
|
|
119 |
^ 'ST_X_JAVA_X'.
|
|
120 |
|
|
121 |
"Created: / 07-02-2011 / 10:52:50 / Marcel Hlopko <hlopik@gmail.com>"
|
|
122 |
! !
|
|
123 |
|
|
124 |
!JavaStartup class methodsFor:'startup'!
|
|
125 |
|
|
126 |
main:argv
|
|
127 |
"Currently only -c option for classpath setting working"
|
|
128 |
|
|
129 |
|class arguments classAndArguments classpath classpathFromEnv|
|
|
130 |
|
|
131 |
classpath := OrderedCollection new.
|
|
132 |
classpathFromEnv := OperatingSystem getEnvironment:#CLASSPATH.
|
|
133 |
classpathFromEnv isNil ifFalse:[
|
|
134 |
(classpathFromEnv asArrayOfSubstringsSeparatedBy:$:) do:[:each |
|
|
135 |
classpath add:each
|
|
136 |
]
|
|
137 |
].
|
|
138 |
classAndArguments := OrderedCollection new.
|
|
139 |
(GetOpt new)
|
|
140 |
at:$c
|
|
141 |
put:[:opt :arg | (arg asArrayOfSubstringsSeparatedBy:$:) do: [:each | classpath add: each]];
|
2155
|
142 |
at:$?
|
|
143 |
put:[:arg | self error:'not yet implemented'];
|
749
|
144 |
default:[:arg | classAndArguments add:arg];
|
|
145 |
parse:argv.
|
|
146 |
class := classAndArguments at:1.
|
|
147 |
arguments := classAndArguments
|
|
148 |
removeFirst;
|
|
149 |
yourself.
|
|
150 |
Java flushAllJavaResources.
|
|
151 |
self breakPoint:#mh.
|
|
152 |
Java initialize.
|
|
153 |
JavaVM initializeVM.
|
|
154 |
classpath do:[:each |
|
|
155 |
Java addToClassPath:each
|
|
156 |
].
|
|
157 |
(Java classForName:class) main:arguments asArray.
|
|
158 |
|
|
159 |
"Created: / 07-02-2011 / 10:55:41 / Marcel Hlopko <hlopik@gmail.com>"
|
|
160 |
"Modified: / 08-02-2011 / 00:55:42 / Marcel Hlopko <hlopik@gmail.com>"
|
2155
|
161 |
"Modified (format): / 19-08-2011 / 01:55:24 / cg"
|
749
|
162 |
! !
|
|
163 |
|
|
164 |
!JavaStartup class methodsFor:'documentation'!
|
|
165 |
|
2155
|
166 |
version
|
|
167 |
^ '$Header: /cvs/stx/stx/libjava/Attic/JavaStartup.st,v 1.2 2011-08-19 08:48:04 cg Exp $'
|
|
168 |
!
|
|
169 |
|
|
170 |
version_CVS
|
|
171 |
^ '$Header: /cvs/stx/stx/libjava/Attic/JavaStartup.st,v 1.2 2011-08-19 08:48:04 cg Exp $'
|
|
172 |
!
|
|
173 |
|
749
|
174 |
version_SVN
|
2155
|
175 |
^ '§Id: JavaStartup.st,v 1.1 2011/08/18 19:06:53 vrany Exp §'
|
2152
|
176 |
! !
|