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:
parent
12bdaf75f6
commit
3e8d588e9b
|
@ -24,7 +24,9 @@ Object subclass: IPAProtoHandler [
|
||||||
behavior.'>
|
behavior.'>
|
||||||
<category: 'OsmoNetwork-IPA'>
|
<category: 'OsmoNetwork-IPA'>
|
||||||
|
|
||||||
handlers := nil.
|
IPAProtoHandler class [
|
||||||
|
| handlers |
|
||||||
|
]
|
||||||
|
|
||||||
IPAProtoHandler class >> initialize [
|
IPAProtoHandler class >> initialize [
|
||||||
<category: 'private'>
|
<category: 'private'>
|
||||||
|
@ -35,6 +37,10 @@ Object subclass: IPAProtoHandler [
|
||||||
at: IPAConstants msgIdAck put: #handleIdAck:.
|
at: IPAConstants msgIdAck put: #handleIdAck:.
|
||||||
]
|
]
|
||||||
|
|
||||||
|
IPAProtoHandler class >> handlers [
|
||||||
|
^ handlers
|
||||||
|
]
|
||||||
|
|
||||||
registerOn: aDispatcher [
|
registerOn: aDispatcher [
|
||||||
<category: 'initialize'>
|
<category: 'initialize'>
|
||||||
aDispatcher addHandler: IPAConstants protocolIPA on: self with: #handleMsg:.
|
aDispatcher addHandler: IPAConstants protocolIPA on: self with: #handleMsg:.
|
||||||
|
@ -54,7 +60,7 @@ Object subclass: IPAProtoHandler [
|
||||||
| selector |
|
| selector |
|
||||||
<category: 'dispatch'>
|
<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
|
self logError: 'IPA message not understood', aMsg first asInteger asString
|
||||||
area: #ipa.
|
area: #ipa.
|
||||||
^ false
|
^ false
|
||||||
|
|
Reference in New Issue