diff --git a/src/PharoLink/PharoLinkErrorRequestSignal.class.st b/src/PharoLink/PharoLinkErrorRequestSignal.class.st index c6d7819..1545c11 100644 --- a/src/PharoLink/PharoLinkErrorRequestSignal.class.st +++ b/src/PharoLink/PharoLinkErrorRequestSignal.class.st @@ -1,6 +1,6 @@ Class { #name : #PharoLinkErrorRequestSignal, - #superclass : #BeaconSignal, + #superclass : #PharoLinkSignal, #instVars : [ 'dictionary' ], diff --git a/src/PharoLink/PharoLinkRegistry.class.st b/src/PharoLink/PharoLinkRegistry.class.st index f0c1d6a..74babf0 100644 --- a/src/PharoLink/PharoLinkRegistry.class.st +++ b/src/PharoLink/PharoLinkRegistry.class.st @@ -3,7 +3,8 @@ Class { #superclass : #Object, #instVars : [ 'idToObjMap', - 'objToIdMap' + 'objToIdMap', + 'oldIds' ], #classVars : [ 'Default' @@ -46,11 +47,15 @@ PharoLinkRegistry >> createNewObjId [ { #category : #registry } PharoLinkRegistry >> deregister: anObjId [ "Remove the supplied id" - | object | + | object olds | - object := idToObjMap at: anObjId ifAbsent: [ ^ nil ]. + olds := oldIds at: anObjId ifAbsentPut: [ OrderedCollection new ]. + object := idToObjMap at: anObjId ifAbsent: + [ olds add: DateAndTime now -> #missing. + ^ nil ]. idToObjMap removeKey: anObjId. objToIdMap removeKey: object. + olds add: DateAndTime now -> object class name. ^ nil. ] @@ -67,6 +72,7 @@ PharoLinkRegistry >> initialize [ super initialize. idToObjMap := Dictionary new. objToIdMap := Dictionary new. + oldIds := Dictionary new. ] { #category : #registry } @@ -135,7 +141,9 @@ PharoLinkRegistry >> register: anObject withId: newObjId [ PharoLinkRegistry >> resolve: objId [ "Answer the object with the supplied id" - ^ idToObjMap - at: objId - ifAbsent: [ PharoLinkRegistryUnknownObjectError signalId: objId ] + ^ idToObjMap at: objId ifAbsent: + [ PharoLinkRegistryUnknownIdSignal new + unknownId: objId; + isOld: (oldIds includes: objId). + PharoLinkRegistryUnknownObjectError signalId: objId ] ] diff --git a/src/PharoLink/PharoLinkRegistryDifferentIdError.class.st b/src/PharoLink/PharoLinkRegistryDifferentIdError.class.st index 2f0eaf2..8a0a2d3 100644 --- a/src/PharoLink/PharoLinkRegistryDifferentIdError.class.st +++ b/src/PharoLink/PharoLinkRegistryDifferentIdError.class.st @@ -20,21 +20,21 @@ PharoLinkRegistryDifferentIdError class >> signalId: objId object: anObject [ ] { #category : #accessing } -PharoLinkRegistryDifferentIdError >> object [ - ^ object +PharoLinkRegistryDifferentIdError >> objId [ + ^ objId ] { #category : #accessing } -PharoLinkRegistryDifferentIdError >> object: anObject [ - object := anObject +PharoLinkRegistryDifferentIdError >> objId: anObject [ + objId := anObject ] { #category : #accessing } -PharoLinkRegistryDifferentIdError >> objId [ - ^ objId +PharoLinkRegistryDifferentIdError >> object [ + ^ object ] { #category : #accessing } -PharoLinkRegistryDifferentIdError >> objId: anObject [ - objId := anObject +PharoLinkRegistryDifferentIdError >> object: anObject [ + object := anObject ] diff --git a/src/PharoLink/PharoLinkRegistryUnknownIdSignal.class.st b/src/PharoLink/PharoLinkRegistryUnknownIdSignal.class.st new file mode 100644 index 0000000..36b29f8 --- /dev/null +++ b/src/PharoLink/PharoLinkRegistryUnknownIdSignal.class.st @@ -0,0 +1,29 @@ +Class { + #name : #PharoLinkRegistryUnknownIdSignal, + #superclass : #PharoLinkServerSignal, + #instVars : [ + 'unknownId', + 'isOld' + ], + #category : #'PharoLink-Registry' +} + +{ #category : #accessing } +PharoLinkRegistryUnknownIdSignal >> isOld [ + ^ isOld +] + +{ #category : #accessing } +PharoLinkRegistryUnknownIdSignal >> isOld: anObject [ + isOld := anObject +] + +{ #category : #accessing } +PharoLinkRegistryUnknownIdSignal >> unknownId [ + ^ unknownId +] + +{ #category : #accessing } +PharoLinkRegistryUnknownIdSignal >> unknownId: anObject [ + unknownId := anObject +] diff --git a/src/PharoLink/PharoLinkServerConnection.class.st b/src/PharoLink/PharoLinkServerConnection.class.st index 20e8c2c..5bc59bd 100644 --- a/src/PharoLink/PharoLinkServerConnection.class.st +++ b/src/PharoLink/PharoLinkServerConnection.class.st @@ -45,6 +45,28 @@ PharoLinkServerConnection >> globals [ ^ server globals ] +{ #category : #private } +PharoLinkServerConnection >> handlEnqueue: aDictionary [ + "Process the supplied statements" + | command bindings | + + bindings := Dictionary new. + (aDictionary at: #bindings) keysAndValuesDo: [ :key :value | + bindings + at: key asSymbol + put: (self deserialize: value) ]. + command := PharoLinkEvalCommand + source: (aDictionary at: #statements) + bindings: bindings + id: (aDictionary at: #commandId). + command connection: self. + processes add: ([ + PharoLinkServerCurrentConnection + value: self + during: [ command execute: self globals ] ] forkAt: + Processor userSchedulingPriority) +] + { #category : #'error handling' } PharoLinkServerConnection >> handleError: aDictionary [ @@ -106,28 +128,6 @@ PharoLinkServerConnection >> handleNextRequestSafely [ do: [ :ex | self notifyError: ex in: request ] ] -{ #category : #private } -PharoLinkServerConnection >> handlEnqueue: aDictionary [ - "Process the supplied statements" - | command bindings | - - bindings := Dictionary new. - (aDictionary at: #bindings) keysAndValuesDo: [ :key :value | - bindings - at: key asSymbol - put: (self deserialize: value) ]. - command := PharoLinkEvalCommand - source: (aDictionary at: #statements) - bindings: bindings - id: (aDictionary at: #commandId). - command connection: self. - processes add: ([ - PharoLinkServerCurrentConnection - value: self - during: [ command execute: self globals ] ] forkAt: - Processor userSchedulingPriority) -] - { #category : #public } PharoLinkServerConnection >> handleRequest: aDictionary [ | type syncId registryEntry | diff --git a/src/PharoLink/PharoLinkServerSignal.class.st b/src/PharoLink/PharoLinkServerSignal.class.st new file mode 100644 index 0000000..bc18f03 --- /dev/null +++ b/src/PharoLink/PharoLinkServerSignal.class.st @@ -0,0 +1,5 @@ +Class { + #name : #PharoLinkServerSignal, + #superclass : #PharoLinkSignal, + #category : #'PharoLink-Signals' +} diff --git a/src/PharoLink/PharoLinkTestCaseEndAnnouncement.class.st b/src/PharoLink/PharoLinkTestCaseEndAnnouncement.class.st index e7c8291..70e364a 100644 --- a/src/PharoLink/PharoLinkTestCaseEndAnnouncement.class.st +++ b/src/PharoLink/PharoLinkTestCaseEndAnnouncement.class.st @@ -61,6 +61,12 @@ PharoLinkTestCaseEndAnnouncement class >> testCase: aTestCase startTimestamp: aD yourself ] +{ #category : #adding } +PharoLinkTestCaseEndAnnouncement >> addToTestResult: aTestResult [ + + self subclassResponsibility +] + { #category : #accessing } PharoLinkTestCaseEndAnnouncement >> additionalProperties [ ^ additionalProperties @@ -71,12 +77,6 @@ PharoLinkTestCaseEndAnnouncement >> additionalProperties: aDictionary [ ^ additionalProperties := aDictionary ] -{ #category : #adding } -PharoLinkTestCaseEndAnnouncement >> addToTestResult: aTestResult [ - - self subclassResponsibility -] - { #category : #accessing } PharoLinkTestCaseEndAnnouncement >> asGtExampleResult [ "Answer the receiver wrapped in the appropriate GtExampleResultX class." diff --git a/src/PharoLink/PharoLinkTraceGroup.class.st b/src/PharoLink/PharoLinkTraceGroup.class.st index d1d59ef..e89e14e 100644 --- a/src/PharoLink/PharoLinkTraceGroup.class.st +++ b/src/PharoLink/PharoLinkTraceGroup.class.st @@ -31,6 +31,14 @@ PharoLinkTraceGroup >> populateTree [ self traces do: [ :trace | self addToTreeTrace: trace ] ] +{ #category : #initialization } +PharoLinkTraceGroup >> traceStrings: aCollection [ + + self traces: (aCollection collect: [ :string | + PharoLinkTrace new traceString: string ]). + +] + { #category : #accessing } PharoLinkTraceGroup >> traces [ @@ -43,11 +51,3 @@ PharoLinkTraceGroup >> traces: aCollection [ traces := aCollection. self populateTree. ] - -{ #category : #initialization } -PharoLinkTraceGroup >> traceStrings: aCollection [ - - self traces: (aCollection collect: [ :string | - PharoLinkTrace new traceString: string ]). - -] diff --git a/src/PharoLink/TGtPharoLinkPlayground.trait.st b/src/PharoLink/TGtPharoLinkPlayground.trait.st index 8bc73e7..56be532 100644 --- a/src/PharoLink/TGtPharoLinkPlayground.trait.st +++ b/src/PharoLink/TGtPharoLinkPlayground.trait.st @@ -77,13 +77,6 @@ TGtPharoLinkPlayground >> gtPlaygroundText [ ^ self gtPlaygroundString asRopedText attributesBuilder ] -{ #category : #'ui - accessing' } -TGtPharoLinkPlayground >> gtPlaygroundXdocStore [ - "Answer the XDoc store for the receiver." - - ^ XdKeyDocumentStore forKey: self gtPlaygroundXDocStoreKey -] - { #category : #'ui - accessing' } TGtPharoLinkPlayground >> gtPlaygroundXDocStoreKey [ "Answer the key to be used for storing documents. @@ -91,3 +84,10 @@ TGtPharoLinkPlayground >> gtPlaygroundXDocStoreKey [ ^ self class name ] + +{ #category : #'ui - accessing' } +TGtPharoLinkPlayground >> gtPlaygroundXdocStore [ + "Answer the XDoc store for the receiver." + + ^ XdKeyDocumentStore forKey: self gtPlaygroundXDocStoreKey +]