--- a/JavaProcess.st Fri Feb 14 14:27:26 2014 +0100
+++ b/JavaProcess.st Wed Jan 28 03:12:08 2015 +0100
@@ -1,9 +1,9 @@
"
- COPYRIGHT (c) 1996-2011 by Claus Gittinger
+ COPYRIGHT (c) 1996-2015 by Claus Gittinger
New code and modifications done at SWING Research Group [1]:
- COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
+ COPYRIGHT (c) 2010-2015 by Jan Vrany, Jan Kurs and Marcel Hlopko
SWING Research Group, Czech Technical University in Prague
This software is furnished under a license and may be used
@@ -38,11 +38,11 @@
copyright
"
- COPYRIGHT (c) 1996-2011 by Claus Gittinger
+ COPYRIGHT (c) 1996-2015 by Claus Gittinger
New code and modifications done at SWING Research Group [1]:
- COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
+ COPYRIGHT (c) 2010-2015 by Jan Vrany, Jan Kurs and Marcel Hlopko
SWING Research Group, Czech Technical University in Prague
This software is furnished under a license and may be used
@@ -152,104 +152,103 @@
value
| procName |
- AbortOperationRequest
- handle: [
- :ex |
- procName := javaProcess name.
- (procName startsWith: 'JAVA-AWT-EventQueue') ifTrue: [
- Logger
- log: ('thread ' , procName , ' aborted - restarting process.')
- severity: #info
- facility: 'JVM'.
- ex restart.
- ] ifFalse: [
- (javaProcess == (Smalltalk at: #'JavaVM:JavaScreenUpdaterThread')
- or: [ javaProcess == (Smalltalk at: #'JavaVM:JavaEventQueueThread') ])
- ifTrue: [
- Logger
- log: ('thread ' , procName , ' aborted - restarting process.')
- severity: #info
- facility: 'JVM'.
- ex restart
- ]
- ifFalse: [
- Logger
- log: ('thread ' , procName , ' aborted.')
- severity: #info
- facility: 'JVM'.
- ]
- ].
- ]
- do: [
+
+ AbortOperationRequest handle:[:ex |
+ procName := javaProcess name.
+ (procName startsWith:'JAVA-AWT-EventQueue') ifTrue:[
+ Logger
+ log:('thread ' , procName , ' aborted - restarting process.')
+ severity:#info
+ facility:'JVM'.
+ ex restart.
+ ] ifFalse:[
+ (javaProcess == (Smalltalk at:#'JavaVM:JavaScreenUpdaterThread')
+ or:[ javaProcess == (Smalltalk at:#'JavaVM:JavaEventQueueThread') ])
+ ifTrue:[
+ Logger
+ log:('thread ' , procName , ' aborted - restarting process.')
+ severity:#info
+ facility:'JVM'.
+ ex restart
+ ]
+ ifFalse:[
+ Logger
+ log:('thread ' , procName , ' aborted.')
+ severity:#info
+ facility:'JVM'.
+ ]
+ ].
+ ] do: [
[
- JavaVM javaExceptionSignal
- handle: [
- :ex |
- | exClass |
- procName := javaProcess name.
- exClass := ex parameter class.
- exClass == (Java at: 'java.lang.ThreadDeath') ifTrue: [
- Logger
- log: ('thread ' , procName , ' terminated')
- severity: #info
- facility: 'JVM'.
- ] ifFalse: [
- Logger
- log: ('JAVA: thread ''' , procName , ''' terminated with exception: '
- , exClass name)
- severity: #info
- facility: 'JVM'.
- ].
- ex return.
- ]
- do: [
- MessageNotUnderstood
- handle: [
- :ex |
- |
- "/ remap doesNotUnderstand with nil-receiver to
- "/ a nullPointerException ...
- con m |
- con := ex suspendedContext.
- con receiver isNil ifTrue: [
- ((m := con sender method) notNil and: [ m isJavaMethod ]) ifTrue: [
- JavaVM throwNullPointerException.
- AbortSignal raise.
-
- "/ ex proceed.
- ]
+ JavaVM javaExceptionSignal handle:[:ex |
+ | exClass |
+
+ procName := javaProcess name.
+ exClass := ex parameter class.
+ exClass == (Java at:'java.lang.ThreadDeath') ifTrue:[
+ Logger
+ log:('thread ' , procName , ' terminated')
+ severity:#info
+ facility:'JVM'.
+ ] ifFalse:[
+ Logger
+ log:('JAVA: thread ''' , procName , ''' terminated with exception: '
+ , exClass name)
+ severity:#info
+ facility:'JVM'.
+ ].
+ ex return.
+ ] do:[
+ MessageNotUnderstood handle:[:ex |
+ |
+ "/ remap doesNotUnderstand with nil-receiver to
+ "/ a nullPointerException ...
+ con m |
+
+ con := ex suspendedContext.
+ con receiver isNil ifTrue:[
+ ((m := con sender method) notNil and:[ m isJavaMethod ]) ifTrue:[
+ JavaVM throwNullPointerException.
+ AbortSignal raise.
+
+ "/ ex proceed.
+ ]
+ ].
+ ex reject.
+ ]
+ do:[
+ "/ Transcript showCR:(Timestamp now printString , 'start thread: ', stProcess name).
+ [
+ javaThreadObject instVarNamed:'tid' put:javaProcess id.
+ JavaUnhandledThreadDeathError handle:[
+ "/ Ignore unhandled ThreadDeath, see Thread#stop()
+ ] do:[
+ javaThreadObject perform:#'run()V'.
].
- ex reject.
- ]
- do: [
- "/ Transcript showCR:(Timestamp now printString , 'start thread: ', stProcess name).
- [
- javaThreadObject instVarNamed: 'tid' put: javaProcess id.
- javaThreadObject perform: #'run()V'.
- (Smalltalk at: #'JavaVM:ThreadTrace') == true ifTrue: [
- Logger
- log: ('thread ' , javaProcess name , ' terminated')
- severity: #info
- facility: 'JVM'.
- ].
- ] ensure: [
- javaThreadObject perform: #'exit()V'.
- (Smalltalk at: #'JavaVM:ThreadTrace') == true ifTrue: [
- Logger
- log: ('after exit of thread ' , javaProcess name)
- severity: #info
- facility: 'JVM'.
- ]
+ (Smalltalk at:#'JavaVM:ThreadTrace') == true ifTrue:[
+ Logger
+ log:('thread ' , javaProcess name , ' terminated')
+ severity:#info
+ facility:'JVM'.
+ ].
+ ] ensure:[
+ javaThreadObject perform:#'exit()V'.
+ (Smalltalk at:#'JavaVM:ThreadTrace') == true ifTrue:[
+ Logger
+ log:('after exit of thread ' , javaProcess name)
+ severity:#info
+ facility:'JVM'.
]
]
+ ]
]
- ] ensure: [
- JavaVM leaveMonitorsOfProcess: javaProcess.
- javaProcess == (Smalltalk at: #'JavaVM:JavaScreenUpdaterThread') ifTrue: [
- Smalltalk at: #'JavaVM:JavaScreenUpdaterThread' put: nil.
+ ] ensure:[
+ JavaVM leaveMonitorsOfProcess:javaProcess.
+ javaProcess == (Smalltalk at:#'JavaVM:JavaScreenUpdaterThread') ifTrue:[
+ Smalltalk at:#'JavaVM:JavaScreenUpdaterThread' put:nil.
].
- javaProcess == (Smalltalk at: #'JavaVM:JavaEventQueueThread') ifTrue: [
- Smalltalk at: #'JavaVM:JavaEventQueueThread' put: nil.
+ javaProcess == (Smalltalk at:#'JavaVM:JavaEventQueueThread') ifTrue:[
+ Smalltalk at:#'JavaVM:JavaEventQueueThread' put:nil.
].
"/ screenUpdaterClass := Java at:'sun.awt.ScreenUpdater'.
@@ -257,26 +256,25 @@
"/ screenUpdaterClass instVarNamed:'updater' put:nil.
"/ ].
- Java removeThread: javaThreadObject ifAbsent: [].
]
]
"Created: / 15-12-2010 / 11:06:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 04-12-2011 / 20:14:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
"Modified: / 09-12-2011 / 12:51:55 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
+ "Modified: / 08-08-2014 / 09:03:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!JavaProcess class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libjava/JavaProcess.st,v 1.21 2013-09-06 00:41:25 vrany Exp $'
+ ^ '$Header: /cvs/stx/stx/libjava/JavaProcess.st,v 1.22 2015-01-28 02:10:50 vrany Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libjava/JavaProcess.st,v 1.21 2013-09-06 00:41:25 vrany Exp $'
+ ^ '$Header: /cvs/stx/stx/libjava/JavaProcess.st,v 1.22 2015-01-28 02:10:50 vrany Exp $'
!
version_SVN
- ^ '§Id§'
+ ^ 'Id'
! !