ObsoleteObject.st
author claus
Mon, 21 Nov 1994 18:05:13 +0100
changeset 210 2138d09a96ff
parent 90 94259bf1f459
child 294 21e9123719d4
permissions -rw-r--r--
*** empty log message ***

"
 COPYRIGHT (c) 1994 by Claus Gittinger
	      All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"

Object subclass:#ObsoleteObject
       instanceVariableNames:''
       classVariableNames:'ObsoleteObjectSignal'
       poolDictionaries:''
       category:'System-BinaryStorage'
!

ObsoleteObject comment:'
COPYRIGHT (c) 1994 by Claus Gittinger
	      All Rights Reserved
'!

!ObsoleteObject class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 1994 by Claus Gittinger
	      All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"
!

version
"
$Header: /cvs/stx/stx/libbasic/Attic/ObsoleteObject.st,v 1.2 1994-11-21 17:05:13 claus Exp $
"
!

documentation
"
    This class is used for error handling during binary object restoration. 
    Whenever an object whose class has changed (i.e. it was stored with a 
    different layout/size) is about to be restored, it cannot be made an 
    instance of the now existing class.
    In this case, the BinaryInputManager will create a dummy class for the 
    old (obsolete) object. This dummy class will be a subclass of ObsoleteObject.

    After the creation of the obsolete object, a signal will be raised (in 
    BinaryInputManager), which can be cought by the application to try some 
    automatic or semi-automatic object conversion.
    The signal gets the obsolete object and the new class as parameters.

    ObsoleteObject itself catches all messages, to avoid any use of the restored
    object (in case conversion failed or the signal was ignored).
"
! !

!ObsoleteObject class methodsFor:'initialization'!

initialize
    ObsoleteObjectSignal isNil ifTrue:[
	ObsoleteObjectSignal := (Signal new) mayProceed:false.
	ObsoleteObjectSignal nameClass:self message:#obsoleteObjectSignal.
	ObsoleteObjectSignal notifierString:'use of obsolete object'.

	self setSuperclass:nil
    ]
! !

!ObsoleteObject class methodsFor:'signal access'!

obsoleteObjectSignal
    "return the signal raised when a message is sent to an Obsolete
     signal"

    ^ ObsoleteObjectSignal
! !

!ObsoleteObject methodsFor:'message catching'!

doesNotUnderstand: aMessage
	"the only thing obsolete objects understand is that they dont understand
	 anything."

	^ ObsoleteObjectSignal 
		 raiseRequestWith:aMessage
! !

ObsoleteObject initialize!