877
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger
|
1152
|
3 |
|
1155
|
4 |
New code and modifications done at SWING Research Group [1]:
|
1152
|
5 |
|
877
|
6 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
|
|
7 |
SWING Research Group, Czech Technical University in Prague
|
|
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 |
|
1155
|
16 |
[1] Code written at SWING Research Group contains a signature
|
|
17 |
of one of the above copright owners. For exact set of such code,
|
|
18 |
see the differences between this version and version stx:libjava
|
1152
|
19 |
as of 1.9.2010
|
877
|
20 |
"
|
752
|
21 |
"{ Package: 'stx:libjava' }"
|
|
22 |
|
|
23 |
StandaloneStartup subclass:#JavaStartup
|
|
24 |
instanceVariableNames:''
|
|
25 |
classVariableNames:'ClassPath'
|
|
26 |
poolDictionaries:''
|
|
27 |
category:'Languages-Java-Support'
|
|
28 |
!
|
|
29 |
|
877
|
30 |
!JavaStartup class methodsFor:'documentation'!
|
|
31 |
|
|
32 |
copyright
|
|
33 |
"
|
|
34 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger
|
1152
|
35 |
|
1155
|
36 |
New code and modifications done at SWING Research Group [1]:
|
1152
|
37 |
|
877
|
38 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
|
|
39 |
SWING Research Group, Czech Technical University in Prague
|
|
40 |
|
|
41 |
This software is furnished under a license and may be used
|
|
42 |
only in accordance with the terms of that license and with the
|
|
43 |
inclusion of the above copyright notice. This software may not
|
|
44 |
be provided or otherwise made available to, or used by, any
|
|
45 |
other person. No title to or ownership of the software is
|
|
46 |
hereby transferred.
|
|
47 |
|
1155
|
48 |
[1] Code written at SWING Research Group contains a signature
|
|
49 |
of one of the above copright owners. For exact set of such code,
|
|
50 |
see the differences between this version and version stx:libjava
|
1152
|
51 |
as of 1.9.2010
|
877
|
52 |
|
|
53 |
"
|
|
54 |
! !
|
752
|
55 |
|
|
56 |
!JavaStartup class methodsFor:'constants & defaults'!
|
|
57 |
|
|
58 |
applicationRegistryPath
|
|
59 |
"the key under which this application stores its process ID in the registry
|
|
60 |
as a collection of path-components.
|
|
61 |
i.e. if #('foo' 'bar' 'baz') is returned here, the current applications ID will be stored
|
|
62 |
in HKEY_CURRENT_USER\Software\foo\bar\baz\CurrentID.
|
|
63 |
(would also be used as a relative path for a temporary lock file under unix).
|
|
64 |
Used to detect if another instance of this application is already running."
|
|
65 |
|
|
66 |
^ #('stx' 'java_x')
|
|
67 |
|
|
68 |
"Created: / 07-02-2011 / 10:55:08 / Marcel Hlopko <hlopik@gmail.com>"
|
|
69 |
!
|
|
70 |
|
|
71 |
applicationUUID
|
|
72 |
"answer an application-specific unique uuid.
|
|
73 |
This is used as the name of some exclusive OS-resource, which is used to find out,
|
|
74 |
if another instance of this application is already running.
|
|
75 |
Under win32, a mutex is used; under unix, an exclusive file in the tempDir could be used."
|
|
76 |
|
|
77 |
^ 'ST_X_JAVA_X'.
|
|
78 |
|
|
79 |
"Created: / 07-02-2011 / 10:52:50 / Marcel Hlopko <hlopik@gmail.com>"
|
|
80 |
! !
|
|
81 |
|
|
82 |
!JavaStartup class methodsFor:'startup'!
|
|
83 |
|
1033
|
84 |
main: argv
|
752
|
85 |
"Currently only -c option for classpath setting working"
|
|
86 |
|
1033
|
87 |
| class arguments classAndArguments classpath classpathFromEnv |
|
752
|
88 |
|
|
89 |
classpath := OrderedCollection new.
|
1033
|
90 |
classpathFromEnv := OperatingSystem getEnvironment: #CLASSPATH.
|
|
91 |
classpathFromEnv isNil ifFalse: [
|
|
92 |
(classpathFromEnv asArrayOfSubstringsSeparatedBy: $:) do: [
|
|
93 |
:each |
|
|
94 |
classpath add: each
|
752
|
95 |
]
|
|
96 |
].
|
|
97 |
classAndArguments := OrderedCollection new.
|
|
98 |
(GetOpt new)
|
1033
|
99 |
at: $c
|
|
100 |
put: [
|
|
101 |
:opt :arg |
|
|
102 |
(arg asArrayOfSubstringsSeparatedBy: $:) do: [:each | classpath add: each ]
|
|
103 |
];
|
|
104 |
at: $? put: [:arg | self error: 'not yet implemented' ];
|
|
105 |
default: [:arg | classAndArguments add: arg ];
|
|
106 |
parse: argv.
|
|
107 |
class := classAndArguments at: 1.
|
752
|
108 |
arguments := classAndArguments
|
|
109 |
removeFirst;
|
|
110 |
yourself.
|
|
111 |
Java flushAllJavaResources.
|
1033
|
112 |
self breakPoint: #mh.
|
752
|
113 |
Java initialize.
|
|
114 |
JavaVM initializeVM.
|
1033
|
115 |
classpath do: [:each | Java addToClassPath: each ].
|
|
116 |
(JavaVM classForName: class) main: arguments asArray.
|
752
|
117 |
|
|
118 |
"Created: / 07-02-2011 / 10:55:41 / Marcel Hlopko <hlopik@gmail.com>"
|
|
119 |
"Modified: / 08-02-2011 / 00:55:42 / Marcel Hlopko <hlopik@gmail.com>"
|
|
120 |
! !
|
|
121 |
|
|
122 |
!JavaStartup class methodsFor:'documentation'!
|
|
123 |
|
|
124 |
version_SVN
|
|
125 |
^ '$Id$'
|
|
126 |
! !
|