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 |
|
721
|
13 |
nil subclass:#ObsoleteObject
|
1283
|
14 |
instanceVariableNames:''
|
|
15 |
classVariableNames:'ObsoleteObjectSignal'
|
|
16 |
poolDictionaries:''
|
|
17 |
category:'System-BinaryStorage'
|
90
|
18 |
!
|
|
19 |
|
|
20 |
!ObsoleteObject class methodsFor:'documentation'!
|
|
21 |
|
|
22 |
copyright
|
|
23 |
"
|
|
24 |
COPYRIGHT (c) 1994 by Claus Gittinger
|
210
|
25 |
All Rights Reserved
|
90
|
26 |
|
|
27 |
This software is furnished under a license and may be used
|
|
28 |
only in accordance with the terms of that license and with the
|
|
29 |
inclusion of the above copyright notice. This software may not
|
|
30 |
be provided or otherwise made available to, or used by, any
|
|
31 |
other person. No title to or ownership of the software is
|
|
32 |
hereby transferred.
|
|
33 |
"
|
|
34 |
!
|
|
35 |
|
|
36 |
documentation
|
|
37 |
"
|
|
38 |
This class is used for error handling during binary object restoration.
|
|
39 |
Whenever an object whose class has changed (i.e. it was stored with a
|
|
40 |
different layout/size) is about to be restored, it cannot be made an
|
|
41 |
instance of the now existing class.
|
|
42 |
In this case, the BinaryInputManager will create a dummy class for the
|
210
|
43 |
old (obsolete) object. This dummy class will be a subclass of ObsoleteObject.
|
90
|
44 |
|
|
45 |
After the creation of the obsolete object, a signal will be raised (in
|
|
46 |
BinaryInputManager), which can be cought by the application to try some
|
|
47 |
automatic or semi-automatic object conversion.
|
|
48 |
The signal gets the obsolete object and the new class as parameters.
|
|
49 |
|
|
50 |
ObsoleteObject itself catches all messages, to avoid any use of the restored
|
210
|
51 |
object (in case conversion failed or the signal was ignored).
|
1301
|
52 |
|
|
53 |
[author:]
|
|
54 |
Claus Gittinger
|
|
55 |
|
|
56 |
[see also:]
|
|
57 |
BinaryObjectStorage
|
|
58 |
BinaryIOManager
|
|
59 |
PersistencyManager
|
|
60 |
(binary object storage : programming/binaryStore.html )
|
90
|
61 |
"
|
|
62 |
! !
|
|
63 |
|
|
64 |
!ObsoleteObject class methodsFor:'initialization'!
|
|
65 |
|
|
66 |
initialize
|
210
|
67 |
ObsoleteObjectSignal isNil ifTrue:[
|
|
68 |
ObsoleteObjectSignal := (Signal new) mayProceed:false.
|
|
69 |
ObsoleteObjectSignal nameClass:self message:#obsoleteObjectSignal.
|
|
70 |
ObsoleteObjectSignal notifierString:'use of obsolete object'.
|
|
71 |
|
|
72 |
self setSuperclass:nil
|
|
73 |
]
|
|
74 |
! !
|
|
75 |
|
351
|
76 |
!ObsoleteObject class methodsFor:'Signal constants'!
|
210
|
77 |
|
|
78 |
obsoleteObjectSignal
|
|
79 |
"return the signal raised when a message is sent to an Obsolete
|
|
80 |
signal"
|
|
81 |
|
|
82 |
^ ObsoleteObjectSignal
|
90
|
83 |
! !
|
|
84 |
|
715
|
85 |
!ObsoleteObject methodsFor:'message catching'!
|
|
86 |
|
|
87 |
doesNotUnderstand: aMessage
|
|
88 |
"the only thing obsolete objects understand is that they dont understand
|
|
89 |
anything."
|
|
90 |
|
|
91 |
^ ObsoleteObjectSignal
|
|
92 |
raiseRequestWith:aMessage
|
|
93 |
! !
|
|
94 |
|
294
|
95 |
!ObsoleteObject methodsFor:'private accessing '!
|
|
96 |
|
715
|
97 |
basicAt:index
|
|
98 |
"this method is required to allow cloning of the object"
|
294
|
99 |
|
715
|
100 |
^ (Object compiledMethodAt:#basicAt:)
|
|
101 |
valueWithReceiver:self
|
|
102 |
arguments:(Array with:index)
|
|
103 |
selector:#basicAt:
|
294
|
104 |
!
|
|
105 |
|
|
106 |
basicAt:index put:something
|
|
107 |
"this method is required to allow restore of the object"
|
|
108 |
|
|
109 |
^ (Object compiledMethodAt:#basicAt:put:)
|
|
110 |
valueWithReceiver:self
|
|
111 |
arguments:(Array with:index with:something)
|
|
112 |
selector:#basicAt:put:
|
|
113 |
!
|
|
114 |
|
715
|
115 |
basicInspect
|
|
116 |
"this method is required to allow inspection of the object"
|
|
117 |
|
|
118 |
^ Inspector openOn:self
|
|
119 |
!
|
|
120 |
|
|
121 |
basicSize
|
|
122 |
"this method is required to allow restore of the object"
|
|
123 |
|
|
124 |
^ (Object compiledMethodAt:#basicSize)
|
|
125 |
valueWithReceiver:self
|
|
126 |
arguments:nil
|
|
127 |
selector:#basicSize
|
|
128 |
!
|
|
129 |
|
|
130 |
class
|
|
131 |
"this method is required to allow restore of the object"
|
309
|
132 |
|
715
|
133 |
^ (Object compiledMethodAt:#class)
|
309
|
134 |
valueWithReceiver:self
|
715
|
135 |
arguments:nil
|
|
136 |
selector:#class
|
|
137 |
!
|
|
138 |
|
|
139 |
displayString
|
|
140 |
"this method is required to allow inspection of the object"
|
|
141 |
|
|
142 |
^ (Object compiledMethodAt:#displayString )
|
|
143 |
valueWithReceiver:self
|
|
144 |
arguments:nil
|
|
145 |
selector:#displayString
|
|
146 |
!
|
|
147 |
|
|
148 |
inspect
|
|
149 |
"this method is required to allow inspection of the object"
|
|
150 |
|
|
151 |
^ Inspector openOn:self
|
309
|
152 |
!
|
|
153 |
|
294
|
154 |
instVarAt:index
|
|
155 |
"this method is required to allow inspection of the object"
|
|
156 |
|
|
157 |
^ (Object compiledMethodAt:#instVarAt:)
|
|
158 |
valueWithReceiver:self
|
|
159 |
arguments:(Array with:index)
|
|
160 |
selector:#instVarAt:
|
|
161 |
!
|
|
162 |
|
|
163 |
instVarAt:index put:something
|
|
164 |
"this method is required to allow restore of the object"
|
|
165 |
|
|
166 |
^ (Object compiledMethodAt:#instVarAt:put:)
|
|
167 |
valueWithReceiver:self
|
|
168 |
arguments:(Array with:index with:something)
|
|
169 |
selector:#instVarAt:put:
|
|
170 |
!
|
|
171 |
|
|
172 |
isKindOf:aClass
|
|
173 |
"this method is required to allow restore of the object"
|
|
174 |
|
|
175 |
aClass == Object ifTrue:[^ true].
|
|
176 |
^ (Object compiledMethodAt:#isKindOf:)
|
|
177 |
valueWithReceiver:self
|
|
178 |
arguments:(Array with:aClass)
|
|
179 |
selector:#isKindOf:
|
|
180 |
!
|
|
181 |
|
|
182 |
readBinaryContentsFrom:stream manager:manager
|
|
183 |
"this method is required to allow restore of the object"
|
|
184 |
|
|
185 |
^ (Object compiledMethodAt:#readBinaryContentsFrom:manager:)
|
|
186 |
valueWithReceiver:self
|
|
187 |
arguments:(Array with:stream with:manager)
|
|
188 |
selector:#readBinaryContentsFrom:manager:
|
|
189 |
! !
|
|
190 |
|
715
|
191 |
!ObsoleteObject class methodsFor:'documentation'!
|
90
|
192 |
|
715
|
193 |
version
|
1301
|
194 |
^ '$Header: /cvs/stx/stx/libbasic/Attic/ObsoleteObject.st,v 1.11 1996-04-25 18:27:57 cg Exp $'
|
90
|
195 |
! !
|
|
196 |
ObsoleteObject initialize!
|