CachedValue.st
author Claus Gittinger <cg@exept.de>
Wed, 31 Oct 2012 12:59:16 +0100
changeset 2835 88ddcdf93432
child 2847 7a563655c3b6
permissions -rw-r--r--
initial checkin
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2835
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
 COPYRIGHT (c) 2012 by eXept Software AG
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
              All Rights Reserved
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
"{ Package: 'stx:libbasic2' }"
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
Object subclass:#CachedValue
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
	instanceVariableNames:'value expirationTime computation validityDuration'
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
	classVariableNames:''
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	poolDictionaries:''
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	category:'Kernel-Processes'
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
!
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
NotFoundError subclass:#ValueExpiredException
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
	instanceVariableNames:''
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
	classVariableNames:''
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
	poolDictionaries:''
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
	privateIn:CachedValue
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
!
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
!CachedValue class methodsFor:'documentation'!
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
copyright
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
"
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 COPYRIGHT (c) 2012 by eXept Software AG
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
              All Rights Reserved
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
 This software is furnished under a license and may be used
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
 only in accordance with the terms of that license and with the
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
 inclusion of the above copyright notice.   This software may not
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
 be provided or otherwise made available to, or used by, any
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
 other person.  No title to or ownership of the software is
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
 hereby transferred.
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
"
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
!
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
documentation
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
"
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
    Instances of CachedValue can be used for values which are costly to evaluate,
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
    but which can be cached for some time. 
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
    For example, when asking a source code repository for the set of symbolic names,
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
    this query takes a few seconds (a CVS roundtrip). However, this information can easily
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
    be cached and remembered for some time (say 30seconds or so), to speed up followup
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
    repository operations.
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
    You may find more similar uses of this class.
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
    [author:]
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
        Claus Gittinger
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
    [instance variables:]
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
        value ..................... the computed (cached value)
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
        expirationTime ............ timeStamp, when this value becomes obsolete
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
        validDuration ............. timeDuration, how long a computed value remains valid
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
        computation ............... a computation block, to recompute the value.
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
    [class variables:]
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
    [see also:]
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
"
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
!
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
examples
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
"
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
                                                                        [exBegin]
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
        |cv exceptionRaised didCompute|
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
        didCompute := false.
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
        cv := CachedValue compute:[didCompute := true. Date today dayOfWeek] validityDuration:(2 seconds).
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
        self assert:(cv isValid not).
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
        self assert:(didCompute not).
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
        self assert:(cv value = Date today dayOfWeek).
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
        self assert:(cv isValid).
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
        self assert:(didCompute).
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
        Delay waitForSeconds:3.
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
        didCompute := false.
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
        self assert:(cv isValid not).
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
        self assert:(didCompute not).
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
        self assert:(cv value = Date today dayOfWeek).
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
        self assert:(cv isValid).
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
        self assert:(didCompute).
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
                                                                        [exEnd]
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
                                                                        [exBegin]
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
        |cv exceptionRaised|
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
        cv := CachedValue value:123 expirationTime:(Timestamp now + 2 seconds).
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
        self assert:(cv isValid).
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
        Delay waitForSeconds:3.
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
        self assert:(cv isValid not).
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
        exceptionRaised := false.
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
        ValueExpiredException handle:[:ex |
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
            exceptionRaised := true.
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
        ] do:[
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
            cv value
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
        ].
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
        self assert:exceptionRaised.
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
                                                                        [exEnd]
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
"
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
! !
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
!CachedValue class methodsFor:'instance creation'!
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
compute:actionBlock validityDuration:aTimeduration
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
    "return a 'self computing' cachedvalue, which ceases to be valid aTimeduration after
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
     it has computed its value. 
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
     If asked again for a value, it will automatically recompute the value."
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
    ^ self new 
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
        compute:actionBlock validityDuration:aTimeduration
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
!
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
value:valueArg expirationTime:aTimestamp
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
    "return a 'one shot' cachedValue, which ceases to be valid at expirationTime.
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
     If asked for the value after that, an exception is raised
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
     (i.e. it does not automatically recompute a value)"
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
    ^ self new 
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
        value:valueArg expirationTime:aTimestamp
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
! !
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
!CachedValue methodsFor:'accessing'!
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
compute:computationBlock validityDuration:aTimeduration
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
    computation := computationBlock.
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
    validityDuration := aTimeduration
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
!
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
expirationTime:something
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
    expirationTime := something.
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
!
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
value
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
    "return my value. If not yet computed or expired, recompute using the computation block.
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
     Otherwise return the cacehdValue"
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
    self isValid ifFalse:[
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   146
        validityDuration isNil ifTrue:[
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
            ValueExpiredException raiseRequestWith:self.
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
            ^ nil
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
        ].
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
        self computeCachedValue
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
    ].
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
    ^ value
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
!
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   155
value:valueArg expirationTime:aTimestamp
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
    value := valueArg.
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   157
    expirationTime := aTimestamp
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   158
! !
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   159
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   160
!CachedValue methodsFor:'private'!
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   161
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   162
computeCachedValue
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   163
    expirationTime := Timestamp now + validityDuration.
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   164
    value := computation value.
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   165
! !
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   166
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
!CachedValue methodsFor:'queries'!
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   168
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   169
isValid
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   170
    "true if the cached value is still valid"
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   171
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   172
    expirationTime notNil ifTrue:[
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   173
        expirationTime > Timestamp now ifTrue:[
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   174
            ^ true
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
        ].
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   176
        expirationTime := nil.
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   177
    ].
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
    ^ false
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   179
! !
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   180
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   181
!CachedValue::ValueExpiredException class methodsFor:'documentation'!
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   182
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   183
documentation
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   184
"
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   185
    raised when a cachedValue has expired
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   186
"
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
! !
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   188
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   189
!CachedValue::ValueExpiredException class methodsFor:'initialization'!
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
initialize
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
    NotifierString := 'value expired'.
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
! !
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
!CachedValue class methodsFor:'documentation'!
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   197
version
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
    ^ '$Header: /cvs/stx/stx/libbasic2/CachedValue.st,v 1.1 2012-10-31 11:59:16 cg Exp $'
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
!
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
version_CVS
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
    ^ '$Header: /cvs/stx/stx/libbasic2/CachedValue.st,v 1.1 2012-10-31 11:59:16 cg Exp $'
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
! !
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
88ddcdf93432 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
CachedValue::ValueExpiredException initialize!