author | Claus Gittinger <cg@exept.de> |
Thu, 23 Nov 1995 11:46:35 +0100 | |
changeset 620 | c7353f86a302 |
parent 553 | 791baaae5ece |
child 715 | 59719be1d9d7 |
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 |
||
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 |
|
553
791baaae5ece
revision headers; empty instVarString in bosIn fixed
Claus Gittinger <cg@exept.de>
parents:
351
diff
changeset
|
42 |
^ '$Header: /cvs/stx/stx/libbasic/Attic/ObsoleteObject.st,v 1.6 1995-11-15 11:29:23 cg Exp $' |
90 | 43 |
! |
44 |
||
45 |
documentation |
|
46 |
" |
|
47 |
This class is used for error handling during binary object restoration. |
|
48 |
Whenever an object whose class has changed (i.e. it was stored with a |
|
49 |
different layout/size) is about to be restored, it cannot be made an |
|
50 |
instance of the now existing class. |
|
51 |
In this case, the BinaryInputManager will create a dummy class for the |
|
210 | 52 |
old (obsolete) object. This dummy class will be a subclass of ObsoleteObject. |
90 | 53 |
|
54 |
After the creation of the obsolete object, a signal will be raised (in |
|
55 |
BinaryInputManager), which can be cought by the application to try some |
|
56 |
automatic or semi-automatic object conversion. |
|
57 |
The signal gets the obsolete object and the new class as parameters. |
|
58 |
||
59 |
ObsoleteObject itself catches all messages, to avoid any use of the restored |
|
210 | 60 |
object (in case conversion failed or the signal was ignored). |
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 |
||
294 | 85 |
!ObsoleteObject methodsFor:'private accessing '! |
86 |
||
87 |
displayString |
|
88 |
"this method is required to allow inspection of the object" |
|
89 |
||
90 |
^ (Object compiledMethodAt:#displayString ) |
|
91 |
valueWithReceiver:self |
|
92 |
arguments:nil |
|
93 |
selector:#displayString |
|
94 |
! |
|
95 |
||
96 |
basicInspect |
|
97 |
"this method is required to allow inspection of the object" |
|
98 |
||
99 |
^ Inspector openOn:self |
|
100 |
! |
|
101 |
||
102 |
inspect |
|
103 |
"this method is required to allow inspection of the object" |
|
104 |
||
105 |
^ Inspector openOn:self |
|
106 |
! |
|
107 |
||
108 |
basicAt:index put:something |
|
109 |
"this method is required to allow restore of the object" |
|
110 |
||
111 |
^ (Object compiledMethodAt:#basicAt:put:) |
|
112 |
valueWithReceiver:self |
|
113 |
arguments:(Array with:index with:something) |
|
114 |
selector:#basicAt:put: |
|
115 |
! |
|
116 |
||
309 | 117 |
basicAt:index |
118 |
"this method is required to allow cloning of the object" |
|
119 |
||
120 |
^ (Object compiledMethodAt:#basicAt:) |
|
121 |
valueWithReceiver:self |
|
122 |
arguments:(Array with:index) |
|
123 |
selector:#basicAt: |
|
124 |
! |
|
125 |
||
294 | 126 |
instVarAt:index |
127 |
"this method is required to allow inspection of the object" |
|
128 |
||
129 |
^ (Object compiledMethodAt:#instVarAt:) |
|
130 |
valueWithReceiver:self |
|
131 |
arguments:(Array with:index) |
|
132 |
selector:#instVarAt: |
|
133 |
! |
|
134 |
||
135 |
instVarAt:index put:something |
|
136 |
"this method is required to allow restore of the object" |
|
137 |
||
138 |
^ (Object compiledMethodAt:#instVarAt:put:) |
|
139 |
valueWithReceiver:self |
|
140 |
arguments:(Array with:index with:something) |
|
141 |
selector:#instVarAt:put: |
|
142 |
! |
|
143 |
||
144 |
basicSize |
|
145 |
"this method is required to allow restore of the object" |
|
146 |
||
147 |
^ (Object compiledMethodAt:#basicSize) |
|
148 |
valueWithReceiver:self |
|
149 |
arguments:nil |
|
150 |
selector:#basicSize |
|
151 |
! |
|
152 |
||
153 |
isKindOf:aClass |
|
154 |
"this method is required to allow restore of the object" |
|
155 |
||
156 |
aClass == Object ifTrue:[^ true]. |
|
157 |
^ (Object compiledMethodAt:#isKindOf:) |
|
158 |
valueWithReceiver:self |
|
159 |
arguments:(Array with:aClass) |
|
160 |
selector:#isKindOf: |
|
161 |
! |
|
162 |
||
163 |
class |
|
164 |
"this method is required to allow restore of the object" |
|
165 |
||
166 |
^ (Object compiledMethodAt:#class) |
|
167 |
valueWithReceiver:self |
|
168 |
arguments:nil |
|
169 |
selector:#class |
|
170 |
! |
|
171 |
||
172 |
readBinaryContentsFrom:stream manager:manager |
|
173 |
"this method is required to allow restore of the object" |
|
174 |
||
175 |
^ (Object compiledMethodAt:#readBinaryContentsFrom:manager:) |
|
176 |
valueWithReceiver:self |
|
177 |
arguments:(Array with:stream with:manager) |
|
178 |
selector:#readBinaryContentsFrom:manager: |
|
179 |
! ! |
|
180 |
||
90 | 181 |
!ObsoleteObject methodsFor:'message catching'! |
182 |
||
183 |
doesNotUnderstand: aMessage |
|
210 | 184 |
"the only thing obsolete objects understand is that they dont understand |
185 |
anything." |
|
90 | 186 |
|
210 | 187 |
^ ObsoleteObjectSignal |
188 |
raiseRequestWith:aMessage |
|
90 | 189 |
! ! |
190 |
||
191 |
ObsoleteObject initialize! |