90
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1994 by Claus Gittinger
|
210
|
3 |
All Rights Reserved
|
90
|
4 |
|
|
5 |
This software is furnished under a license and may be used
|
|
6 |
only in accordance with the terms of that license and with the
|
|
7 |
inclusion of the above copyright notice. This software may not
|
|
8 |
be provided or otherwise made available to, or used by, any
|
|
9 |
other person. No title to or ownership of the software is
|
|
10 |
hereby transferred.
|
|
11 |
"
|
|
12 |
|
|
13 |
Object subclass:#ObsoleteObject
|
|
14 |
instanceVariableNames:''
|
210
|
15 |
classVariableNames:'ObsoleteObjectSignal'
|
90
|
16 |
poolDictionaries:''
|
210
|
17 |
category:'System-BinaryStorage'
|
90
|
18 |
!
|
|
19 |
|
|
20 |
ObsoleteObject comment:'
|
|
21 |
COPYRIGHT (c) 1994 by Claus Gittinger
|
210
|
22 |
All Rights Reserved
|
90
|
23 |
'!
|
|
24 |
|
|
25 |
!ObsoleteObject class methodsFor:'documentation'!
|
|
26 |
|
|
27 |
copyright
|
|
28 |
"
|
|
29 |
COPYRIGHT (c) 1994 by Claus Gittinger
|
210
|
30 |
All Rights Reserved
|
90
|
31 |
|
|
32 |
This software is furnished under a license and may be used
|
|
33 |
only in accordance with the terms of that license and with the
|
|
34 |
inclusion of the above copyright notice. This software may not
|
|
35 |
be provided or otherwise made available to, or used by, any
|
|
36 |
other person. No title to or ownership of the software is
|
|
37 |
hereby transferred.
|
|
38 |
"
|
|
39 |
!
|
|
40 |
|
|
41 |
version
|
|
42 |
"
|
210
|
43 |
$Header: /cvs/stx/stx/libbasic/Attic/ObsoleteObject.st,v 1.2 1994-11-21 17:05:13 claus Exp $
|
90
|
44 |
"
|
|
45 |
!
|
|
46 |
|
|
47 |
documentation
|
|
48 |
"
|
|
49 |
This class is used for error handling during binary object restoration.
|
|
50 |
Whenever an object whose class has changed (i.e. it was stored with a
|
|
51 |
different layout/size) is about to be restored, it cannot be made an
|
|
52 |
instance of the now existing class.
|
|
53 |
In this case, the BinaryInputManager will create a dummy class for the
|
210
|
54 |
old (obsolete) object. This dummy class will be a subclass of ObsoleteObject.
|
90
|
55 |
|
|
56 |
After the creation of the obsolete object, a signal will be raised (in
|
|
57 |
BinaryInputManager), which can be cought by the application to try some
|
|
58 |
automatic or semi-automatic object conversion.
|
|
59 |
The signal gets the obsolete object and the new class as parameters.
|
|
60 |
|
|
61 |
ObsoleteObject itself catches all messages, to avoid any use of the restored
|
210
|
62 |
object (in case conversion failed or the signal was ignored).
|
90
|
63 |
"
|
|
64 |
! !
|
|
65 |
|
|
66 |
!ObsoleteObject class methodsFor:'initialization'!
|
|
67 |
|
|
68 |
initialize
|
210
|
69 |
ObsoleteObjectSignal isNil ifTrue:[
|
|
70 |
ObsoleteObjectSignal := (Signal new) mayProceed:false.
|
|
71 |
ObsoleteObjectSignal nameClass:self message:#obsoleteObjectSignal.
|
|
72 |
ObsoleteObjectSignal notifierString:'use of obsolete object'.
|
|
73 |
|
|
74 |
self setSuperclass:nil
|
|
75 |
]
|
|
76 |
! !
|
|
77 |
|
|
78 |
!ObsoleteObject class methodsFor:'signal access'!
|
|
79 |
|
|
80 |
obsoleteObjectSignal
|
|
81 |
"return the signal raised when a message is sent to an Obsolete
|
|
82 |
signal"
|
|
83 |
|
|
84 |
^ ObsoleteObjectSignal
|
90
|
85 |
! !
|
|
86 |
|
|
87 |
!ObsoleteObject methodsFor:'message catching'!
|
|
88 |
|
|
89 |
doesNotUnderstand: aMessage
|
210
|
90 |
"the only thing obsolete objects understand is that they dont understand
|
|
91 |
anything."
|
90
|
92 |
|
210
|
93 |
^ ObsoleteObjectSignal
|
|
94 |
raiseRequestWith:aMessage
|
90
|
95 |
! !
|
|
96 |
|
|
97 |
ObsoleteObject initialize!
|