|
1 | | -" |
2 | | -I am an abstract class defining the basic behaviour and state to execute a task: |
3 | | - - the basic executeTask: method |
4 | | - - an exception handler meant to manage unhandled exception |
5 | | -" |
6 | | -Class { |
7 | | - #name : #TKTAbstractExecutor, |
8 | | - #superclass : #Object, |
9 | | - #traits : 'TTaskExecutor', |
10 | | - #classTraits : 'TTaskExecutor classTrait', |
11 | | - #instVars : [ |
12 | | - 'exceptionHandler', |
13 | | - 'busy' |
14 | | - ], |
15 | | - #category : #'TaskIt-Kernel' |
16 | | -} |
17 | | - |
18 | | -{ #category : #accessing } |
19 | | -TKTAbstractExecutor >> exceptionHandler [ |
20 | | - ^ exceptionHandler |
21 | | -] |
22 | | - |
23 | | -{ #category : #accessing } |
24 | | -TKTAbstractExecutor >> exceptionHandler: aHandler [ |
25 | | - |
26 | | - exceptionHandler := aHandler |
27 | | -] |
28 | | - |
29 | | -{ #category : #initialization } |
30 | | -TKTAbstractExecutor >> initialize [ |
31 | | - super initialize. |
32 | | - busy := false. |
33 | | - exceptionHandler := TKTConfiguration errorHandler |
34 | | -] |
35 | | - |
36 | | -{ #category : #'as yet unclassified' } |
37 | | -TKTAbstractExecutor >> isBusy [ |
38 | | - |
39 | | - ^ busy |
40 | | -] |
41 | | - |
42 | | -{ #category : #'as yet unclassified' } |
43 | | -TKTAbstractExecutor >> isFree [ |
44 | | - |
45 | | - ^ busy not |
46 | | -] |
47 | | - |
48 | | -{ #category : #accessing } |
49 | | -TKTAbstractExecutor >> noteBusy [ |
50 | | - |
51 | | - busy := true |
52 | | -] |
53 | | - |
54 | | -{ #category : #accessing } |
55 | | -TKTAbstractExecutor >> noteFree [ |
56 | | - |
57 | | - busy := false |
58 | | -] |
59 | | - |
60 | | -{ #category : #polimorfism } |
61 | | -TKTAbstractExecutor >> start [ |
62 | | - " nothing to do " |
63 | | -] |
64 | | - |
65 | | -{ #category : #polimorfsms } |
66 | | -TKTAbstractExecutor >> stop [ |
67 | | - |
68 | | -] |
| 1 | +" |
| 2 | +I am an abstract class defining the basic behaviour and state to execute a task: |
| 3 | + - the basic executeTask: method |
| 4 | + - an exception handler meant to manage unhandled exception |
| 5 | +" |
| 6 | +Class { |
| 7 | + #name : #TKTAbstractExecutor, |
| 8 | + #superclass : #Object, |
| 9 | + #traits : 'TTaskExecutor', |
| 10 | + #classTraits : 'TTaskExecutor classTrait', |
| 11 | + #instVars : [ |
| 12 | + 'exceptionHandler', |
| 13 | + 'busy' |
| 14 | + ], |
| 15 | + #category : #'TaskIt-Kernel' |
| 16 | +} |
| 17 | + |
| 18 | +{ #category : #accessing } |
| 19 | +TKTAbstractExecutor >> exceptionHandler [ |
| 20 | + ^ exceptionHandler |
| 21 | +] |
| 22 | + |
| 23 | +{ #category : #accessing } |
| 24 | +TKTAbstractExecutor >> exceptionHandler: aHandler [ |
| 25 | + |
| 26 | + exceptionHandler := aHandler |
| 27 | +] |
| 28 | + |
| 29 | +{ #category : #initialization } |
| 30 | +TKTAbstractExecutor >> initialize [ |
| 31 | + super initialize. |
| 32 | + busy := false. |
| 33 | + exceptionHandler := TKTConfiguration errorHandler |
| 34 | +] |
| 35 | + |
| 36 | +{ #category : #'as yet unclassified' } |
| 37 | +TKTAbstractExecutor >> isBusy [ |
| 38 | + |
| 39 | + ^ busy |
| 40 | +] |
| 41 | + |
| 42 | +{ #category : #'as yet unclassified' } |
| 43 | +TKTAbstractExecutor >> isFree [ |
| 44 | + |
| 45 | + ^ busy not |
| 46 | +] |
| 47 | + |
| 48 | +{ #category : #accessing } |
| 49 | +TKTAbstractExecutor >> noteBusy [ |
| 50 | + |
| 51 | + busy := true |
| 52 | +] |
| 53 | + |
| 54 | +{ #category : #accessing } |
| 55 | +TKTAbstractExecutor >> noteFree [ |
| 56 | + |
| 57 | + busy := false |
| 58 | +] |
| 59 | + |
| 60 | +{ #category : #polimorfism } |
| 61 | +TKTAbstractExecutor >> start [ |
| 62 | + " nothing to do " |
| 63 | +] |
| 64 | + |
| 65 | +{ #category : #polimorfsms } |
| 66 | +TKTAbstractExecutor >> stop [ |
| 67 | + |
| 68 | +] |
0 commit comments