author | Claus Gittinger <cg@exept.de> |
Mon, 16 Jun 1997 20:21:41 +0200 | |
changeset 2689 | ada9b102abcf |
parent 1962 | 27bfab5c9c38 |
child 2957 | 46015145c398 |
permissions | -rw-r--r-- |
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 |
||
1962
27bfab5c9c38
restore 2byte ID's via nextUnsignedShort.
Claus Gittinger <cg@exept.de>
parents:
1677
diff
changeset
|
20 |
!ObsoleteObject class methodsFor:'documentation'! |
90 | 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 |
|
2689 | 46 |
BinaryInputManager), which can be caught by the application to try some |
90 | 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 |
||
1962
27bfab5c9c38
restore 2byte ID's via nextUnsignedShort.
Claus Gittinger <cg@exept.de>
parents:
1677
diff
changeset
|
64 |
!ObsoleteObject class methodsFor:'initialization'! |
90 | 65 |
|
66 |
initialize |
|
1320 | 67 |
|
210 | 68 |
ObsoleteObjectSignal isNil ifTrue:[ |
1320 | 69 |
ObsoleteObjectSignal := (Signal new) mayProceed:false. |
70 |
ObsoleteObjectSignal nameClass:self message:#obsoleteObjectSignal. |
|
71 |
ObsoleteObjectSignal notifierString:'use of obsolete object'. |
|
210 | 72 |
|
1320 | 73 |
self setSuperclass:nil |
210 | 74 |
] |
1320 | 75 |
|
76 |
"Modified: 30.4.1996 / 14:46:13 / cg" |
|
210 | 77 |
! ! |
78 |
||
1962
27bfab5c9c38
restore 2byte ID's via nextUnsignedShort.
Claus Gittinger <cg@exept.de>
parents:
1677
diff
changeset
|
79 |
!ObsoleteObject class methodsFor:'Signal constants'! |
210 | 80 |
|
81 |
obsoleteObjectSignal |
|
82 |
"return the signal raised when a message is sent to an Obsolete |
|
1320 | 83 |
signal." |
210 | 84 |
|
85 |
^ ObsoleteObjectSignal |
|
1320 | 86 |
|
87 |
"Modified: 30.4.1996 / 14:46:27 / cg" |
|
90 | 88 |
! ! |
89 |
||
715 | 90 |
!ObsoleteObject methodsFor:'message catching'! |
91 |
||
92 |
doesNotUnderstand: aMessage |
|
1677
3661734c67d0
also needs #become:, #becomeSameAs: and #becomeNil
Claus Gittinger <cg@exept.de>
parents:
1320
diff
changeset
|
93 |
"the only thing obsolete objects understand is that they dont understand |
3661734c67d0
also needs #become:, #becomeSameAs: and #becomeNil
Claus Gittinger <cg@exept.de>
parents:
1320
diff
changeset
|
94 |
anything." |
715 | 95 |
|
1677
3661734c67d0
also needs #become:, #becomeSameAs: and #becomeNil
Claus Gittinger <cg@exept.de>
parents:
1320
diff
changeset
|
96 |
^ ObsoleteObjectSignal |
3661734c67d0
also needs #become:, #becomeSameAs: and #becomeNil
Claus Gittinger <cg@exept.de>
parents:
1320
diff
changeset
|
97 |
raiseRequestWith:aMessage |
3661734c67d0
also needs #become:, #becomeSameAs: and #becomeNil
Claus Gittinger <cg@exept.de>
parents:
1320
diff
changeset
|
98 |
|
3661734c67d0
also needs #become:, #becomeSameAs: and #becomeNil
Claus Gittinger <cg@exept.de>
parents:
1320
diff
changeset
|
99 |
"Modified: 23.9.1996 / 15:17:37 / cg" |
715 | 100 |
! ! |
101 |
||
1320 | 102 |
!ObsoleteObject methodsFor:'required protocol'! |
294 | 103 |
|
715 | 104 |
basicAt:index |
105 |
"this method is required to allow cloning of the object" |
|
294 | 106 |
|
715 | 107 |
^ (Object compiledMethodAt:#basicAt:) |
108 |
valueWithReceiver:self |
|
109 |
arguments:(Array with:index) |
|
110 |
selector:#basicAt: |
|
294 | 111 |
! |
112 |
||
113 |
basicAt:index put:something |
|
114 |
"this method is required to allow restore of the object" |
|
115 |
||
116 |
^ (Object compiledMethodAt:#basicAt:put:) |
|
117 |
valueWithReceiver:self |
|
118 |
arguments:(Array with:index with:something) |
|
119 |
selector:#basicAt:put: |
|
120 |
! |
|
121 |
||
715 | 122 |
basicInspect |
123 |
"this method is required to allow inspection of the object" |
|
124 |
||
125 |
^ Inspector openOn:self |
|
126 |
! |
|
127 |
||
128 |
basicSize |
|
129 |
"this method is required to allow restore of the object" |
|
130 |
||
131 |
^ (Object compiledMethodAt:#basicSize) |
|
132 |
valueWithReceiver:self |
|
133 |
arguments:nil |
|
134 |
selector:#basicSize |
|
135 |
! |
|
136 |
||
1677
3661734c67d0
also needs #become:, #becomeSameAs: and #becomeNil
Claus Gittinger <cg@exept.de>
parents:
1320
diff
changeset
|
137 |
become:index |
3661734c67d0
also needs #become:, #becomeSameAs: and #becomeNil
Claus Gittinger <cg@exept.de>
parents:
1320
diff
changeset
|
138 |
"this method is required to allow cloning of the object" |
3661734c67d0
also needs #become:, #becomeSameAs: and #becomeNil
Claus Gittinger <cg@exept.de>
parents:
1320
diff
changeset
|
139 |
|
3661734c67d0
also needs #become:, #becomeSameAs: and #becomeNil
Claus Gittinger <cg@exept.de>
parents:
1320
diff
changeset
|
140 |
^ (Object compiledMethodAt:#become:) |
3661734c67d0
also needs #become:, #becomeSameAs: and #becomeNil
Claus Gittinger <cg@exept.de>
parents:
1320
diff
changeset
|
141 |
valueWithReceiver:self |
3661734c67d0
also needs #become:, #becomeSameAs: and #becomeNil
Claus Gittinger <cg@exept.de>
parents:
1320
diff
changeset
|
142 |
arguments:(Array with:index) |
3661734c67d0
also needs #become:, #becomeSameAs: and #becomeNil
Claus Gittinger <cg@exept.de>
parents:
1320
diff
changeset
|
143 |
selector:#become: |
3661734c67d0
also needs #become:, #becomeSameAs: and #becomeNil
Claus Gittinger <cg@exept.de>
parents:
1320
diff
changeset
|
144 |
|
3661734c67d0
also needs #become:, #becomeSameAs: and #becomeNil
Claus Gittinger <cg@exept.de>
parents:
1320
diff
changeset
|
145 |
"Created: 23.9.1996 / 15:16:37 / cg" |
3661734c67d0
also needs #become:, #becomeSameAs: and #becomeNil
Claus Gittinger <cg@exept.de>
parents:
1320
diff
changeset
|
146 |
! |
3661734c67d0
also needs #become:, #becomeSameAs: and #becomeNil
Claus Gittinger <cg@exept.de>
parents:
1320
diff
changeset
|
147 |
|
3661734c67d0
also needs #become:, #becomeSameAs: and #becomeNil
Claus Gittinger <cg@exept.de>
parents:
1320
diff
changeset
|
148 |
becomeNil |
3661734c67d0
also needs #become:, #becomeSameAs: and #becomeNil
Claus Gittinger <cg@exept.de>
parents:
1320
diff
changeset
|
149 |
"this method is required to allow restore of the object" |
3661734c67d0
also needs #become:, #becomeSameAs: and #becomeNil
Claus Gittinger <cg@exept.de>
parents:
1320
diff
changeset
|
150 |
|
3661734c67d0
also needs #become:, #becomeSameAs: and #becomeNil
Claus Gittinger <cg@exept.de>
parents:
1320
diff
changeset
|
151 |
^ (Object compiledMethodAt:#becomeNil) |
3661734c67d0
also needs #become:, #becomeSameAs: and #becomeNil
Claus Gittinger <cg@exept.de>
parents:
1320
diff
changeset
|
152 |
valueWithReceiver:self |
3661734c67d0
also needs #become:, #becomeSameAs: and #becomeNil
Claus Gittinger <cg@exept.de>
parents:
1320
diff
changeset
|
153 |
arguments:nil |
3661734c67d0
also needs #become:, #becomeSameAs: and #becomeNil
Claus Gittinger <cg@exept.de>
parents:
1320
diff
changeset
|
154 |
selector:#becomeNil |
3661734c67d0
also needs #become:, #becomeSameAs: and #becomeNil
Claus Gittinger <cg@exept.de>
parents:
1320
diff
changeset
|
155 |
|
3661734c67d0
also needs #become:, #becomeSameAs: and #becomeNil
Claus Gittinger <cg@exept.de>
parents:
1320
diff
changeset
|
156 |
"Created: 23.9.1996 / 15:17:14 / cg" |
3661734c67d0
also needs #become:, #becomeSameAs: and #becomeNil
Claus Gittinger <cg@exept.de>
parents:
1320
diff
changeset
|
157 |
! |
3661734c67d0
also needs #become:, #becomeSameAs: and #becomeNil
Claus Gittinger <cg@exept.de>
parents:
1320
diff
changeset
|
158 |
|
3661734c67d0
also needs #become:, #becomeSameAs: and #becomeNil
Claus Gittinger <cg@exept.de>
parents:
1320
diff
changeset
|
159 |
becomeSameAs:index |
3661734c67d0
also needs #become:, #becomeSameAs: and #becomeNil
Claus Gittinger <cg@exept.de>
parents:
1320
diff
changeset
|
160 |
"this method is required to allow cloning of the object" |
3661734c67d0
also needs #become:, #becomeSameAs: and #becomeNil
Claus Gittinger <cg@exept.de>
parents:
1320
diff
changeset
|
161 |
|
3661734c67d0
also needs #become:, #becomeSameAs: and #becomeNil
Claus Gittinger <cg@exept.de>
parents:
1320
diff
changeset
|
162 |
^ (Object compiledMethodAt:#becomeSameAs:) |
3661734c67d0
also needs #become:, #becomeSameAs: and #becomeNil
Claus Gittinger <cg@exept.de>
parents:
1320
diff
changeset
|
163 |
valueWithReceiver:self |
3661734c67d0
also needs #become:, #becomeSameAs: and #becomeNil
Claus Gittinger <cg@exept.de>
parents:
1320
diff
changeset
|
164 |
arguments:(Array with:index) |
3661734c67d0
also needs #become:, #becomeSameAs: and #becomeNil
Claus Gittinger <cg@exept.de>
parents:
1320
diff
changeset
|
165 |
selector:#becomeSameAs: |
3661734c67d0
also needs #become:, #becomeSameAs: and #becomeNil
Claus Gittinger <cg@exept.de>
parents:
1320
diff
changeset
|
166 |
|
3661734c67d0
also needs #become:, #becomeSameAs: and #becomeNil
Claus Gittinger <cg@exept.de>
parents:
1320
diff
changeset
|
167 |
"Created: 23.9.1996 / 15:16:50 / cg" |
3661734c67d0
also needs #become:, #becomeSameAs: and #becomeNil
Claus Gittinger <cg@exept.de>
parents:
1320
diff
changeset
|
168 |
! |
3661734c67d0
also needs #become:, #becomeSameAs: and #becomeNil
Claus Gittinger <cg@exept.de>
parents:
1320
diff
changeset
|
169 |
|
715 | 170 |
class |
171 |
"this method is required to allow restore of the object" |
|
309 | 172 |
|
715 | 173 |
^ (Object compiledMethodAt:#class) |
309 | 174 |
valueWithReceiver:self |
715 | 175 |
arguments:nil |
176 |
selector:#class |
|
177 |
! |
|
178 |
||
179 |
displayString |
|
180 |
"this method is required to allow inspection of the object" |
|
181 |
||
182 |
^ (Object compiledMethodAt:#displayString ) |
|
183 |
valueWithReceiver:self |
|
184 |
arguments:nil |
|
185 |
selector:#displayString |
|
186 |
! |
|
187 |
||
188 |
inspect |
|
189 |
"this method is required to allow inspection of the object" |
|
190 |
||
191 |
^ Inspector openOn:self |
|
309 | 192 |
! |
193 |
||
294 | 194 |
instVarAt:index |
195 |
"this method is required to allow inspection of the object" |
|
196 |
||
197 |
^ (Object compiledMethodAt:#instVarAt:) |
|
198 |
valueWithReceiver:self |
|
199 |
arguments:(Array with:index) |
|
200 |
selector:#instVarAt: |
|
201 |
! |
|
202 |
||
203 |
instVarAt:index put:something |
|
204 |
"this method is required to allow restore of the object" |
|
205 |
||
206 |
^ (Object compiledMethodAt:#instVarAt:put:) |
|
207 |
valueWithReceiver:self |
|
208 |
arguments:(Array with:index with:something) |
|
209 |
selector:#instVarAt:put: |
|
210 |
! |
|
211 |
||
212 |
isKindOf:aClass |
|
213 |
"this method is required to allow restore of the object" |
|
214 |
||
215 |
aClass == Object ifTrue:[^ true]. |
|
216 |
^ (Object compiledMethodAt:#isKindOf:) |
|
217 |
valueWithReceiver:self |
|
218 |
arguments:(Array with:aClass) |
|
219 |
selector:#isKindOf: |
|
220 |
! |
|
221 |
||
222 |
readBinaryContentsFrom:stream manager:manager |
|
223 |
"this method is required to allow restore of the object" |
|
224 |
||
225 |
^ (Object compiledMethodAt:#readBinaryContentsFrom:manager:) |
|
226 |
valueWithReceiver:self |
|
227 |
arguments:(Array with:stream with:manager) |
|
228 |
selector:#readBinaryContentsFrom:manager: |
|
229 |
! ! |
|
230 |
||
1962
27bfab5c9c38
restore 2byte ID's via nextUnsignedShort.
Claus Gittinger <cg@exept.de>
parents:
1677
diff
changeset
|
231 |
!ObsoleteObject class methodsFor:'documentation'! |
90 | 232 |
|
715 | 233 |
version |
2689 | 234 |
^ '$Header: /cvs/stx/stx/libbasic/Attic/ObsoleteObject.st,v 1.15 1997-06-16 18:21:23 cg Exp $' |
90 | 235 |
! ! |
236 |
ObsoleteObject initialize! |