1
0
Fork 0

ipa: Make the handler a variable on the class side

* Making it a classVariable will make subclasses manipulate the
base variable. By making it a variable on the class side avoids
this issue.
This commit is contained in:
Holger Hans Peter Freyther 2013-04-29 09:53:29 +02:00
parent 12bdaf75f6
commit 3e8d588e9b
1 changed files with 8 additions and 2 deletions

View File

@ -24,7 +24,9 @@ Object subclass: IPAProtoHandler [
behavior.'>
<category: 'OsmoNetwork-IPA'>
handlers := nil.
IPAProtoHandler class [
| handlers |
]
IPAProtoHandler class >> initialize [
<category: 'private'>
@ -35,6 +37,10 @@ Object subclass: IPAProtoHandler [
at: IPAConstants msgIdAck put: #handleIdAck:.
]
IPAProtoHandler class >> handlers [
^ handlers
]
registerOn: aDispatcher [
<category: 'initialize'>
aDispatcher addHandler: IPAConstants protocolIPA on: self with: #handleMsg:.
@ -54,7 +60,7 @@ Object subclass: IPAProtoHandler [
| selector |
<category: 'dispatch'>
selector := handlers at: (aMsg first asInteger) ifAbsent: [
selector := self class handlers at: (aMsg first asInteger) ifAbsent: [
self logError: 'IPA message not understood', aMsg first asInteger asString
area: #ipa.
^ false